title: How to get glyph widths by parsing a TTF font file?
body: <p>For capturing the glyph widths of a <code>TrueType</code> font, I convert the corresponding <code>TTF</code> file by <code>fontforge</code> into <code>AFM</code>, which is in text format (not binary). Then, parsing the text file to capture the glyph widths.</p>
  
  <p>There should be easier way to directly parse the binary <code>TTF</code> file to capture the glyph widths.</p>
  
  <p>I appreciate a strategy for shell script or C, but any programming language is OK, as the idea is the key, and codes can be adapted.</p>