Wicked fonts

There are several ways you can work with fonts on Media Wiki. There is a default font set associated with the Wiki installation (to be found in the MediaWiki:Common.CSS page, see my earlier post on templates), which may be overwritten using a particular “skin” (I use Vector). Sometimes you just want to use a different font for a bit of text.

In-line font change using mark-up

The basic mark-up for this is this: Type <font face=”yourfont”> before the text of which you want to change the font and </font> after it. So if you want to write the word “flower” in Broadway font, you would write: <font face=”Broadway”>flower</font>

Fonts to use

Google has beautiful fonts! Have a look here to see some examples. Or here. It is not easy to find out which fonts are part of the MediaWiki core. But there is a procedure to make sure that Google fonts are available. It works as follows:

  1. Go to Google fonts
  2. Select the font(s) you want by clicking the “plus” (+) icon. . You should see a pop-up on your browser stating “n Families Selected,” with n being the number of fonts that you have selected.
  3. Click the tab for the pop-up notification, and then select “@IMPORT.” 
  4. Copy and paste the CSS there into [[MediaWiki:common.css]]

In-line font change using templates

There is a Template:Font which I have imported into my wiki. It allows me to change the font and do several other things at once. Its general syntax is: {{font|TEXT(or「text=TEXT」)|font=FONT|size=SIZE(px/em/pt/%)|color=COLOR|bgcolor=BACKGROUND COLOR|css=CSS}} . Example: {{font|text=Hello World!|font=Century Gothic|size=35px|color=#bf00bf}} . There are also other templates for adjusting the font size:

Leave a Reply