Skip to content

FontFace

FontFace element is a select element with available fonts:

example
<select name="fontFace">
    <option value="Archivo">Archivo</option>
    <option value="Fira Sans">Fira Sans</option>
    <option value="Inter">Inter</option>
    ...
</select>
The entire list of available fonts is in the 'Build-in Validators' section.

font-face

Build-in Validators

The element validates if the selected font is from the list:

  1. Archivo
  2. Fira Sans
  3. Inter
  4. Josefin Sans
  5. Jost
  6. Lato
  7. Montserrat
  8. Noto Sans
  9. Open Sans
  10. Oswald
  11. Poppins
  12. PT Sans
  13. Quicksand
  14. Raleway
  15. Roboto
  16. Source Sans Pro
  17. Ubuntu
  18. Work Sans
  19. Abril Fatface
  20. Cardo
  21. Crimson Text
  22. Libre Baskerville
  23. Lora
  24. Merriweather
  25. Playfair Display
  26. Roboto Slab
  27. Roboto Serif
  28. Sanchez
  29. Roboto Mono
  30. Space Mono

Available Validators

Element does not have available validators.

Relations Support

Element does not support relations between elements.

Configuration output schema

schema
{
  "<element_type>" : "fontFace",
  "<element_name>" : string,
  "<element_label>" : string,
  "<element_labelDescription>" : string,
  "<element_isRequired>" : bool,
  "<element_isHidden>" : bool,
  "<element_defaultValue>" : string
}
example
{
  "type" : "fontFace",
  "name" : "titleFontFace",
  "label" : "Select font",
  "labelDescription" : "Changes font of the text",
  "isRequired" : false,
  "isHidden" : false,
  "defaultValue" : "Archivo"
}

Element value

If value is filled: string. Value corresponds to one of the font names from the list in the Build-in Validators section.

usage in module TWIG
<p style="font-family:'{{ moduleConfig.titleFontFace }}';">Some text here</p>
html output
<p style="font-family:'Archivo';">Some text here</p>

Example of module

Twig

Twig
<h2 style="font-family:'{{ moduleConfig.titleFontFace }}';">{{ translate("Heading") }}</h2>

JSON configuration

JSON configuration
[
  {
    "label": "Typography",
    "state": "unfolded",
    "elements": [
      {
        "type": "fontFace",
        "name": "titleFontFace",
        "label": "Select font",
        "labelDescription": "Changes font of the text",
        "defaultValue": "Archivo"
      }
    ]
  }
]

JSON translations

JSON translations
{
  "module": {
    "pl_PL": {
      "Heading": "Nagłówek"
    },
    "en_US": {
      "Heading": "Heading"
    }
  },
  "schema": {
    "pl_PL": {
      "Typography": "Typografia",
      "Select font": "Wybierz czcionkę",
      "Changes font of the text": "Zmienia czcionkę tekstu"
    },
    "en_US": {
      "Typography": "Typography",
      "Select font": "Select font",
      "Changes font of the text": "Changes font of the text"
    }
  }
}