Skip to content

Instantly share code, notes, and snippets.

@drjecker
Created May 16, 2015 09:41
Show Gist options
  • Save drjecker/13127ba46c53d7c73192 to your computer and use it in GitHub Desktop.
Save drjecker/13127ba46c53d7c73192 to your computer and use it in GitHub Desktop.
WordCamp 2015 Font-Face
/* Create a new directory in your theme called it fonts, and add your custom fonts into this directory.
eg: /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([[font:theme|fontname.eot]]);
src: url([[font:theme|fontname.eot]]) format('embedded-opentype'),
url([[font:theme|fontname.woff]]) format('woff'),
url([[font:theme|fontname.ttf]]) format('truetype'),
url([[font:theme|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: */
h1 { font-family: FontName;}
/* adapted from: https://docs.moodle.org/28/en/How_to_add_custom_fonts_in_a_theme */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment