Re: pdftex - Encoding for metafont PK fonts

Pali Rohár <[email protected]>
Newsgroups gmane.comp.tex.pdftex
Message-ID <201606260139.47449@pali>
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
[email protected]
signature.asc (application/pgp-signature, 198 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iEYEABECAAYFAldvFkMACgkQi/DJPQPkQ1IkrACgxhgWZhhr+AgYPyKkTw5SoBhf
e2kAn3uhlyzkSgzy+qgvUN88woCML5YS
=GGwL
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.