Fonts

From Miraheze Developers Wiki

Fonts can be used to enhance the styling of your wiki.

Self-host your font

You can self-host your fonts for faster loading times. Go to Special:ManageWiki/settings on your wiki and go to Media, then scroll down to File Extensions and add woff and woff2. Save your changes.

Download a font from a trusted source (make sure it is woff or woff2; otherwise you can use a free font convertor to convert into woff or woff2). Upload fonts into your wiki and add the uploaded fonts to sitewide CSS using @font-face.

Fonts sourced from other websites

Google Fonts

Google Fonts is a free resource containing over 1,600 fonts. To add a font to your wiki, simply add:

@import url('https://fonts.googleapis.com/css2?family=<your font>ital,wght@0,200;0,300;0,400;0,600;0,700;0,900;1,200;1,300;1,400;1,600;1,700;1,900 <specify the font weight and styling>&display=swap');

to the top of the CSS page (eg. MediaWiki:Common.css).

onlinewebfonts.com

onlinewebfonts.com is a much larger resource for fonts, containing over eight million fonts. To add a font to your wiki, simply add:

@font-face {font-family: <your font>; <Optional: specify font-weight (100 to 900) and style (normal or italic)> src: url("//db.onlinewebfonts.com/t/0123456789abcdef0123456789abcdef.eot"); src: url("//db.onlinewebfonts.com/t/0123456789abcdef0123456789abcdef.eot?#iefix") format("embedded-opentype"), url("//db.onlinewebfonts.com/t/0123456789abcdef0123456789abcdef.woff2") format("woff2"), url("//db.onlinewebfonts.com/t/0123456789abcdef0123456789abcdef.woff") format("woff"), url("//db.onlinewebfonts.com/t/0123456789abcdef0123456789abcdef.ttf") format("truetype"), url("//db.onlinewebfonts.com/t/0123456789abcdef0123456789abcdef.svg#<your font>") format("svg"); }

replacing the placeholder text, to the top of the CSS page (eg. MediaWiki:Common.css).