[pdftex] Generating CJK in PDF

Otfried Cheong otfried at cs.uu.nl
Mon May 7 21:03:13 CEST 2001


Werner writes:
> > > No more running ttf2pt1 on TTF files!
> > 
> > if I remember correctly, then some work has 
> > been done on ttf2pfb so
> > it can create the corresponding *.enc files for use with
> > pdftex. Hans, Werner and Wang can tell more about that.

> I don't know such an extension.  Can you give more 
> details, please?

> BTW, ttf2pfb is no longer maintained.  
> ttf2pt1 is far better now.

As far as I'm concerned, both ttf2pfb and ttf2pt1 have just become obsolete :-)

I got this feature to work after seeing Hans' message, but it took some reading of pdftex sources to find out about the undocumented /index<n> syntax for *.enc files...

I've used 'ttf2tfm' to generate the .tfm files - I find it more convenient than going through AFM files. All you need is a TTF font and a subfont definition scheme (what ttf2tfm calls an .sfd file).  All the .sfd's I've ever needed come with ttf2tfm.

The .enc files contain the same information as the .sfd file, but using glyph indices instead of char codes.   I've just extended ttf2tfm so that together with the .tfm files it writes the .enc files.  I guess one could make it create the /ToUnicode cmap files and the .map file for pdftex as well.

By the way, Hans' example showed an encoding file named 'gbk-81.enc', which made it look as if the encoding file depends just on the charset of the TTF file.  I believe this isn't right, and 'gbk-81.enc' actually contains glyph indices in the TTF font.  This is a bit inconvenient (one needs lots of distinct .enc files), and seems to be asking for trouble:  what if a user replaces the TTF font by a newer version with the same name but different glyph indices?  Wouldn't it be more convenient to be able to work with char codes from the Unicode cmap table instead?

Otfried





More information about the pdftex mailing list