Introduction

The GoogleFontExtractor Gem will crawl the Google Webfonts directory on your command and return an array of Struct instances with details of fonts available in the Google Fonts directory.

PLEASE Note: this does NOT download the font files themselves, although it does return the download url if you wanted to automate obtaining the .ttf file for each font.

Let's get started.

1. In your Gemfile

gem "google_font_extractor"

2. Bundle Install

3. rails console example

ruby-1.9.2> fonts = GoogleFontExtractor.fonts
ruby-1.9.2> fonts.first
=> #<struct designer="Steve Matteson", name="Droid Serif", charsets=["latin"], weights_count="4", weights=["regular", "italic", "bold", "bolditalic"], families_count=nil, category="serif", download_url="http://www.google.com/webfonts/download?kit=JHlfjS1nNpVY2eojiON_TqCzlCNBPNJyfLyExqzYYTM">
ruby-1.9.2>

Additional notes

If you want to do anything real with this, you should save the results of the extract method to a YAML file or database table.