Reference
Fonts
Use a font file you host in the embed and its charts, with a system backup.
Host your brand font and list it in general.fonts. Then name the same family in general.fontFamily.
general.fonts requires the plugin release listed in Changelog and versioning.
<dbn-dashboard
token="GUEST_TOKEN"
dashboard-id="DASHBOARD_ID"
admin-theme-options='{
"general": {
"fontFamily": "Brand Sans",
"fonts": [
{ "family": "Brand Sans", "src": "https://cdn.example.com/fonts/brand-sans.woff2", "weight": "100 900" }
]
}
}'
></dbn-dashboard>Up to 8 entries in general.fonts. An entry that breaks a rule is left out, with one console warning.
| Key | Required | Value |
|---|---|---|
family | yes | The name you use in general.fontFamily or chart.fontFamily. Letters, digits, spaces and hyphens. |
src | yes | An https: address of a .woff2 or .woff file. |
weight | no | 400, 500, 600, 700, or a range such as 100 900 for a variable font. Not set means 400. |
style | no | normal or italic. |
Every font the theme names gets a system backup: "Brand Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif. If your file does not load, the embed and its charts use the system font of the viewer, never a serif.
- Your page’s Content Security Policy must allow the file. Add the font’s host to
font-src, for examplefont-src https://cdn.example.com. Else the browser blocks the file and the embed uses the backup. All CSP rules for the embed. - Your font host must allow the page origin. For a cross-origin file, configure CORS on its response for the origin that serves the embed. If the embed runs in an iframe, use the origin of the page inside that iframe.
- The embed loads each file once per page, however many embeds the page has. A family in
general.fontsis never loaded from Google Fonts. - Charts wait up to 1.5 seconds for the font before they draw. If the font comes later, the chart draws once more.
- With no
chart.fontFamily, charts use the font ofgeneral.fontFamilywhen it is one of your files.
Next, match your brand, or see every field on Theme fields.