Fonts
Default fonts, registering fonts and Google Fonts on each engine.
Without a registered font
| Chromium | Forme | |
|---|---|---|
| Latin | Rendered | Helvetica, Times or Courier; regular and bold Helvetica embedded |
| Latin Extended, Greek, Cyrillic | Rendered | Noto Sans, embedded |
| Arabic, Hebrew, Hindi, Thai | Rendered; right-to-left text is shaped correctly | Rendered with built-in Noto fonts, embedded; Arabic-Indic and Persian digits are refused (422) |
| Chinese, Japanese, Korean | Rendered | Refused (422) until a font covering them is linked or registered; see Chinese, Japanese and Korean on Forme |
| Emoji | Rendered in color | Rendered in monochrome with Noto Emoji, embedded |
| Embedding | Fonts are embedded and subset | See above |
Chromium maps the generic families as follows:
| Family | Font |
|---|---|
serif | Liberation Serif |
sans-serif | Liberation Sans |
monospace | DejaVu Sans Mono |
system-ui | DejaVu Sans |
Forme maps sans-serif, serif and monospace to Helvetica, Times and Courier, and Noto Sans covers the Latin Extended, Greek and Cyrillic text they lack.
Forme embeds regular and bold Helvetica as Liberation Sans, a metric-compatible substitute subset to the characters used; layout does not change. Italic Helvetica, Times and Courier are not embedded: they are PDF standard fonts that viewers supply. Register a font when the exact rendering matters.
Forme's built-in Arabic, Hebrew, Hindi, Thai and emoji fonts have a regular face only: bold and italic text in these scripts is drawn with it. They cover the document's text, not characters written in CSS such as margin-box content.
With Forme, a character no available font covers is refused with 422 unsupported_document. unsupported lists it as character "<c>" (U+<hex>) is not covered by any font; for a Chinese, Japanese or Korean character it names the Noto family to link. Register a TrueType font that covers it.
Chinese, Japanese and Korean on Forme
Link the Google Fonts stylesheet of the script's Noto family:
| Script | Family |
|---|---|
| Korean | Noto Sans KR |
| Japanese | Noto Sans JP |
| Chinese | Noto Sans SC (Simplified) or Noto Sans TC (Traditional) |
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;700" />
<style>
body {
font-family: "Noto Sans JP";
}
</style>The stylesheet is fetched as a subset holding the document's characters, up to 800 distinct characters. A document with more fetches the whole font, which can exceed the 2 MiB fetched-font limit: it is skipped with reason font_too_large and the render is refused (422).
Register a font
Register a font with @font-face, then use it with font-family:
<style>
@font-face {
font-family: "Inter";
font-weight: 400;
font-style: normal;
src: url("https://example.com/fonts/Inter-Regular.ttf");
}
@font-face {
font-family: "Inter";
font-weight: 700;
font-style: normal;
src: url("https://example.com/fonts/Inter-Bold.ttf");
}
body {
font-family: "Inter";
font-size: 11pt;
}
</style>The source can be a URL, a base64 data: URI, or a template asset (asset:<filename>; see Template assets).
Google Fonts
A Google Fonts stylesheet <link> works on both engines:
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700" />Forme rules
| Rule | Detail |
|---|---|
| TrueType only | OpenType with CFF outlines, WOFF, WOFF2 and collections are refused. A fetched font in such a format is skipped. |
| Register every weight and style | font-weight is normal, bold or a number; font-style is normal or italic. A style with no registered face falls back to Helvetica. |
WOFF2 @font-face | Skipped with reason font_format; the text falls back to Helvetica and the PDF is produced. |
Chromium accepts fonts in any web format.
Fetched fonts
A font fetched from a URL is at most 2 MiB; a larger one is skipped with reason font_too_large. See Remote resources.