[luatex] luatextra font system

Elie Roux elie.roux at telecom-bretagne.eu
Sat Mar 14 09:58:27 CET 2009


Hello,

I'm starting to work on the fontenc package, and here are a few 
thoughts, I think it's important:

First people using a 8-bit encoding and a standard fontenc won't have 
any problem. The problems will start with people using utf8. The most 
logical way to go is (tell me if I'm wrong) to load the eu1 encoding. 
I've tested it a little, it works fine with, for instance (if you create 
eu1ptm.fd):

\usepackage{times}
\usepackage[EU1]{fontenc}

The main problem with EU1 encoding, is that it's XeTeX oriented, so it 
calls fonts with the XeTeX syntax, which means \font="[file]" for files 
in the TDS. I don't really understand why XeTeX did such an incompatible 
font syntax, but it's done... So there are two solutions: adapting EU1 
and adapting LuaTeX... I already made a parser for the complete XeTeX 
syntax in LuaTeX so the technical part is not really a problem, but it 
means that people will have to load luatextra before fontenc, otherwise 
they'll get an error... I'll try to adapt eu1 for LuaTeX with Will.

Another problem with EU1 encoding is that almost no font understands the 
EU1 encoding: there are t1*.fd and ot1*.fd for every font, but no 
eu1*.fd. A solution would be to build a package that would provide one 
for all the fonts in TL. Basically it's just copy/pasting, there is no 
difficulty. Do you think it's a good idea? If so I'll make a package for 
this.

EU1 may be good for the future, but it does not resolve backward 
compatibility problems, as most of (my for example) documents created 
now say:

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

So I guess I'll have to write some code to convert unicode into other 
font encodings. A (small) problem is the fact that it will certainly 
need a callback into define_font, and the otf font reading will register 
one too, and the conflict can't really be resolved... So I was thinking 
about creating a luafonts package that would register a callback, and 
allow other packages to use some hooks in it. For example there would be 
a hook to open a otf/ttf font, another to do some things (like managing 
encoding) in the final font structure before it's returned, etc. In this 
way, font management would be accessible by several packages... wdyt? In 
any case, I'll need to patch fontenc so that it loads the new font 
management system.

Also, a bonus question: in this font management, could lmr10 be the font 
loaded when there is a load error, or is cmr10 necessary for backward 
compatiblity?

Thank you in advance,
-- 
Elie


More information about the luatex mailing list