Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have some truetype fonts which support UTF-8 characters. I can use "fc-list" to find certain font. How can I check all available characters in some font? Such as how many characters supported in "AR PL New Sung ExtB".

share|improve this question
1  
In the newer fontconfig, there is a fc-query program which can list the Unicode ranges that the font covers. – Dan D. May 29 '12 at 11:53
up vote 1 down vote accepted

You could use a different commandline tool, ttfdump, assuming you're looking at a TTF font file. It should also work for OTF fonts, if they belong to the TTF variety:

ttfdump /path/to/your/file.ttf  \
   | grep -E '(Number of Glyphs:|numGlyphs:|numberOfHMetrics:)'

This should get you the number of glyphs. You'll possibly see up to four different numbers, if the TTF is in some way b0rken. Sane TTF will return identical numbers for all three entries, in which case you may be pretty confident that you got the correct number:

ttfdump /Library/Fonts/WeidemannStd-Book.otf  \
  | grep -E '(Number of Glyphs:|numGlyphs:|numberOfHMetrics:)'

    numberOfHMetrics:      253
    numGlyphs:             253

Another example:

ttfdump /Library/Fonts/DroidSerif-Regular.ttf \
   | grep -E '(Number of Glyphs:|numGlyphs:|numberOfHMetrics:)'

     numberOfHMetrics:     609
     numGlyphs:            609
     numGlyphs:            609
     Number of Glyphs:     609
share|improve this answer

Here is a new (command line) method to determine the number of glyphs contained in a (TTF or OTF) font which I became aware of recently.

Use the luaotfload-tool which ships with the luaotfload package for LaTeX.

Run, for example:

 luaotfload-tool --find="fira mono" -I | grep glyphs
    number of glyphs: 1485

If you skip the | grep glyphs part and replace it by | less, you'll get a lot more info about the font's metadata, which is also interesting in itself, like copyright + license info, font creator name and built-in font features.

The tool can also find an installed font for you, based on its name:

 luaotfload-tool --find="fira mono"
  luaotfload | resolve : Font "fira mono" found!
  luaotfload | resolve : Resolved file name "/Users/kp/Library/Fonts/FiraMono-Regular.otf"
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .