[pdftex] ttf2afm bug

Лидовский Владимир litwr at yandex.ru
Mon Jun 16 07:01:01 CEST 2008


Hello

I've performed some experiments with free True Type Unicode Cyberbas font from

  http://www.wazu.jp/gallery/Fonts_CyrS.html

I've found that ttf2afm can find glyph names missed in the font and can omit glyph names presented in the font. For example, 

  ttf2afm Cyberbas.ttf

produces 1249 glyph names in the afm-file. The next sh/ps script also produces 1249 glyph names. However the sets of glyph names are not identical. 

  echo Cyberbas \(Cyberbas.ttf\)\; >Fontmap        #if this font doesn't registered for gs
  echo 'Cyberbas findfont /str 70 string def /CharStrings get
  {pop str cvs print (\n) print} forall quit' >showglyphnames.ps 
  gs -q showglyphnames.ps

Further tests show that the set produced by gs is correct one. For example, ttf2afm shows glyph names `cdot', `Cdot', `macron', 'mu', ... (total 15 names) which are missed in the font and omits glyph names `cdotaccent', `Cdotaccent', `increment', `mu1' (total 15) which are presented. It is impossible to see missed glyphs by command 

  /Cyberbas findfont 40 scalefont setfont 70 70 moveto GLYPHNAME glyphshow

for gs. The similar differencies were gotten for all other tested TT-fonts (Lucida, CharisSIL, ...).

BTW Why doesn't ttf2afm use call for gs?

There is also a suggestion about a feature. IMHO the program `ttf2enc' (or even `font2enc') will be useful for the TeX-world, e.g., 

  ttf2enc t2a Cyberbas.ttf

should produce Cyberbas.enc to use in the map-file with `Cyberbas.ttf' for pdftex... I've written 
`afmtoenc' utility for the mentioned purpose -- its raw variant is at

  http://litwr.boom.ru/tex.html

It is a bit odd that such kind of a program didn't appear 10-15 years ago.

with kind regard
  Vladimir Lidovski


More information about the pdftex mailing list