freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Devel] Kerning problem with capitals


From: Robert Clark
Subject: Re: [Devel] Kerning problem with capitals
Date: Wed, 08 Dec 2004 14:55:40 +0000

On Tue, 2004-12-07 at 22:08 +0100, Werner LEMBERG wrote:

> >   I don't know much about fonts, so forgive me if this is a stupid
> > question: How does hinting (bci hinting in this case) interact with
> > kerning?
> 
> It doesn't interact, at least not if the kerning is stored in the
> `kern' table.  If you use the `GPOS' table, it is possible to have
> different kerning for different DPI values (the FreeType library
> doesn't support GPOS kerning -- and never will do).

  I see. So the kerning (which is set based on the outlines) might not
be appropriate for the hinted font.

  Looking at the output from ftstring with kerning disabled, the font
does look much better.

> The proper solution IMHO would be to reduce the advance width of the
> `e' and `d' glyph to be only 7 pixels, not 8 (this is, having no right
> side bearing).  This can be controlled by hinting instructions.  There
> *might* be a bug in FreeType's hinting engine, handling the horizontal
> phantom points incorrectly (those points control the advance width),
> but this is rather unlikely.

  You're right - the code for "e" uses DELTAP1 to increase the advance
at 12ppem, so it's clearly a design decision.

  Looking back at the "Re" kerning and the effect of hinting on it:

Advance for "R":  1423 font units
"Re" kerning:    -92   font units

Total:            1331 = 7.799 pixels @12ppem

which rounds up to 8 pixels. When hinted, however:

Advance for "R":  8 pixels
"Re" kerning:    -1 pixels

Total:            7 pixels

The difference is attributable to the rounding down of -92 font units (=
-0.539 pixels) to -1 pixel combined with the reduction of the advance
from 1423 font units (= 8.338 pixels) to 8 pixels by hinting.

  Just to throw this idea out: what would the effect be if we tried to
correct for this by adjusting the kerning table when hinting? I was
thinking something like adding the difference between the hinted &
unhinted advance of the left glyph. For example:

Advance for "R":         1423 font units
After hinting @12ppem:   8 pixels = 1365 font units
Difference:              58 font units
Corrected "Re" kerning: -92 + 58 = -34 font units (= -0.199 pixels)

There are probably more intelligent methods, though.

  Would this have unintended consequences?

        Robert



reply via email to

[Prev in Thread] Current Thread [Next in Thread]