The Complete PDF Catalogue of Google fonts is now updated to 17 May, 2017!

Over 160 pages of offline Google Font goodness in a single PDF catalog!

Google fonts are useful, because they can be embedded in websites, and are free to use.

What makes them less useful is that it is hard to browse through them to see what’s on offer.

So I downloaded all the fonts in a single zip package which I found on Github.com. Thanks to the folks who did that part of the job.

Then I prepared an InDesign file with 1000 lines of “The quick brown fox…”, and I wrote a script to apply a different Google font to each line.

The tricky part was to apply Google fonts only. Now, there’s no simple way that I can see of knowing whether a particular font is a Google font – certainly not via ExtendScript. I have 1000+ other fonts installed on my machine, and obviously this catalogue is meant to be Google fonts only. Also, I didn’t want to delete all the other fonts installed currently on my machine, and I don’t use a font manager.

The answer I came up with was to put all the fonts in a folder called GoogleFonts, and put that folder in InDesign’s font folder (C:\Program Files (x86)\Common Files\Adobe\Fonts on my machine).

Now, in the InDesign scripting DOM, each font has a Location object, which is the path to the font. At this stage it became a simple matter of checking the origins of each font, and using it only if it originated in the GoogleFonts folder.

Here’s the script for those who are interested:

t = app.selection[0].parentStory;
ps = t.paragraphs;
f = app.fonts;
c = 0;
for (i = 0; i < f.length-1; i++){
    aFont = f[i];
    myLoc = aFont.location.toString();
    if (myLoc.indexOf("C:\\Program Files (x86)\\Common Files\\Adobe\\Fonts\\GoogleFonts") < 0) continue;
    $.writeln(i);
    fn = aFont.fullName;
    p = ps[c];
    p.appliedFont = aFont;
    p.insertionPoints[0].contents = fn;
    c++;
}

(This was meant for a one-off, local, personal use, so I didn’t bother with anonymous functions, local variables etc.)

The result was satisfactory: An InDesign document with a complete list of Google fonts.

May 2017 update: I updated the above procedure, and now everything is much more automated! The idea is to update the catalog as needed, more frequently.

If you need the Complete PDF Catalog of Google Fonts designed differently, arranged in different groups, or including different information, please feel free to contact us.