If you deal with the internals of fonts on a regular basis, you’ll find yourself often firing up a font editor to check some aspect of what’s inside a font. Just van Rossum’s FontGoggles helps a lot with that, but sometimes you just need a tiny bit of information right now:

  • What’s the family name of this font?
  • What version do I have?
  • What codepoints does it cover?
  • How many glyphs does it have?
  • What OpenType layout features does it contain?
  • What’s the glyph name for a certain Unicode codepoint?

If you’ve ever asked those questions, get yourself a copy of interrofont.

You can install it from pypi with pip:

pip install interrofont

And it does all this:

usage: interrofont [-h] [-n] [-v] [-c] [-g] [-m] [-M] [--codepoints]
                   [--coverage] [-l] [--glyph-for CHAR_OR_CODEPOINT] [--all]
                   FILE

positional arguments:
  FILE                  font file to process

optional arguments:
  -h, --help            show this help message and exit
  -n, --name            show font family name
  -v, --version         show font version
  -c, --count           show glyph count
  -g, --glyphset        show glyph names
  -m, --marks           show marks and bases
  -M, --metrics         show glyph metrics
  --codepoints          show glyph codepoints
  --coverage            show Unicode coverage ranges
  -l, --layout          show OpenType layout information
  --glyph-for CHAR_OR_CODEPOINT
                        show glyph name for given character or codepoint
  --all                 show everything

For example:

$ interrofont -nvgcmM --coverage --codepoints Hind-Regular.otf
Name: Hind
Version: Version 2.000;PS 1.0;hotconv 1.0.79;makeotf.lib2.5.61930
Glyph count: 1004
Codepoint coverage:
U+0000 U+000D U+0020-U+007E U+00A0-U+0107 U+010C-U+0113 U+0116-U+011B U+011E-U+011F U+0122-U+0123 U+012A-U+012B U+012E-U+0131 U+0136-U+0137 U+0139-U+013E U+0141-U+0148 U+014C-U+014D U+0150-U+015B U+015E-U+0165 U+016A-U+016B U+016E-U+0173 U+0178-U+017E U+0192 U+0218-U+021B U+02BC U+02C6-U+02C7 U+02C9 U+02D8-U+02DD U+03C0 U+0901-U+0903 U+0905-U+090D U+090F-U+0911 U+0913-U+0928 U+092A-U+0933 U+0935-U+0939 U+093C-U+0945 U+0947-U+0949 U+094B-U+094D U+0950 U+0958-U+095E U+0960-U+0970 U+0972 U+200B-U+200D U+2013-U+2014 U+2018-U+201A U+201C-U+201E U+2020-U+2022 U+2026 U+2030 U+2039-U+203A U+2044 U+20A8 U+20AC U+20B9-U+20BA U+20BD U+2113 U+2122 U+2126 U+212E U+2202 U+2206 U+220F U+2211-U+2212 U+2215 U+2219-U+221A U+221E U+222B U+2248 U+2260 U+2264-U+2265 U+25CA U+25CC U+FB01-U+FB02
Glyphs:
     .notdef    advance=751 lsb=176
        NULL    U+0000 advance=0 lsb=0
          CR    U+000D advance=0 lsb=0
       space    U+0020 advance=244 lsb=0
         dvA    U+0905 advance=659 lsb=30
        dvAA    U+0906 advance=924 lsb=30
         dvI    U+0907 advance=481 lsb=-22

$ interrofont --glyph-for 'ग' Hind-Regular.otf
U+0917 -> dvGA

$ interrofont -l Hind-Regular.otf
GSUB table: 50 lookups
DFLT/dflt:
    abvs: 14, 15, 16
    akhn: 3, 4
    blwf: 7
    blws: 17
    half: 9, 10
    haln: 19
    liga: 20
    nukt: 2
    pres: 12, 13
    psts: 18
    rkrf: 6
    rphf: 5