Closed MinimaJack closed 10 years ago
Thanks! Do you like to make a PR? Or do you know a font I can test this case with?
open-sans.regular.ttf --cyrillic symbols samle string: "Відповідальний за здійснення господарської операції і правильність Відповідальний за здійснення господарської операції і правильність"
Hmm... using xAvgCharWidth
seems to be not the correct way of calculating the width of such glyphs. Here is a test (the line break is calculated using .stringWidth()
, i.e., the glyphs are calculated to be wider than they actually are):
this.scaleFactor = 1000.0 / this.tables.head.unitsPerEm
this.xAvgCharWidth = this.tables['OS/2'].xAvgCharWidth * this.scaleFactor;
need to be scaled...not ideal but well
Works sufficiently, thank you!
when this.widths[code] is undefined - use xAvgCharWidth * scale...then all calculated well