The older Type 1 font programs
Carry a Type 1 font into the document, the format of the older typesetting studios, under a name of your choosing.
Summary
Computer fonts have had several formats over the years, the way photographs have. A studio that has been working for a long while owns fonts in an older format, bought at the time, and has no wish to buy everything again. Those fonts work here exactly like the newer ones, and nothing in the finished document tells a reader which format it came from.
Technically
Written at the top level of a request, under
"type1_fonts"
type1_fonts carries the Type 1 programs the request transports, base64-encoded, each under the name items set text in it by. Both shapes are read: the raw program and the segmented form a .pfb file holds. Each is embedded as a /Subtype /Type1 font carrying its /FontFile, a /Differences encoding built from the codes actually drawn, and a ToUnicode map. Nothing is subset: the program is carried into the document whole, as it was supplied.
Request schema
-
type1_fonts— array, optional, empty by default. -
type1_fonts[].name— string, required. The name items set text in this font by. -
type1_fonts[].data— string, required. The bytes of the program, base64-encoded.
The program goes into the document whole; narrowing it down to the characters actually used is planned for a future version. A name declared here is not looked for in the three font sources: the request supplies it itself. It may stand as a link in a font_chains chain.
A whole request that creates a PDF
One name below stands for a font file: put the encoded file in its place, or send the file itself beside the description, as a supplied part of the same call. One page carries a real font already encoded, and its request posts as it stands.
{
"type1_fonts": [
{ "name": "stroke", "data": "PASTE_THE_TYPE1_PROGRAM_BASE64_HERE" }
],
"items": [
{
"type": "text",
"rect": { "llx": 60, "lly": 740, "urx": 535, "ury": 770 },
"content": ["Set in a Type 1 program"],
"font": "stroke",
"font_size": 18
}
]
}
The fonts
Carrying a font inside the document The fourteen fonts all reading software owns The typographic niceties of a font A font whose letters you draw yourself A backup font for the rarer signs 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