-
Download the ttf font from here: https://www.dafont.com/djb-get-digital.font
-
Convert it to a woff2 font here: online converter
-
Put the created djbgetdigital.woff2 file in
config/www
NOTE: the file-name needs to be all lowercase. -
Create the following two files in
config/www
fonts.css
@font-face {
font-family: "DJBGetDigital";
src: url(/local/djbgetdigital.woff2) format('woff2');
}
loadfonts.js
function loadcss() {
let css = '/local/fonts.css?v=0.005'
let link = document.createElement('link');
let head = document.getElementsByTagName('head')[0];
let tmp;
link.rel = 'stylesheet';
link.type = 'text/css';
tmp = link.cloneNode(true);
tmp.href = css;
head.appendChild(tmp);
console.info('%c Font Style sheet loaded', 'color: white; background: #000; font-weight: 700;');
}
loadcss();
- Add the following to Settings → Dashboards → ⋮ (top right of page) → Resources
URL: /local/loadfonts.js
ResourceType: JavaScript Module
- Reload your browser cache (Ctrl + F5) and use it like this (as an example):
- type: markdown
content: |
{{states("sensor.time")}}
card_mod:
style:
ha-card {
font-family: "DJBGetDigital";
}
Note: You will require card-mod to be installed to be able to use style:
Note 2: If you have just created the /www
folder you need to restart home assistant.