Search code examples
characterfreetypekerning

FT_Get_Kerning returns 0 vector


I check if my TTF file has kerning information using FT_HAS_KERNING, and this returns true.

I then use:

 FT_Vector delta;
 FT_Get_Kerning( face, prev, next, FT_KERNING_DEFAULT, &delta );

to determine the kerning value, but both delta.x and delta.y have values of 0.

From the docs it seems that this means an error has occurred - how can I debug what the problem is even though FT_HAS_KERNING returns true?

All I want to do is fix the spacing between characters, as they currently appear strangely spaced.


Solution

  • I ended up downloading the TTX tool to look inside my TTF file and it turns out there was no kerning information in here for the pairs I desired.