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.
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.