/

Font configuration

The .font docs ↗ function overrides the global font configuration.

Font family parameters

You can load a font family from any of the following sources (case-sensitive):

The function provides the following optional parameters for setting custom font families:

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.

Other parameters

Fallbacks for multi-language documents

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.

Example 1

.font {GoogleFonts:Ma Shan Zheng}
.font {GoogleFonts:Corinthia}
Multi-language fonts