Fixed overflowing lines overlapping

Fixed enlarged and overflowing textlines not to overlap anymore in some
case.

Made spacing of 30% per textline to each other to a fixed variable in
lineSpacingPercent

Renamed pages to canvasPages for clarity.
Renamed openTags in resetStyle to openTagCount not to overlap with
"openTags" array in code.

Optimized optimalY calculation, elimination two identical loops while we
are already iterating over the lines.