ttf-to-woff2
is a C++ library in development aimed at parsing TrueType Font (TTF) files and converting them into the WOFF2 format. This library provides the tools necessary to extract an array of font metrics and mappings from TTF files - and ideally will do so in a multi-threaded fashion.
This project currently doesn't convert to WOFF2! It is still a work in progress.
- TTF Parsing: Decode and understand the structure of TTF files.
- WOFF2 Conversion: Take the parsed TTF information and generate WOFF2 formatted font files.
- Font Metrics Extraction: Retrieve crucial metrics that dictate font rendering and layout.
head
- Contains global information about the font.hhea
- Horizontal header, contains metrics and other data for horizontal writing.hmtx
- Horizontal metrics, provides widths and left side bearings of glyphs.name
- Naming table, contains textual information related to the font.os/2
- OS/2 and Windows-specific metrics.post
- PostScript-related information.loca
- Index to location, provides offsets to glyph data.kern
- Kerning, specifies spacing between certain character pairs.fvar
- Font variations, used in variable fonts to define axes and styles.gvar
- Glyph variations, provides glyph variations for variable fonts.glyf
- Glyph Datacmap
- Character to glyph mapping, defines the mapping of character codes to glyph indices.maxp
- Maximum profile, contains size and other metrics needed for the layout.gpos
- Glyph positioning (Work in Progress).
cvt
- Control Value Tablefpgm
- Font Programhdmx
- Horizontal Device MetricsLTSH
- Linear Threshold Dataprep
- Control Value ProgramVDMX
- Vertical Device Metricsvhea
- Vertical Metrics Headervmtx
- Vertical MetricsBASE
- Baseline DataGDEF
- Glyph Definition DataGSUB
- Glyph Substitution DataJSTF
- Justification DataEBDT
- Embedded Bitmap Data (also for EBLT and EBSC)bdat
- Bitmap Databloc
- Bitmap Data TablesCOLR
- Colour TableCPAL
- Colour Palette TableSVG
- SVG Table for colour fontssbix
- Standard Bitmap Graphics TableMATH
- Math Layout Parameters
...and there are others as well.
This project is licensed under the MIT License. See LICENSE for more details.