[pdftex] pdftex - Encoding for metafont PK fonts

Pali Rohár pali.rohar at gmail.com
Sat Jun 25 23:21:16 CEST 2016


On Saturday 25 June 2016 22:52:23 Paul Vojta wrote:
> 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.
> 
> [snip]
> 
> > 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.

Yes.

> So, given your
> comments below, virtual fonts would not be able to support this
> character.

I thought.

> > 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.

When specifying Type 1 PFB font, it needed to add it into pdftex font 
map file (primitive \pdfmapfile). And map line allows to specify 
encoding vector file. That file contains for each character 0-255 
position glyph name. And pdftex primitive \pdfglyphtounicode then maps 
glyph name to unicode character. So For PFB fonts it is possible to do 
that 0-255 position to unicode mapping.

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?

> > 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.

Luatex is unicoded and it is possible to create virtual font which remap 
latin2 to unicode (yesterday I tried that). But my question is about 
pdftex right now.

-- 
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/20160625/49d8dae9/attachment.bin>


More information about the pdftex mailing list