loading custom fonts from my host that affects whole superset #38480
Replies: 2 comments
-
|
To load custom fonts locally in Superset 6.0.0, you'll need to mount your font files and inject them via CSS. Here's how: 1. Mount your fonts directory in volumes:
- ./fonts:/app/superset/static/assets/fonts
- ./custom-fonts.css:/app/superset/static/assets/custom-fonts.css
- ./spa.html:/app/superset/templates/superset/spa.html
- ./superset_config.py:/app/pythonpath/superset_config.py2. Create @font-face {
font-family: 'MyCustomFont';
src: url('/static/assets/fonts/MyFont-Regular.woff2') format('woff2');
font-weight: 400;
font-style: normal;
}Include weights 200, 400, 500, 600 for full UI coverage. 3. Create {% extends "superset/spa_base.html" %}
{% block head_extra %}
{{ super() }}
<link rel="stylesheet" href="/static/assets/custom-fonts.css">
{% endblock %}4. Configure the theme in THEME = {
"token": {
"fontFamily": "MyCustomFont, -apple-system, BlinkMacSystemFont, sans-serif"
}
}The key is that the Note: Superset 6.0.0 has a known issue where the default Inter font fails to load, so using custom local fonts actually bypasses this problem. To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
-
|
Moving this to a discussion |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
hi i have installed superset 6.0.0 by cloning from github and then create image from that now i want to load custom fonts that it is on my host not by url on the internet. so how can i do that?
Beta Was this translation helpful? Give feedback.
All reactions