Add additional fonts (v. 2.9x) (v. 2.9x)
Please note that not all fonts are available on all operating systems! We strongly recommend only adding web safe fonts that are available in most computers by default, or Google Fonts.
Template Fonts
There are a few default font styles available in Fonts & Colors by default. These consist of standard default OS fonts, like Arial/Helvetica, Century Gothic, Georgia, Times New Roman, etc. and Google Fonts, like Arvo, Droid Sans, Open Sans and Oswald. If you'd like to add additional fonts to the list, use the instructions below:
-
Determine what type the font is: serif ('y'), sans-serif ('n'), cursive ('c') or monospace('m').
-
Open the stconfig.php file in the main public directory.
-
Around line 316, find the code:
$font_face_list = array(
The available fonts are listed underneath.
-
Add your font to the list, using the following format:
Standard OS Fonts:
'Font Name (may be a list)'=>array('link=>'', 'serif'=>'font type'),where 'font type' is the character that represents the font type (see #1)
e.g.) To add Cambria (which is a serif font), add:
'Cambria'=>array('link'=>'', 'serif'=>'y'),this font won't display on most Macs though, as it isn't a default font in that OS.
Google Fonts:
'Font Name'=>array('link'=>'Font+Name:400,700', 'serif'=>'font type'),where 'Font+Name:400,700' is the code from Google, and 'font type' is the character that represents the font type (see #1)
e.g.) To add Raleway (which is a sans-serif font) in normal, bold and italic, add:
'Raleway'=>array('link'=>'Raleway:400,700,700italic,400italic', 'serif'=>'n'),
Notes:
-
Add the font anywhere in that list; the fonts will display in the same order.
-
Make sure that each font is on its own line.
-
The very last font should not have a comma at the end, but all of the rest should.
TinyMCE Fonts
Note that Google Fonts are not available in TinyMCE, because these fonts require a URL import. You can use standard OS fonts, but remember that not all fonts are available on all computers.
-
Open the htmlarea.php file in the /includes/ folder of the /storeadmin/ folder.
-
Add the following code:
font_formats : 'Andale Mono=andale mono,times;'+ 'Arial=arial,helvetica,sans-serif;'+ 'Arial Black=arial black,avant garde;'+ 'Book Antiqua=book antiqua,palatino;'+ 'Comic Sans MS=comic sans ms,sans-serif;'+ 'Courier New=courier new,courier;'+ 'Georgia=georgia,palatino;'+ 'Helvetica=helvetica;'+ 'Impact=impact,chicago;'+ 'Symbol=symbol;'+ 'Tahoma=tahoma,arial,helvetica,sans-serif;'+ 'Terminal=terminal,monaco;'+ 'Times New Roman=times new roman,times;'+ 'Trebuchet MS=trebuchet ms,geneva;'+ 'Verdana=verdana,geneva;'+ 'Webdings=webdings;'+ 'Wingdings=wingdings,zapf dingbats',
above the line:
convert_urls : false,
-
In that list, add any fonts you'd like, in the format:
'Font Name=fontfamily;'+
The last entry should not have a + after it.
- e.g.) to add Cambria, change that line to:
font_formats : 'Andale Mono=andale mono,times;'+ 'Arial=arial,helvetica,sans-serif;'+ 'Arial Black=arial black,avant garde;'+ 'Book Antiqua=book antiqua,palatino;'+ 'Cambria=cambria;'+ 'Comic Sans MS=comic sans ms,sans-serif;'+ 'Courier New=courier new,courier;'+ 'Georgia=georgia,palatino;'+ 'Helvetica=helvetica;'+ 'Impact=impact,chicago;'+ 'Symbol=symbol;'+ 'Tahoma=tahoma,arial,helvetica,sans-serif;'+ 'Terminal=terminal,monaco;'+ 'Times New Roman=times new roman,times;'+ 'Trebuchet MS=trebuchet ms,geneva;'+ 'Verdana=verdana,geneva;'+ 'Webdings=webdings;'+ 'Wingdings=wingdings,zapf dingbats',
-
See the TinyMCE Advanced Fonts entry for additional assistance.