The .font docs ↗ function overrides the global font configuration.
You can load a font family from any of the following sources (case-sensitive):
path/to/font.ttfhttps://example.com/font.ttfArial, Times New RomanGoogleFonts:Roboto, GoogleFonts:Noto SansThe function provides the following optional parameters for setting custom font families:
main: font family for all text content. This also applies to headings if the current theme does not specify a different font for them.heading: font family for headings (titles). Overrides main.code: font family for code blocks and code spans. Overrides main.Example:
.font {fonts/Inter.ttf} heading:{GoogleFonts:Poppins} code:{Courier New}Font resources are processed by the media storage system. This ensures that, for example, HTML output includes local fonts in the output directory for increased portability.
Note that system fonts may not be installed on all devices. While this should not affect PDF output, it can be problematic when sharing HTML output.
size: base font size. Other elements, such as headings, scale accordingly. For example, 12px.Multiple .font calls create overlapping font configurations. Each font configuration overrides the previous one as long as it contains glyphs for the characters being rendered. Otherwise, Quarkdown uses the previous font configuration as a fallback.
This is particularly useful for multi-language documents, such as documents containing both Latin and CJK (Chinese, Japanese, Korean) characters. For example, you can set a primary font for Latin characters and a fallback font for CJK characters, as shown in the following example.
.font {GoogleFonts:Ma Shan Zheng}
.font {GoogleFonts:Corinthia}