[luatex] luatex - font encoding for type 1 fonts

Pali Rohár pali.rohar at gmail.com
Sat Jun 25 12:18:59 CEST 2016


On Friday 24 June 2016 15:54:34 Michal Hoftich wrote:
> > 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

With your package, can I use in one document csr10 font and also some 
new unicode font? Or ideally mix fonts with different encodings in one 
document?

-- 
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/luatex/attachments/20160625/f44822d8/attachment-0001.bin>


More information about the luatex mailing list