[cff] Support GPOS kerning.

* src/cff/cffdrivr.c (cff_get_kerning) [TT_CONFIG_OPTION_GPOS_KERNING]: Add
  code similar to the one in `tt_get_kerning`.
This commit is contained in:
Werner Lemberg
2025-07-04 06:12:34 +02:00
parent fb6a74269d
commit ecbc1abfa8

View File

@@ -121,7 +121,20 @@
kerning->y = 0;
if ( sfnt )
kerning->x = sfnt->get_kerning( cffface, left_glyph, right_glyph );
{
/* Use 'kern' table if available since that can be faster; otherwise */
/* use GPOS kerning pairs if available. */
if ( cffface->kern_avail_bits )
kerning->x = sfnt->get_kerning( cffface,
left_glyph,
right_glyph );
#ifdef TT_CONFIG_OPTION_GPOS_KERNING
else if ( cffface->gpos_kerning_available )
kerning->x = sfnt->get_gpos_kerning( cffface,
left_glyph,
right_glyph );
#endif
}
return FT_Err_Ok;
}