[luatex] Encoding of fonts (fontloader/fontforge)

Patrick Gundlach patrick at gundla.ch
Tue Sep 29 10:25:16 CEST 2009


Hello,

I still have a question concerning the fontloader library.

* When I load a truetype/opentype font, I can use map.map and  
map.backmap to get a mapping between unicode positions and glyph  
numbers.
* When I load a type1 font, map.map and map.backmap give me a non  
usable mapping. I have to use the glyph[i].unicode field (which seems  
to be ok)
* The glyph[i].unicode field seems to be useless in case of truetype  
fonts.

So it looks as if I have to do this code:

if "type1" then use glyph[i].unicode
else use map.map/map.backmap

Q1: Is this correct?

Q2: How can I check if the loaded font is a type1 font? Is there any  
field in the fontlaoder table that can be checked against? I currently  
use the presence of pfminfo.unicoderanges. Is it guaranteed that  
pfminfo.unicoderanges is present, if (and only if) map.map/map.backmap  
is useable?


Patrick



More information about the luatex mailing list