May 28 2009 • 5:34 AM

Make a Font “Contact Sheet” in InDesign

What characters are hiding inside that font you’re using? There are likely some glyphs you don’t know about — hidden fractions, or ornaments, or odd ligatures. Wouldn’t it be cool to get a specimen or contact sheet?

Eric Menninga (one of the lead engineers on the InDesign team) came up with a clever script to do just that. The script writes a temporary tagged text file to disk with the desired characters in it, then places that file into a new InDesign document. You can choose the font and the beginning/ending glyph id numbers.

Unfortunately, when Eric sent it to me, there was no user interface. He was comfortable just editing the script each time he wanted to use a different font, but it troubled my delicate sensibilities. So: Chuck Weger — scripter and workflow consultant extraordinaire — came to the rescue, editing the script and giving it a little UI.

Choose the font, choose the range of glyphs you want (many fonts only go up to 300 or so, but some OpenType Pro fonts have thousands!) and click OK. The result show up in seconds:

If you need to know a Unicode or Glyph ID (GID) number for a character, just open the Glyphs panel (Type > Glyphs) and select the character in the text frame. The same character gets highlighted in the Glyphs panel. Hover the cursor over it and you’ll get details on it. Alternately, you can load it into the Glyphs tab of the Find/Change dialog box.

The script should work in CS3 and CS4. We think. You can download the script here.

Thank you to Eric and Chuck!

Making a Font Specimen Book

If you were looking to make a font catalog — to show a sample of every font in your library, for example — the above script will not help you. Instead, if you’re on the Mac, you want to take a look at Chris Paveglio’s InDesign Font Catalog applescript. There are likely other good font catalog tools out there, but I haven’t seen them. Suggestions from the audience?

9 Responses discussing this post. Add yours below.

  1. Phyllis
    May 28th, 2009 • 6:16 am • Link

    Now I can see all those flourish-y characters in Bickham Script. I love it. :-)

    Thanks, Phyllis

  2. Brad
    May 28th, 2009 • 7:27 am • Link

    Useful! Is there a way to know how many glyphs a font carries so you can accurately enter the ending glyph ID? Typing in a glyph ID number that is higher than the highest glyph in the font results in lots of the X’d red boxes.

  3. James
    May 28th, 2009 • 11:11 am • Link

    Adobe has one for free:
    I modified it a few years ago to do a custom font sample book for our customer.

  4. David Blatner
    May 28th, 2009 • 11:17 am • Link

    @James: for some reason that URL didn’t work, so I took it out. You’re right: The Exchange has several different font book type scripts for InDesign. I haven’t tried them yet, but they include:
    Font View/Tester
    Font book
    ID Font Catalog

  5. May 28th, 2009 • 1:55 pm • Link

    Brad: Great question. I know of a manual way:

    1. Open Type > Glyphs panel
    2. Choose the font in question from the bottom of the Glyph panel
    3. Choose Sort Glyphs > By CID/GID from the Glyphs panel menu
    4. Scroll to bottom of Glyphs panel
    5. Select final glyph and look at GID number in its tool tip. That’s the total (highest) GID in the font, I believe.

    I tried it with Adobe Caslon Pro Regular and the final GID was 800; when I switched to Century Gothic Regular, the final one was 244.

  6. Robert
    June 6th, 2009 • 8:09 am • Link

    The Font book InDesign script works well…

  7. Jongware
    July 20th, 2009 • 4:41 pm • Link

    If you restrict yourself to OpenType and TrueType fonts (which is rather logical, as these are the ones with interesting glyphs), you can read the number of glyphs if you know the file format.

    … Hey … but I know the file format! So I whipped up this script. It’s a stand-alone, I leave it to the writer of the original to integrate it.

    myFile = File(app.selection[0].appliedFont.location);
    myFile.open(“r”);
    myFile.encoding = “binary”; // Important!

    // Read TTF/OTF header
    hdr = getUlong(myFile);
    if (hdr != 65536 // Microsoft Truetype
    && hdr != 1330926671) // Adobe OTF ‘OTTO’
    {
    myFile.close();
    alert (“Not a font type I can read…”);
    exit(0);
    }
    numTable = getUshort (myFile);

    /* Already read:
    ul version
    us numTable
    Skip over
    us searchRange
    us entrySelector
    us rangeShift
    to get to start of tables:
    */
    myFile.seek (12);

    /* Find ‘maxp’ — maximum profile */
    /* Each table entry is
    ul tag
    ul checksum
    ul offset
    ul length
    */
    for (var t=0; t<numTable; t++)
    {
    tableEntry = myFile.read(16);
    if (tableEntry.substr(0,4) == ‘maxp’) break;
    }
    if (tableEntry.substr(0,4) != ‘maxp’)
    {
    myFile.close();
    alert (“No ‘maxp’ entry found–yuck”);
    exit(0);
    }

    offset = (((((tableEntry.charCodeAt(8 ) << 8 ) +
    tableEntry.charCodeAt(9)) << 8 ) +
    tableEntry.charCodeAt(10)) << 8 ) +
    tableEntry.charCodeAt(11);

    myFile.seek (offset);

    // Should be 0001.0000 but is sometimes different…
    // Let’s ignore that, shall we.
    version = getUlong (myFile);
    NumberOfGlyphs = getUshort (myFile);
    alert (“NumberOfGlyphs is “+NumberOfGlyphs);

    myFile.close();

    function getUshort (aFile)
    {
    var result = aFile.read(2);
    return (result.charCodeAt(0)<<8 ) +
    result.charCodeAt(1);
    }

    function getUlong (aFile)
    {
    var result = aFile.read(4);
    return ((((result.charCodeAt(0)<<8 ) +
    result.charCodeAt(1))<<8 ) +
    result.charCodeAt(2)<<8 ) +
    result.charCodeAt(3);
    }

  8. Mick Scott
    October 7th, 2009 • 3:01 am • Link

    I publish a magazine and I often find I have to match fonts in an ad that’s sent to me. I’m looking for a way to sort all my fonts in ID3 so that I have all the Serif fonts together, all the San Serif together, handwriting fonts etc. This would make it much quicker to identify unknown fonts. Is there a script that could do this?

  9. David Blatner
    October 7th, 2009 • 5:22 am • Link

    @Mick: No, but that’s what font management utilities are for, such as Insider’s FontAgent Pro, Extensis Suitcase, or Linotype Font Explorer.

    There are also font identifier sites out there, such as WhatTheFont and Identifont.

Subscribe to the Discussion

Get the ongoing discussion surrounding "Make a Font “Contact Sheet” in InDesign" delivered to you. Click here to subscribe via RSS.

Leave a Reply

You can use limited HTML tags, such as <em></em> for emphasis/italics and <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> .

InDesignSecrets reserves the right to edit and/or remove posts and comments.