[HarfBuzz] No kerning?

Behdad Esfahbod behdad.esfahbod at gmail.com
Mon Oct 5 14:27:05 PDT 2015


The version of the font from Jamie *does* have a kern table.

HB is kerning just fine:

behdad:~ 0$ hb-shape Roboto-Regular.ttf Test
[T=0+1126|e=1+1072|s=2+1071|t=3+690]
behdad:~ 0$ hb-shape Roboto-Regular.ttf Test --features=-kern
[T=0+1225|e=1+1072|s=2+1071|t=3+690]

If I drop the GPOS table from font, HB will use the kern table, which produces
slightly different kerning:

$ hb-shape Roboto-Regular#1.ttf Test
[T=0+1175|e=1 at -49,0+1023|s=2+1071|t=3+690]

but this one is kerned *less*.

I have no idea why you get such different results.

Attaching the font without GPOS table for you to test.

b

On 15-10-05 04:54 PM, Nikolay Sivov wrote:
> On 05.10.2015 23:17, Jamie Dale wrote:
>> I don't know what font data our "kerning only" implementation is using
>> under the hood, but the kerning used when calculating the advance is
>> from a call to FT_Get_Kerning with the FT_KERNING_DEFAULT flag. We only
>> do this when FT_HAS_KERNING reports that the font has kerning data, and
>> the remainder of the advance comes from the advance.x value on the
>> FT_GlyphSlot for the glyph, such that:
>>
>> TotalAdvance = Kerning + GlyphSlotAdvanceX;
> 
> If that's the case it sounds like HB variant actually the one that gives you
> kerned advances, and not FT_Get_Kerning one, because freetype kerning is based
> on glyph pairs data from 'kern' table, and like I said this font doesn't have it.
> 
> I think you could try ftstring demo program from freetype-demos, to see if
> switching kerning on and off makes any difference. You can also visually
> compare output.
> 
>>
>> -Jamie.
>>
>> On 5 October 2015 at 20:49, Nikolay Sivov <bunglehead at gmail.com
>> <mailto:bunglehead at gmail.com>> wrote:
>>
>>     On 05.10.2015 22:32, Jamie Dale wrote:
>>
>>
>>         The images below are using the Roboto font, and show the output from
>>         each implementation.
>>         The top image is using our "kerning only" implementation, and
>>         the bottom
>>         image is using HarfBuzz. Note that the "T" and "e" characters are
>>         further apart in the bottom image.
>>
>>
>>     Roboto-Regular.ttf from https://github.com/google/roboto doesn't
>>     have 'kern' table, so the only way to enable kerning for it is to
>>     use GPOS kern feature.
>>
>>     What does your "kerning only" implementation do? It only applies
>>     this GPOS feature skipping the rest of shaping/positioning stuff?
>>
>>     _______________________________________________
>>     HarfBuzz mailing list
>>     HarfBuzz at lists.freedesktop.org <mailto:HarfBuzz at lists.freedesktop.org>
>>     http://lists.freedesktop.org/mailman/listinfo/harfbuzz
>>
>>
> 
> _______________________________________________
> HarfBuzz mailing list
> HarfBuzz at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/harfbuzz
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Roboto-Regular#1.ttf
Type: application/x-font-ttf
Size: 120600 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/harfbuzz/attachments/20151005/80ba22cd/attachment-0001.bin>


More information about the HarfBuzz mailing list