[pdftex] pdftex - Encoding for metafont PK fonts

Pali Rohár pali.rohar at gmail.com
Sun Jun 26 01:39:47 CEST 2016


On Sunday 26 June 2016 00:56:48 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.

Ok, take font csb12 (part of csfonts package) which has only metafont 
source code (and generated metric tfm file). No Type 1 PFB file. 
Encoding vector for csfons is stored in csr.enc file.

If I try this (\char232 is 'č')

  \nopagenumbers
  \pdfmapline{+csb12 <csr.enc}
  \font\csb=csb12
  \csb \char232
  \bye

then pdftex show me warning:

  pdfTeX warning: pdftex: invalid entry for `csb12': both ps_name and
  font file missing

and font csb12.600pk is included. But still if I select in PDF viewer 
that character I see 'è'. 

If I change mapline to "\pdfmapline{+csb12 csb12 <csr.enc}" then pdftex 
show me warning:

  pdfTeX warning: pdftex: No flags specified for non-embedded font
  `csb12' (csb12) (I'm using 34): fix your map entry.

  pdfTeX warning: pdftex: font `csb12' is not a standard font; I suppose
  it is available to your PDF viewer then

And now *no* font is included in PDF file, which is wrong.

If I change mapline to "\pdfmapline{+csb12 csb12 <csb12 <csr.enc}" then 
pdftex show me error:

  !pdfTeX error: pdftex (file csb12): cannot open Type 1 font file for 
  reading
   ==> Fatal error occurred, no output PDF file produced!

And no PDF file is generated.

So I have really no idea how to specify csr.enc file for bitmap PK font. 
It is somehow possible? If not, could it be possible to extend and patch 
pdftex to support it?

====

About cmap, I already created and using cmap files for PK fonts. For 
current selected font this simple tex code load "file.cmap":

  \pdfnobuiltintounicode\font%
  \immediate\pdfobj stream file {file.cmap}%
  \pdffontattr\font{/ToUnicode \the\pdflastobj\space 0 R}%

(I have macro around it, for easy use)

But I thought that creating cmap file by hand and manually inserting 
"/ToUnicode" into PDF file is a big hack and there could be some 
"normal" solution to let pdftex generate cmap file (like for PFB fonts).

As all needed information for generating cmap file are stored in 
"csr.enc" file (which is specified in mapline for PFB files) and then in 
glyphtounicode.tex.

-- 
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/a9e4059e/attachment.bin>


More information about the pdftex mailing list