Google Fonts are a tremendous addition to any designer’s arsenal, providing a basic library of typefaces that cover most requirements. But if you’ve ever tried to add them to a WordPress theme you’ll know what kind of hacking is involved.
Fortunately, web designer Eric Alli has recognized the issue and released a great plugin for WordPress that will allow anyone to utilize Google’s font library.
Google Typography is a free solution, and the best thing about it is that it’s incredibly simple to use. Once you’ve installed, just navigate to the Appearance > Typography settings page, click Add New to add a new type style and customize your text via the live preview. Once you’ve set up your font, all you have to do is enter the CSS selector to apply it to and click Save; that’s it, your font choice is now being used live on your site.
What’s more Alli has included a register_typography function to enable theme developers to quickly add Google fonts to themes. It makes adding a font as simple as this:
if(function_exists('register_typography')) {
register_typography(array(
'page_titles' => array(
'preview_text' => 'Page Titles',
'preview_color' => 'light',
'font_family' => 'Lato',
'font_variant' => '300',
'font_size' => '45px',
'font_color' => '#252525',
'css_selectors' => '.page_title'
)
}
}
There are obvious omissions: there are no line-height, or tracking settings for example, which are vital for body text and display text respectively; however, the plugin is only at version 1.0 and hopefully more will be added over time.
I’d encourage anyone to download the Google Typography plugin and give it a try, it’s a simple, intuitive way of adding Google fonts to WordPress sites; easy to use but fantastically flexible.
What I love about the web design community is that for everyone who rehashes someone else’s product to make a quick buck, there’s someone else who releases something really useful, free of charge. Eric Alli’s Google Typography is a case in point, and it makes the web just a little bit better.
Have you used Google Typography yet? What options do you wish were included? Let us know in the comments.