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.
Written at the top level of a request, under
"type1_fonts"
In plain words
Written for anybody. It says what this puts on a sheet of paper, and asks nothing of you beyond that.
Computer typefaces have had several formats over the years, the way photographs have had several formats. A studio that has been working for a long while owns typefaces in an older format, bought at the time, and has no wish to buy everything again. Those typefaces work here too: they are sent with the document, they travel inside it, and the result shows anywhere.
For a developer
Written for somebody who writes the calling program: the model, the units, and the settings that carry the weight.
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. The program is carried into the document whole, as it was supplied.
Every key, with its default
The reference: which keys are required, which are optional, what each one defaults to and which combinations the server declines.
-
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 draws it
Post this as it stands and a PDF comes back. Nothing has been left out of it.
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 part of the same call.
{
"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 lettering
Carrying a font inside the document The fourteen faces every reader owns The typographic niceties of a face A face whose letters you draw yourself A backup face for the rarer signs
Where to go next
Every key of a request, in one page The other thirty-two settings of a request
Glossary
- byte
- The unit a file's weight is counted in, the way a parcel is counted in grams. A thousand of them make a kilobyte, and a million make a megabyte — the size of one photograph taken with a telephone. A one-page PDF here weighs between six thousand and a hundred and twenty thousand, so a hundred of them fit in the space of five photographs.
- font
- The drawing of every letter, digit and mark a document writes, held in a file of its own. A PDF carries the fonts it is set in inside itself, which is why it opens looking the same on a machine that has never had them. Leave them out and a reader puts another font in their place, and the layout moves.
- request
- One call to the service: you send what the document should say, and get the document back. Your bill counts these calls, one for each document. The number of pages inside a document is never counted.
- Type 1 font
- The older shape a typeface file comes in, still used where a particular cut of a typeface only ever existed that way. A document carries the file as it was supplied.