With the first release of PressWork (v0.9.1) we have included the top twenty most popular Google Fonts. As with most things on the web, the Google Font directory is constantly growing so we thought it would be best to figure out an easy way for people to add more fonts if they want.
The included Google Fonts are stored in an array called $pw_google_fonts
. That array can be found in /presswork/admin/inc/google-fonts.php. This is what the file looks like in v0.9.1:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
<?php /** * Add more Google Fonts by going to http://www.google.com/webfonts * We have included the top 20 most popular fonts to get you started * * @since PressWork 1.0 */ $pw_google_fonts = array( "Quattrocento", "Droid Sans", "Droid Serif", "Lobster", "PT Sans", "Yanone Kaffeesatz", "Arvo", "Ubuntu", "Open Sans", "Pacifico", "Calligraffitti", "Reenie Beanie", "Crafty Girls", "Tangerine", "Oswald", "Shadows Into Light", "Nobile", "Raleway", "Rock Salt", "Copse" ); |
As you can see, all we have done is included the name of the font. We have a function in place that will take the name and use it to correctly include the font on the front end of PressWork.
The above array is what feeds the drop down list that appears in the PressWork toolbox under the Fonts panel.
To add to this array, all you need to do is include another value. If you check out Google Fonts and find a font you want to use that we don’t have listed, say like Bowlby One SC, add it to the bottom of the array list:
$pw_google_fonts = array( "Quattrocento", "Droid Sans", "Droid Serif", "Lobster", "PT Sans", "Yanone Kaffeesatz", "Arvo", "Ubuntu", "Open Sans", "Pacifico", "Calligraffitti", "Reenie Beanie", "Crafty Girls", "Tangerine", "Oswald", "Shadows Into Light", "Nobile", "Raleway", "Rock Salt", "Copse", "Bowlby One SC" ); |
Now Bowlby One SC will be added to the drop down list so you can select it in the PressWork toolbox Fonts panel.
We are working on making this as easy as possible so this process might actually change in future releases.