Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fonts #17

Open
cm-mojo opened this issue Oct 16, 2024 · 6 comments
Open

Fonts #17

cm-mojo opened this issue Oct 16, 2024 · 6 comments

Comments

@cm-mojo
Copy link

cm-mojo commented Oct 16, 2024

Hi, can you explain how to format using the font store in the www/custom-lovelace folder? i have downloaded BITCBLKAD.ttf but can't get it used in the dashboard

@malcolmrigg
Copy link
Owner

Hi - the example in the readme shows you how to configure it, basically copy the font into your www/custom-lovelace folder then put something like this in the config for the card:

fontname: itcblkad_font
fontface: >-
font-family: itcblkad_font; src: local(itcblkad_font),
url('/local/custom-lovelace/ITCBLKAD.TTF') format('opentype');

("ITCBLKAD.TTF" is the font file I used - you may need to change the above config to match your "BITCBLKAD.ttf" file, and perhaps the name of the font in the font-family/fontname bits too).

Note that the "www" folder in your config folder maps to the URL "/local/" which is why the URL doesn't have the "www" in it.

@cm-mojo
Copy link
Author

cm-mojo commented Oct 16, 2024

this is the folder the ttf is in:

image

and this is the config:

fontname: bitcblkad_font
fontface: >-
font-family: bitcblkad_font; src: local(bitcblkad_font),
url('/local/custom-lovelace/BITCBLKAD.ttf') format('opentype');
width: 500

Still doesn't work....not sure what I'm doing wrong

@malcolmrigg
Copy link
Owner

Sorry, I'm really not an expert on web fonts, I figured it out by experimenting and looking at how other people did it. Maybe try experimenting with the format option - although opentype worked for me your particular version of the font looks like it could be truetype?

Also, maybe try incrementing the version number in the resources (as if you were updating to a new version of the code). You could also try adding the font file itself to the resources as a stylesheet. Not sure what else to suggest, maybe there's a webfont guru out there that'll be able to help...

@cm-mojo
Copy link
Author

cm-mojo commented Oct 16, 2024

no worries, thanks - just wanted to make sure I wasn't missing something obvious

@cm-mojo
Copy link
Author

cm-mojo commented Oct 16, 2024

can you upload the font you have used to see if I can mimic the behaviour?

@malcolmrigg
Copy link
Owner

malcolmrigg commented Oct 16, 2024

can you upload the font you have used to see if I can mimic the behaviour?

Sorry, I doubt it, it's not mine to distribute. I believe it was installed on my windows laptop though, so if you have a windows machine you might be able to find it there, or I'm sure a quick internet search will find you a copy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants