MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.

    change font of modules (local fonts)

    Scheduled Pinned Locked Moved Solved Custom CSS
    22 Posts 9 Posters 20.6k Views 9 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J Offline
      j.e.f.f Project Sponsor Module Developer @epi
      last edited by

      @epi don’t wrap the@font-face css rule within the body CSS rule. CSS spec says this should work but I’ve found the in most cases browsers just ignore it.

      1 Reply Last reply Reply Quote -1
      • E Offline
        epi
        last edited by

        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");
        }
        
        J 1 Reply Last reply Reply Quote 0
        • J Offline
          j.e.f.f Project Sponsor Module Developer @epi
          last edited by

          @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.

          1 Reply Last reply Reply Quote 1
          • E Offline
            epi
            last edited by

            thank you!

            D 1 Reply Last reply Reply Quote 0
            • D Offline
              dangerousden @epi
              last edited by

              @epi

              Did you ever get this working? I’m having exactly the same issue. I have the holiday countdown module. We’re off to Disney, so I thought it would be fun to put it in a Disney font. I’ve downloaded one and put it into a fonts folder under MagicMirror.
              I have defined it with an @ statement, included the fonts/ source folder and file name, and added it to the countdown module, but it is still not changing the font for that module :(

              S 1 Reply Last reply Reply Quote 0
              • S Offline
                sdetweil @dangerousden
                last edited by

                @dangerousden look at the css/roboto.css, or the css/fontawesome.css

                and then main.css to see how they are used

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                1 Reply Last reply Reply Quote 0
                • 1
                • 2
                • 3
                • 3 / 3
                • First post
                  Last post
                Enjoying MagicMirror? Please consider a donation!
                MagicMirror created by Michael Teeuw.
                Forum managed by Sam, technical setup by Karsten.
                This forum is using NodeBB as its core | Contributors
                Contact | Privacy Policy