Read the statement by Michael Teeuw here.
change font of modules (local fonts)
-
@foryas you can also do. But you need to understand css. Study it.
-
-
@broberg said in change font of modules (local fonts):
.calendar
how i can find class (.calendar for your example) of any module to use that?
-
@foryas open the developer options in electron or check with F12 in your local browser to see the code.
But the main module class name are always the name of the module as put in the config file
.calendar for calendar
.alarm for alarm
.MMM-Instagram for MMM-Instagrametc etc
-
@broberg so thanks my friend solved.
-
hi all,
I tried to change my newsfeed font and i added below commands to custom.css but it didnt work. What should i do ?
Thanks
.newsfeed { font-family: Verdana; font-style: normal; font-weight: 100; src: local("Verdana"), url("/home/pi/MagicMirror/fonts/Verdana.ttf") format("truetype"); }
-
@bekirs
@font-face
is not a style rule, but declaration (“at-rule”). Here’s an explanation of how it works.So your code should instead be:
@font-face { font-family: Verdana; font-style: normal; font-weight: 100; src: local("Verdana"), url("/home/pi/MagicMirror/fonts/Verdana.ttf") format("truetype"); } .newsfeed { font-family: Verdana; }
This avoids using the local version of the Verdana font. Why not use the local Verdana font (or install your desired alternative) and use the below instead?
.newsfeed { font-family: Verdana; }
-
@ninjabreadman said in change font of modules (local fonts):
@font-face {
font-family: Verdana;
font-style: normal;
font-weight: 100;
src:
local(“Verdana”),
url(“/home/pi/MagicMirror/fonts/Verdana.ttf”) format(“truetype”);
}.newsfeed {
font-family: Verdana;
}I wrote below but it didnt work
@font-face {
font-family: Verdana;
font-style: normal;
font-weight: 100;
src:
local(“Verdana”),
url(“/home/pi/MagicMirror/fonts/Verdana.ttf”) format(“truetype”);
}.newsfeed {
font-family: Verdana;
} -
@bekirs My first question: Is Verdana actually located in
~/MagicMirror/fonts/Verdana.ttf
? If so, you might tryurl("file:///home/pi/MagicMirror/fonts/Verdana.ttf")
. When you runnpm start dev
in Terminal while in~/MagicMirror
, are there any console errors (in Terminal or Electron)? -
verdana is located in true folder. and after i run npm start dev i could not see any error thank you