A backup font for the rarer signs
Chain several fonts together: each character is drawn by the first one in the list that has a shape for it.
Summary
No font carries every sign in the world. A handsome text font may well know nothing of the Greek alphabet, of an ideogram, or of a rarer currency symbol, and what it cannot draw comes out as an empty box. Line up a second font behind it, and a third behind that, and the reader sees a complete text instead.
Technically
Written at the top level of a request, under
"font_chains"
font_chains declares a font made of several others, under its own name, and no font of its own: a run is split character by character, and each character is drawn by the first font of the chain that carries a shape for it, so what reaches the file is the fonts already declared. Each font in the chain stays usable as it is elsewhere. Links are looked for among the embedded fonts, the client's, the font store's, and among the fonts the request declares itself: the fourteen normalised fonts, the Type 1 programs, the drawn letters.
Request schema
-
font_chains— array, optional, empty by default. -
font_chains[].name— string, required. The name items set text in the chain by. -
font_chains[].faces— array of strings, required, at least two names. The fonts it is made of, in the order a character is offered to them. A chain of one name is refused.
A link names an embedded font, a client font, one from the font store, or a font the request declares: standard_fonts, type1_fonts, type3_fonts. The fonts a request declares are loaded before the chains, so a chain can lean on them.
A whole request that creates a PDF
{
"standard_fonts": [
{ "name": "sans", "face": "helvetica" },
{ "name": "signs", "face": "symbol" }
],
"font_chains": [
{ "name": "text_and_signs", "faces": ["sans", "signs"] }
],
"items": [
{
"type": "text",
"rect": { "llx": 60, "lly": 740, "urx": 535, "ury": 765 },
"content": ["Angle α = 30 degrees"],
"font": "text_and_signs",
"font_size": 14
}
]
}
The fonts
Carrying a font inside the document The older Type 1 font programs The fourteen fonts all reading software owns The typographic niceties of a font A font whose letters you draw yourself Fonts whose letters cost one byte
Where to go next
Every JSON key of a request, in one page The other forty-one settings of a request