[pdftex] pdftex - Encoding for metafont PK fonts

Paul Vojta vojta at math.berkeley.edu
Sat Jun 25 22:52:23 CEST 2016

On Sat, Jun 25, 2016 at 12:46:06PM +0200, Pali Rohár wrote:
> On Friday 24 June 2016 23:10:04 Paul Vojta wrote:
> > For PK fonts as produced by MetaFont (which are not PS Type 3),
> > probably the way to go would be to create a virtual font to achieve
> > the reencoding. That is the standard way to go in the dvi driver
> > world.


> So e.g. when I select character 'č' PDF reader copy 'è'. 'č' is at 
> position 0xE8 in Latin2 and at position 0xE8 in Latin1 is 'è'.

I presume that your character 'č' is U+010D (LATIN SMALL LETTER C WITH
CARON), which is not in the range 0-255.  So, given your comments below,
virtual fonts would not be able to support this character.

> Maybe PDF readers could think that font is not in Latin1, but in Unicode 
> as IIRC Unicode at positions 128-255 have same characters as Latin1 
> encoding.
> Unicode character U+00E8 is for sure 'è'. So I bet this is reason why 
> PDF reader thinks that I selected character 'è' and not 'č'.
> For Type 1 PFB fonts (even in IL2 encoding) this is not a problem, 
> because for each characters there is stored unified glyph name and there 
> is standard conversion table from glyph name to unicode character.
> So probably in PK fonts is not any conversion table from 8bit character 
> to unicode character and so something (pdftex? PDF reader?) assume 
> either Latin1 or Unicode.

Yes, I agree that this is likely the case.  I do know that in PK fonts,
there is only a character (or no character) for each of the positions 0-255,
with no character names or additional coding information.

> In detail my question is: How to tell pdftex encoding of PK font 
> (generated from MetaFont)?
> > For information on virtual fonts:  use Google.
> With above detailed description, are you sure that virtual fonts could 
> do this unicode mapping?
> Are not virtual fonts again only 8bit (as opposite of glyph names and 
> unicode)?

Yes, virtual fonts are only 8 bits.  There are things called "omega
virtual fonts" which I think allow for larger-numbered characters,
but I don't know whether pdftex supports them.  I think that luatex does.

Paul Vojta, vojta at math.berkeley.edu

More information about the pdftex mailing list