[luatex] using fea files in plain TeX
Dohyun Kim
nomosnomos at gmail.com
Sat Jul 11 04:33:00 CEST 2009
2009/7/11 Khaled Hosny <khaledhosny at eglug.org>:
>
> I'd like to know about other issue (probably with fixes), and we can fix
> them for luaotfload until Hans releases another beta.
>
1.
This simple tex code fails to compile:
\input luatex-fonts
\font\tenrm=ec-lmr10
\tenrm
\bye
so I have added following code, which of course
was copied from context's lua code.
fonts.enc.known = fonts.enc.known or
{
texnansi = true,
ec = true,
qx = true,
t5 = true,
t2a = true,
t2b = true,
t2c = true,
unicode = true
}
2.
This tex file fails as well:
\documentclass{article}
\input luatex-fonts
\DeclareFontEncoding{EU1}{}{}
\DeclareErrorFont{EU1}{lmr}{m}{n}{10}
\DeclareFontSubstitution{EU1}{lmr}{m}{n}
\def\encodingdefault{EU1}
\def\rmdefault{lmr}
\def\sfdefault{lmss}
\def\ttdefault{lmtt}
\begin{document}
\ttfamily\bfseries
\end{document}
3.
I could not get visible spaces (U+2423) in verbatim environment.
\documentclass{article}
\input luatex-fonts
\DeclareFontEncoding{EU1}{}{}
\DeclareErrorFont{EU1}{lmr}{m}{n}{10}
\DeclareFontSubstitution{EU1}{lmr}{m}{n}
\def\encodingdefault{EU1}
\def\rmdefault{lmr}
\def\sfdefault{lmss}
\def\ttdefault{lmtt}
\begin{document}
\verb*|a b|
\end{document}
To deal with second and third issues,
I modified "define_font" callback.register function
similarly to the following:
callback.register('define_font',function(name,size,id)
local fontdata = fonts.define.read(name,size,id) -- by hans
if type(fontdata) == "table" then
fontdata.name = name -- ttfamily/bfseries
if fontdata.shared -- visible space
and fontdata.shared.otfdata
and fontdata.shared.otfdata.metadata
and fontdata.shared.otfdata.metadata.isfixedpitch then
if fontdata.characters[0x2423] then
fontdata.characters[0x20] = fontdata.characters[0x2423]
end
end
end
return fontdata
end)
The additions and modifications shown in this thread
are just temporary measures.
Certainly, true and correct patches to these issues
should come from Hans, as he alone fully understands
the codes of luatex-plain.
Regards,
Dohyun Kim
More information about the luatex
mailing list