Skip to content

Assets

INFO

Assets are currently a work in progress. Right now only fonts are supported, but more features are coming.

A .press file's top-level assets tag includes any external media sources that may be used in the document.

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.

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>