Developer API

Fonts

Fonts you can use in tools that set text: the 14 standard PDF fonts, 2,030 open-licence Google Fonts families in every script, and the fonts you upload in the Document editor.

Choosing a font

Every tool that sets text uses the same font picker: search by name or by script (Hindi, Bengali, Tamil, Telugu, Arabic, Chinese, Japanese, Korean and more), filter by script, and preview each family in its own face. The chosen font is embedded in the file the tool returns, so the result looks the same on every device.

In the API, the fontFamily option takes a standard PDF font name (helvetica, times, courier); gf:<id>, a catalog family (for example gf:noto-sans-devanagari, gf:noto-naskh-arabic, gf:noto-sans-sc or gf:roboto); or u:<id>, one of your uploaded fonts. A blank value keeps the tool's default font. An id that is not in the catalog is refused before the job starts.

A Hindi text file to PDF in Noto Sans Devanagari
{
  "toolId": "text-to-pdf",
  "parameters": {
    "fontFamily": "gf:noto-sans-devanagari",
    "fontSize": 14
  }
}

Where each font works

Devanagari, Bengali, Tamil, Telugu and Arabic text is shaped (conjuncts, reordered vowel signs, joined Arabic letters, right-to-left order) wherever a catalog font is used. Signed in, the font picker lists your uploaded fonts first, under My fonts.

  • Text, Markdown, CSV and JSON to PDF: every standard font and every catalog family, embedded as a subset of the glyphs the document uses.
  • Add watermark, Add page numbers and Sign PDF (typed signatures and text fields): the standard PDF fonts and every catalog family, embedded as a subset.
  • Watermark image: every catalog family (its bold face when it has one), drawn into the image.
  • The Document editor: the standard fonts, its font library, the catalog and the fonts you upload (kept in your account when you are signed in).

Your uploaded fonts

Fonts you upload in the Document editor (TrueType or OpenType) are kept in your account and work in every tool that sets text: choose them under My fonts, or send fontFamily: u:<id> with the id from your fonts. A job takes its own copy of the font when it is accepted, so deleting the font while the job runs does not affect it; a later job that names the deleted font is refused.

A font id that is not one of yours (another person's, or one you deleted) is refused before the job starts, with the same error either way. A damaged font, or one whose licence forbids embedding, is refused with the reason. Uploaded fonts are personal: an API key uses the fonts of the person it acts for, including in an organisation. Chain and workflow steps use them too, for the person the chain or workflow runs as, with the same checks.

The standard 14 PDF fonts

Every PDF reader has these fonts, so they are referenced by name and never embedded: Helvetica, Helvetica-Bold, Helvetica-Oblique, Helvetica-BoldOblique, Times-Roman, Times-Bold, Times-Italic, Times-BoldItalic, Courier, Courier-Bold, Courier-Oblique, Courier-BoldOblique, Symbol, ZapfDingbats. They cover Latin text only (Symbol and ZapfDingbats are symbol sets).

The font catalog

The catalog is every family in the Google Fonts collection (github.com/google/fonts) at a fixed version. Each family is licensed under the SIL Open Font License, Apache 2.0 or the Ubuntu Font Licence, so it can be embedded in the documents you create.

Families per script: Latin 1,884, Devanagari (Hindi, Marathi, Nepali) 68, Bengali 13, Tamil 19, Telugu 29, Arabic 62, Chinese 29, Japanese 68, Korean 47, Cyrillic 306.

Edge cases

  • A script the font does not cover: characters the chosen font has no glyph for are drawn as empty boxes. Pick a family listed under that script (the picker's script filter shows only those).
  • Variable fonts: a PDF stores one fixed design, so a variable family is embedded at its default weight; when a family also ships separate bold or italic files, those are used for bold and italic text.
  • Copying shaped text (Devanagari, Bengali, Tamil, Telugu, Arabic) out of a PDF can add a space between letter clusters; the characters and their order are kept.
  • Very large families (some Chinese and emoji fonts are over 32 MB) are listed but cannot be chosen in the text tools; the picker says so.
  • If a font cannot be loaded at the moment, the job stops with FONT_CACHE_MISS_OFFLINE; try again later or choose another font.
  • Uploaded fonts are checked when you add them: a damaged file, a web font (WOFF) or a file without outlines or a character map is refused with the reason.