Skip to content

Fonts

Within <assets>, a font family can be registered using the syntax:

xml
<assets>
  <fonts>
    <FontName>
      <regular>
        https://fonts.gstatic.com/s/ubuntumono/v19/KFOjCneDtsqEr0keqCMhbCc6CsTYl4BO.woff2
      </regular>

      <bold>
        https://fonts.gstatic.com/s/ubuntumono/v19/KFO-CneDtsqEr0keqCMhbC-BL9H1tY1keXO0.woff2
      </bold>

      <italic>
        https://fonts.gstatic.com/s/ubuntumono/v19/KFOhCneDtsqEr0keqCMhbCc_OsbSkKJMc3s.woff2
      </italic>

      <bold-italic>
        https://fonts.gstatic.com/s/ubuntumono/v19/KFO8CneDtsqEr0keqCMhbCc_Mn33hY9uflG2CVk.woff2
      </bold-italic>
    </FontName>
  </fonts>
</assets>

The font defined above can then be used by setting the attribute font="FontName" on any block or inline element.

A specific font from the above family can be chosen using the font-style attribute. The regular font must be provided, but all others are optional.

Custom Font Weights

You can register specific weight variants for a custom font using weight-{N} tags. Each weight tag contains <regular> and optionally <italic> children:

xml
<assets>
  <fonts>
    <MyFont>
      <regular>https://fonts.example.com/myfont-regular.woff2</regular>
      <weight-300>
        <regular>https://fonts.example.com/myfont-light.woff2</regular>
        <italic>https://fonts.example.com/myfont-light-italic.woff2</italic>
      </weight-300>
      <weight-600>
        <regular>https://fonts.example.com/myfont-semibold.woff2</regular>
      </weight-600>
    </MyFont>
  </fonts>
</assets>

The numeric value in the tag (weight-300, weight-600, etc.) corresponds to CSS font weight values from 100 to 900. Named weights (weight-light, weight-semibold, etc.) are also accepted. These are then available via the font-weight attribute:

xml
<p font="MyFont" font-weight="300">Light custom font text.</p>
<p font="MyFont" font-weight="300" font-style="italic">Light italic custom font text.</p>

Google Fonts

Beyond specifically imported fonts, any Google Font can be accessed by name. For example:

xml
<p font="Roboto" font-style="bold">
  Lorem Ipsum...
</p>