[pdftex] ttf2afm bug

Лидовский Владимир litwr at yandex.ru
Thu Jun 19 14:35:05 CEST 2008


to The Thanh Han hanthethanh at gmail.com
Tue Jun 17 09:30:05 CEST 2008

>>   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

>> 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, ...).

>any argument to support that gs is correct here please? eg
>why "cdot" is wrong and "cdotaccent" is right, and not vice

Ok, try the command

gs -sDEVICE=x11

then enter the next Postscript commands sequence

/Cyberbas findfont 40 scalefont setfont 70 70 moveto /cdot glyphshow 

What can you see? You can see empty box instead of dotted c! Try the next command

/cdotaccent glyphshow

And you can see real dotted c! Maybe this error is caused by gs... However gs provides capability to 
selftests (it can show glyph by name) and ttf2afm doesn't.

>> 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..

>ttf2afm can output enc files, and it already exists for more than 10 years.

If somebody wants to use a ttf-font with pdftex then he should use 8-bit enconding fitted in the TeX standards (T1, T2A, T5, ...). It is possible to produce real enc-file for pdftex.map from the mentioned raw vector but it will require some efforts. The AFMtoENC can make these efforts automatically and add *intellectual* glyph substitutions.

  AFMtoENC t2a Cyberbas.ttf

  ttf2afm -c Cyberbas.ttf

and see difference. I can't find a way to produce a proper vector automatically for t2a-encoding with 
ttf2afm. :-(

with kind regards
  Vladimir Lidovski

More information about the pdftex mailing list