[pdftex] pdftex - Encoding for metafont PK fonts

Pali Rohár pali.rohar at gmail.com
Sun Jun 26 13:35:22 CEST 2016

On Sunday 26 June 2016 07:54:19 Reinhard Kotucha wrote:
> On 2016-06-25 at 22:56:48 +0000, Ross Moore wrote:
>  > But it is pity that it is not possible to specify that enc file
>  > also for PK fonts generated by MetaFont. Or it is somehow
>  > possible?
>  > 
>  > I see no reason why not, but could easily be wrong.
>  > But I must admit that I’ve not tried it with a PK font.
> Dear Ross,
> I assume that the main problem is that Metafont is using numerical
> glyph indices but in order to re-encode a font, it's required that
> each glyph has a name.

Yes! And that glyph name for each numberical value (index) is available 
in encode file (csr.enc). This is reason why I'm tryint to tell pdftex:

"hey pdftex, please use csr.enc for my csb12 PK font, it contains 
mapping index --> glyph name which you need to building cmap file"

> In order to use PK fonts with dvips or pdftex, they have to be
> converted to Type 3 at least.

IIRC pdftex internally convert all PK fonts to Type 3 when building PDF 
document. As PDF format does not support PK fonts. And Type 3 fonts are 
allowed to use full PostScript language (which support bitmaps). So PK 
fonts are just "inserted" into PS as bitmaps and included as Type 3 

> Converting them to Type 1 is
> preferred, of course.  In Metafont glyphs have numerical indices,
> try
>    tftopl $(kpsewhich csr10.tfm) | less
> I suppose that by default the encoding of Knuth's Computer Modern
> fonts is used.  I don't know whether it's sufficient to define glyphs
> in ISO-8859-2 order in Metafont.
> In order to apply an encoding vector and use the facilities provided
> by dvips and pdftex, it's necessary to replace numeric glyph indices
> with names.  If the initial encoding is arbitrary, manual work cannot
> be avoided.

File csr.enc contains vector of glyph names. So for each character 
number from metric csr10.tfm there is glyph name. So no manual work 
should be needed. All information is available.

Or I'm missing something?

> The best solution is to convert fonts created by Metafont to Type 1,
> one way or another.

This conversion cannot be done without manual work and sometimes can be 
hard... Anyway, I'm not interested in conversion, I just want to use 
existing PK (MetaFont) font :-)

Pali Rohár
pali.rohar at gmail.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://tug.org/pipermail/pdftex/attachments/20160626/9407d540/attachment-0001.bin>

More information about the pdftex mailing list