[HarfBuzz] Why does kerning modify glyph advance?

Jonathan Kew jonathan at jfkew.plus.com
Mon Feb 14 06:42:47 PST 2011


On 14 Feb 2011, at 12:20, Tom Hacohen wrote:

> Dear all,
> 
> Hey, there's a question I've been meaning to ask for a long time now,
> why does kerning modify the x_advance and not the x_offset? The way I
> see it, with this behavior x_advance of a char depends on it's position
> which eliminates the possibility of caching it, while putting it in
> x_offset (which is already position dependent) will allow it.

Modifying x_offset alone would adjust the position of a glyph but not the position of any following glyphs, which is not the effect you want kerning to have. (OTOH, it's usually appropriate for things like accent positioning.)

(How would you expect to make use of caching the "x_advance of a char"? Did you perhaps mean glyph here, rather than character? *Character* advances are context-dependent even without the presence of kerning, as there might be contextual substitutions that give you entirely different glyphs.)

JK




More information about the HarfBuzz mailing list