freetype2/src/truetype
David Saltzman 8f286c86ef Add support for kerning from 'GPOS' tables.
This commit adds support for kerning from 'GPOS' tables, while maintaining
support for basic 'kern' tables.  `FT_HAS_KERNING` will be true for a font
with either available and `FT_Get_Kerning` will still use the basic 'kern'
table data if avilable, otherwise check the GPOS 'kern' feature.

This feature is disabled by default; it can be enabled with the
`TT_CONFIG_OPTION_GPOS_KERNING` flag.

Only basic kerning (pair positioning with just an x advance) is supported
from the GPOS layout features; support for that was added to make the
existing `FT_Get_Kerning` API more consistently functional.  FreeType does
not intend to extend itself to further GPOS functionality though; a
higher-level library like HarfBuzz can be used instead for that.

* include/freetype/config/ftoption.h, include/devel/ftoption.h
(TT_CONFIG_OPTION_GPOS_KERNING): New configuration option.

* include/freetype/internal/fttrace.h: Add `ttgpos` trace handler.

* include/freetype/internal/sfnt.h (SFNT_Interface): Add `load_gpos` and
`get_gpos_kerning` fields.
(FT_DEFINE_SFNT_INTERFACE): Updated.

* include/freetype/internal/tttypes.h: Include `fttypes.h`.
(TT_FaceRec) [TT_CONFIG_OPTION_GPOS_KERNING]: Add `gpos_table` and
`gpos_kerning_available` fields.

* src/sfnt/ttgpos.c, src/sfnt/ttgpos.h: New files.

* src/sfnt/sfdriver.c [TT_CONFIG_OPTION_GPOS_KERNING]: Include `ttgpos.h`.
(sfnt_interface): Updated.

* src/sfnt/sfnt.c: Include `ttgpos.c`.

* src/sfnt/sfobjs.c [TT_CONFIG_OPTION_GPOS_KERNING]: Include `ttgpos.h`.
(sfnt_load_face) [TT_CONFIG_OPTION_GPOS_KERNING]: Load and free GPOS kerning
data; check GPOS kerning availability.

* src/truetype/ttdriver.c (tt_get_kerning): Use GPOS kerning if there's no
'kern' table.
2024-01-27 10:55:04 +01:00
..
module.mk Update all copyright notices. 2023-01-17 09:18:25 +01:00
rules.mk [truetype] Remove Infinality for good. 2023-07-27 15:06:38 +00:00
truetype.c [truetype] Remove Infinality for good. 2023-07-27 15:06:38 +00:00
ttdriver.c Add support for kerning from 'GPOS' tables. 2024-01-27 10:55:04 +01:00
ttdriver.h Update all copyright notices. 2023-01-17 09:18:25 +01:00
tterrors.h Update all copyright notices. 2023-01-17 09:18:25 +01:00
ttgload.c Comment typos. 2023-09-24 20:09:17 -04:00
ttgload.h Update all copyright notices. 2023-01-17 09:18:25 +01:00
ttgxvar.c * src/truetype/ttgxvar.c (ft_var_to_normalized): Fix undefined left-shift. 2023-12-14 06:14:43 +01:00
ttgxvar.h * src/truetype/*: Clean up interface. 2023-05-07 14:59:50 +02:00
ttinterp.c [truetype] Remove Infinality for good (remaining bits). 2023-07-27 16:12:28 +00:00
ttinterp.h [truetype] Remove Infinality for good. 2023-07-27 15:06:38 +00:00
ttobjs.c [cff, truetype] Improve prefix and suffix removal. 2023-09-07 23:50:35 -04:00
ttobjs.h [truetype] Remove Infinality for good (remaining bits). 2023-07-27 16:12:28 +00:00
ttpload.c * src/truetype/*: Clean up interface. 2023-05-07 14:59:50 +02:00
ttpload.h * src/truetype/*: Clean up interface. 2023-05-07 14:59:50 +02:00