libsfnt is a small OpenType/SFNT font file parser
libsfnt is a library for parsing OpenType/TrueType/SFNT files. It does only that, in particular it is neither a font renderer, TrueType bytecode interpreter, script layout engine, and whatnot. For a more comprehensive explanation of the rationale behind this library, see font.
The SFNT file format (which is a generic format that is used for TrueType and
OpenType fonts) contains various sections, that are called tables. For example,
TrueType fonts will include a table called “glyf”, containing glyph outline
data. libsfnt can parse these tables into corresponding C structures. It
provides functions to:
- read SFNT data types (integers, fixed point numbers, …)
- read SFNT tables
- perform some common table-specific operations on some tables
The data types reading functions can be used to implement parsing of tables that
are not yet implemented in libsfnt.
As of now, the following groups of table are implemented:
- required tables
- TrueType tables
- CFF tables (but not CFF data parsing)
- SVG tables (but not SVG data parsing)
The following tables are not yet implemented, but might be in the future:
- bitmap tables
- optional tables (or a subset of them)
The following tables are not supported, and won’t be in libsfnt:
- Advanced Typographic Tables (AAT): these are way too complex and would warrant a dedicated library
libsfnt is hosted here.
The general installation instructions can be followed to
install the library. It is packaged in our
Gentoo overlay as
dev-libs/libsfnt.