2024-02-06 12:14:07 +01:00
|
|
|
# TrueType font parser
|
2024-02-04 11:07:15 +01:00
|
|
|
|
|
|
|
Fountainhead is a TrueType and OpenType font parser. Its main
|
|
|
|
purpose is to extract information from the fonts to help to
|
|
|
|
embed these fonts into PDF documents. It also supports dumping
|
|
|
|
font information to the screen.
|
|
|
|
|
|
|
|
There is also an executable to dump fonts.
|
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
|
|
|
Add the library as dependency to your project.
|
2024-02-06 12:14:07 +01:00
|
|
|
Alternatively build an executable with:
|
2024-02-04 11:07:15 +01:00
|
|
|
|
|
|
|
```sh
|
|
|
|
cabal build
|
|
|
|
```
|
|
|
|
|
2024-02-06 12:14:07 +01:00
|
|
|
The binary can be run with:
|
2024-02-04 11:07:15 +01:00
|
|
|
|
|
|
|
```sh
|
2024-02-06 12:14:07 +01:00
|
|
|
cabal run fountainhead -- myfont.ttf
|
2024-02-04 11:07:15 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
or installed locally and executed just as:
|
|
|
|
|
|
|
|
```sh
|
2024-02-06 12:14:07 +01:00
|
|
|
fountainhead myfont.ttf
|
2024-02-04 11:07:15 +01:00
|
|
|
```
|
|
|
|
|
2024-02-06 12:14:07 +01:00
|
|
|
This command will output the contents of the font in a format similar to
|
|
|
|
ttfdump from TeXLive.
|
|
|
|
|
2024-02-04 11:07:15 +01:00
|
|
|
See
|
|
|
|
|
|
|
|
```sh
|
|
|
|
fountainhead --help
|
|
|
|
```
|
|
|
|
|
|
|
|
for help.
|
|
|
|
|
|
|
|
## Usage
|
2024-02-13 09:16:14 +01:00
|
|
|
|
|
|
|
TrueType and OpenType fonts consist of a sequence of tables and various
|
|
|
|
informations about the font are encoded in these tables. There are both
|
|
|
|
required and optional tables. The first table is a font directory and it
|
|
|
|
describes the overall structure of the font, what tables it contains and at what
|
|
|
|
offset other tables can be found.
|
|
|
|
|
|
|
|
This library doesn't parse the whole font at once. The font directory has to be
|
|
|
|
parsed first and can be used then to parse further tables as needed.
|