[HarfBuzz] behavior of mark-width-zeroing

Behdad Esfahbod behdad at behdad.org
Mon Jun 9 14:15:06 PDT 2014


On 14-06-09 10:12 AM, Jonathan Kew wrote:
> Hi Behdad,
> 
> Our current mark-zeroing code, in zero_mark_widths_by_gdef() and
> zero_mark_widths_by_unicode(), modifies only the advance of the glyphs, so
> that they no longer take up any space on the line.

Right.


> I'm wondering whether we should also adjust the offset, by subtracting the
> advance from it before we zero the advance. (Though perhaps only if there's no
> GPOS positioning?)

We definitely need to test what Uniscribe does, eg. for Latin.  Note that any
offsetting should only happen in LTR, not RTL.


> In particular, this is required for correct rendering of old fonts such as MS
> Sans Serif codepage 874 (Thai), which has spacing glyphs for the Thai
> vowel/tone marks.

Note that Thai and Hangul might be more affected as they have
fallback_position turned off.  The default shaper has fallback_position turned
on which takes care of this.


> AFAICT, what Uniscribe does with it is to zero their advance
> width *and* offset them to the left by their original advance, so that they
> overstrike the preceding glyph, even though the images in the font appear to
> the right of the origin.
> 
> WDYT? Can you think of fonts where this would *not* be appropriate?

The reason we turned fallback positioning off for Thai had to do with vertical
positioning IIRC.  Maybe we should turn it on for horizontal but not vertical?
 I don't remember why we did that for Hangul, perhaps because of the special
logic we have for tone marks.


-- 
behdad
http://behdad.org/


More information about the HarfBuzz mailing list