Discussion:
[pdftex] [PATCH v3] pdftex - Add support for encfile and \pdfgentounicode for PK fonts
Pali Rohár
2016-07-06 12:26:20 UTC
Permalink
... continued thread "[pdftex] pdftex - Encoding for metafont PK fonts"

This patch allows to specify encoding file also for bitmap PK fonts
(generated by MetaFont) and add support for \pdfgentounicode primitive
for these fonts.

Example for csb12 (CSFonts, Latin 2 encoding):

\nopagenumbers
\pdfmapline{+csb12 <csr.enc}
\pdfglyphtounicode{ccaron}{010D}
\pdfgentounicode=1
\font\csb=csb12
\csb \char232
\bye

Char 232 (0xE8) in font csb12 is 'č' (LATIN SMALL LETTER C WITH CARON)
and glyph name for 'č' is /ccaron. Unicode character is 0+010D.

Note that U+OOE8 (decimal 232) is 'Ú' (LATIN SMALL LETTER E WITH GRAVE)
which is reason why encoding file (csr.enc) is needed. Unicode is
extension of Latin 1 (character positions 127-255 are same) so this is
reason why Latin 1 PK fonts works fine without encoding files...

In V3 version of patch I added check for duplicate glyph names to
prevent generating incorrect PDF files. Duplicates of glyph names are
not used and default glyph name used by pdftex "\a<number>" is used as
before. And I added small extension to pdftex-t.tex documentation as
Karl Berry wanted.
--
Pali Rohár
***@gmail.com
Loading...