[HarfBuzz] patch for kerning problem

Denis Jacquerye moyogo at gmail.com
Mon Apr 2 05:53:09 PDT 2007


On 4/2/07, Simon Hausmann <simon.hausmann at trolltech.com> wrote:
> Hi,
>
> I have noticed one ugly problem when applying kerning through OpenType with
> Harfbuzz. For example when shaping the string "Tex" with DejaVu at say 12
> points the "T" and the "e" are nicely kerned together. However as soon as the
> string changes to for example "QTex" the kerning between the "T" and the "e"
> disappears for no apparent reason.
>
> Well, I just dug into it and I think I've found the reason. It appears that
> the coverage table for the first glyph Pair Adjustment Positioning subtable
> has an entry for "Q" as well as for "T". So when we're at the "QT" pair we
> find "Q" in the coverage table, increment buffer->in_pos and check if we have
> a value record for the second glyph pointed at by buffer->in_pos. That is
> certainly the case for "Te", but it is not the case for "QT" and we return.
> However buffer->in_pos points at the second glyph now and the caller
> (Do_String_Lookup) advances buffer->in_pos once more if we return
> Not_Covered. Therefore we skip the lookup of "T" for the "Te" pair and thus
> never kern that pair.
>
> The patch below tries to correct this in Lookup_PairPos. Anybody up for a
> patch review? :)

Hi Simon,

That patch works for me.

Cheers,

Denis Moyogo Jacquerye



More information about the HarfBuzz mailing list