Note: You are currently viewing documentation for Moodle 3.7. Up-to-date documentation for the latest stable version of Moodle may be available here: How to add custom fonts in a theme.

How to add custom fonts in a theme

From MoodleDocs
Revision as of 15:39, 19 November 2013 by Mary Evans 2 (talk | contribs) (Created page with " Create a new directory in your theme and call it fonts. Then add all your custom fonts in this directory. eg: moodle/theme/yourtheme/fonts/ In your themes CS...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
   Create a new directory in your theme and call it fonts. Then add all your custom fonts in this directory.
   eg: moodle/theme/yourtheme/fonts/
   
   In your themes CSS file add the following:
   @font-face { /* where FontName and fontname represents the name of the font you want to add */
     font-family: 'FontName';
     src: url(fontname.eot);
     src: url(fontname.eot) format('embedded-opentype'),
          url(fontname.woff) format('woff'),
          url(fontname.ttf) format('truetype'),
          url(fontname.svg) format('svg');
     font-weight: normal;
     font-style: normal;
   }
   
   Next ADD the name of your font wherever you want that font to be used in your stylesheet.
   For example:
   #page-header h1 { font-family: FontName;}