Skip to content

text: Make bitmap glyphs less broken (and remove unneeded transform)

Alvin Wong requested to merge alvinwong/krita:alvin/glyph-transform into master

The first commit removes an unneeded FT_Get_Transform. If a transform has been set on the glyph slot, FT_Load_Glyph would have already applied the transform to the glyph outline, so getting the matrix and transforming the outline manually again would not be correct. Moreover, we don't set a transform on the glyph shot in the first place, so it always gives an identity transform which does nothing. (I'm keeping glyphTf because I will be reusing it for synthesizing italic.)

The second commit rewrites the bitmap glyph bounding box calculation to sure the bounding box is the same size as the bitmap so they won't be scaled, and also tries to position glyphs more correctly in vertical layout. This got bitmap glyphs to look less broken, but this is not a complete fix and there are still various issues with the layout.

Some before and after comparisons:

Before After
圖片 圖片
Note: Right side uses outline font.
圖片

圖片
(The leftmost line is positioned wrong caused by a separate bug, haven't figured out why yet.)

Merge request reports