[luatex] luatex - font encoding for type 1 fonts

Michal Hoftich michal.h21 at gmail.com
Fri Jun 24 15:54:34 CEST 2016


>
> Is there any simple way to tell luatex font encoding table (unicode
> character --> code in type 1 font)? So I could be able to write utf8
> string "č" directly in text editor instead \char232.

I've made an experimental LuaLaTeX support for 8 bit fonts and fontenc
package using node callbacks. Basically, Unicode characters are
translated to 8 bit chars using translation tables, based on selected
font encoding. I am not sure whether it is a correct way to do this,
but it seems to work, including hyphenation:

https://github.com/michal-h21/luafontenc

While it is intended to work with fontenc package, you can use the Lua
modules to work with Plain. Support file for il2 encoding, il2lua.tex:

%%%%
\directlua{%
 encoding = require "encoding"
 callback.register("pre_linebreak_filter",encoding.callback, "fontenc")
callback.register("hpack_filter",encoding.callback, "fontenc")
}
\luatexattribute999=\directlua{%
 local enc = encoding.getEncId("il2")%
 tex.write(enc)%
 }
%%%%

and simple usage:

%%%%
\input il2lua
\font\csr=csr10
\uselanguage{czech}
\csr Příliš žluťoučký kůň úpěl ďábelské ódy.

\bye
%%%%

Best regards,
Michal



More information about the luatex mailing list