A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.
Read the statement by Michael Teeuw here.
change font of modules (local fonts)
-
So, I’ve downloaded https://www.fontsquirrel.com/fonts/comic-relief and added a font to
/home/pi/MagicMirror/fonts
And my custom css looks like this
body { @font-face { font-family: "SF"; font-style: normal; font-weight: 100; src: local("ComicRelief"), url("fonts/ComicRelief.ttf") format("truetype"); } }
Despite that, font is not seen. What could be the reason?
-
@epi don’t wrap the
@font-face
css rule within thebody
CSS rule. CSS spec says this should work but I’ve found the in most cases browsers just ignore it. -
Still doesn’t work
/***************************************************** * Magic Mirror * * Custom CSS * * * * By Michael Teeuw http://michaelteeuw.nl * * MIT Licensed. * * * * Add any custom CSS below. * * Changes to this files will be ignored by GIT. * *****************************************************/ body { } @font-face { font-family: "SF"; font-style: normal; font-weight: 100; src: local("ComicRelief"), url("fonts/ComicRelief.ttf") format("truetype"); }
-
@epi Now you need to apply your font to various elements of the layout. All you’ve done to this point is declare the availability of the font. Try something like this:
body * { font-family: "SF"; }
That might get the job done, but there may be more specific rules you need to write to override in other cases. Try this and see how far it gets you.
-
thank you!