[luatex] luatex - font encoding for type 1 fonts

Pali Rohár pali.rohar at gmail.com
Thu Jun 23 10:19:34 CEST 2016

On Saturday 18 June 2016 00:14:45 Hans Hagen wrote:
> On 6/17/2016 10:28 PM, Pali Rohár wrote:
> >On Thursday 09 June 2016 22:44:56 Pali Rohár wrote:
> >>Hello,
> >>
> >>how I can specify font encoding for specific type 1 font?
> >>
> >>E.g. font csr10 (stored in fonts/type1/public/cs/csr10.pfb) is in IL2
> >>encoding which means that character č (Latin Small Letter C with caron)
> >>is at position 232.
> >>
> >>Code 232 is invalid in UTF-8 and therefore I cannot enter it normally
> >>for luatex. So for printing it I need to use sequence \char232, which
> >>works.
> >>
> >>\font\csr=csr10
> >>\csr\char232
> >>\bye
> >>
> >>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.
> >>
> >>My very quick hack for this was changing catcode of č to 13 and then
> >>defining macro č as \char232.
> >>
> >>\catcode`\č=\active
> >>\defč{\char232}
> >>\font\csr=csr10
> >>\csrč
> >>\bye
> >>
> >>But I would like to avoid changing catcode of unicode characters and fix
> >>this at font level.
> >>
> >
> >Hello, has anybody idea about this problem?
> if you use those fonts indeed you need to map from input encoding to font
> encoding and active characters are the way to go then

I would like to not use this...

> the context distribution ships with plain font support in which case you can
> best use the lm fonts instead of csr (i can't even locate those files)

Sorry, I need this for plain not context.

CSFonts (csr*) are included in cstex support. On Debian it is in package
named texlive-lang-czechslovak. You can also find it on ctan:


> \font\csr=lmroman10-regular.otf:+liga;+kern at 10pt
> % \font\csr=csr.afm:+liga;+kern at 10pt

There is no afm file. Only tex metrics, mf sources and type1 fonts:
csr10.tfm csr10.mf csr10.pfb

> \csr č \bye
> and then somehging like:
> luatex --fmt=luatex-plain \dump
> luatex --fmt=luatex-plain yourfile.tex
> (here i test plain code with:
> mtxrun --script plain --make
> mtxrun --script plain        yourfile.tex
> but that assumes a context installation)
> (alternatively you can write a simple font loader in lua that does the
> mapping)

Can you give me some hints about this? I think that simple lua code
which properly loads+translate font from IL2 encoding to UTF-8 is
correct way.

PS: I'm not subscribed to list, so CC me.

Pali Rohár
pali.rohar at gmail.com

More information about the luatex mailing list