On 26.04.16 23:31, Alexander Scherbatiy wrote:
Now it is possible that width1 is not equal to width2.

Absolutely true. And it is something Swing needs to handle.

   Even more, it is not will be possible to rely on the fact that width
of number of chars is just sum of each char width.

   For example, on graphics configuration with transform 2 the glyph
xAdvance can be 13 and the char width in user space will be calculated
as 13 / 2 = 6.5.
   FontMetrics. charWidth('a') will return 7 and charsWidth(array of 10
'a' ) will be 65 wich is not 7 * 10.

13 / 2 = 6.5 is a fractional data in the user's space and actually such data is a "bug" when the fractional metrics are off. This was discussed a few times when this bug was fixed on OSX. and CStrike code on osx was changed to handle fraction on/off in terms of user's space(not the actual device space=pixels). I guess there is no other solution other than that.


--
Best regards, Sergey.

Reply via email to