[pdftex] ttf2afm bug

The Thanh Han hanthethanh at gmail.com
Fri Jun 20 08:55:03 CEST 2008


On Thu, Jun 19, 2008 at 04:35:05PM +0400, Лидовский Владимир wrote:
> >any argument to support that gs is correct here please? eg
> >why "cdot" is wrong and "cdotaccent" is right, and not vice
> >versa?
> 
> 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.

when I have a doubt in a ttf font, I trust the following tools:
- a text editor, eg vi
- a ttf dump tool, eg ttx (from fonttools) or ttfdump (by
  Microsoft)
- a font editor, eg fontlab or fontforge

all of them show that there is no cdotaccent in
Cyberbas.ttf. I don't know why gs calls cdot as cdotaccent,
and I am not interested in finding it out, since gs is not
my tool to verify a font. sorry.

> 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.
> 
> Try 
>   AFMtoENC t2a Cyberbas.ttf
> 
> then
>   ttf2afm -c Cyberbas.ttf
> 
> and see difference. I can't find a way to produce a proper vector automatically for t2a-encoding with 
> ttf2afm. :-(

it's as simple as:

,--------
| ttf2afm -e t2a.enc -o Cyberbas.afm Cyberbas.ttf
| afm2tfm Cyberbas
`--------

and add a line to pdftex.map:

,--------
| Cyberbas BitstreamCyberBase-Roman <Cyberbas.ttf <t2a.enc
`--------

btw, the above command afm2tfm will not generate kerning
data for Cyberbas.tfm. I use fontinst in similar cases, but
it's irrelevant here, since going from afm to tfm can be
done in many ways and is well-documented.

Regards,
Thanh


More information about the pdftex mailing list