[luatex] Using classic TeX 8-bit fonts in LuaTeX

Petr Olsak petr at olsak.net
Thu Dec 6 17:17:24 CET 2012

>> Hello LuaTeXist.
>> I'm sorry, but I would tried to remind my last question, because I 
>> unfortunately did not record any response.
>> Is there any information about using classic TeX 8-bit fonts in LuaTeX?
>> Is LuaTEX able to work with a classic TeX 8-bit fonts? Which way?
> Yes. And in the same way as pdftex. But you will need
> *  \directlua{tex.enableprimitives('', tex.extraprimitives())} if you 
> need pdf (otherwise  \pdfoutput is not defined).
> * to make sure your (input) file encoding is UTF-8.
> Last time I checked, luatex even supported PK files in pdf mode  (but 
> that was two years ago).
> You could also have just tried yourself, you know ;)
> Best wishes,
> Taco

No, this doesn't work with Czech alphabet:

luatex -ini plain
*\directlua{tex.enableprimitives('', tex.extraprimitives())}

(I have no long hairs, the reason is to show the simplest exmaple:-)

luatex -fmt plain '\chardef\x=`č \show\x'
> \x=\char"10D.
<*> \chardef\x=`č \show\x

(the letter after =` is ccaron, the one of letters from Czech alhpbet).
We can see, that Unicode font is needed, because the character slot is
"10D and this is greater than 255 and impossible to prit it by 8bit font.

May be, the original question was no cleanly formulated. We want to use 
8bit (for example T1 encoded) font with Czech language in luaTeX. If you 
are using west-Europe languages (French, Spanish, German, Swedish etc.) 
you are no problem, because the UTF8 codes of letters of your language are 
mapped to Unicode with slots less than 256 and T1 encoding has the same 
slots for these letters. You have no problem, but we (from Czech Republic) 
do have the problem.

So, the question is: is possible to use a simple ready-to-use lua code to
change the behavior of the input processor of luaTeX in order to map
the UTF8 codes to T1 encoding? If this solution exists we need not to
deal with Unicode fonts.

Petr Olsak

More information about the luatex mailing list