What are the things to know when moving from XeTeX to LuaTeX, particularly when it comes to TTF/OTF support and OpenType features?
5 Answers
The only difference is for Linux: OpenType or TrueType fonts from the TeX directory structure, e.g. the texgyre fonts, have to be assigned by its filename for XeTeX
, e.g. \fontspec{texgyre-pagella.otf}
. LuaTeX itself also searches the TeX font directories, the reason why LuaTeX finds such font defined by its family name, e.g. \fontspec{TexGyre-Pagella}
. For MiKTeX it should make no difference, fonts should be found.
The package mathspec
works only for XeTeX
. And polyglossia
doesn't work with LuaLaTeX yet.
-
In XeTeX on Linux, I currently use the font name, not the font filename. For example, I do
\fontspec{Linux Libertine O}
and it works. Doesfontspec
work with LuaLaTeX? I get an error when I runlualatex
on a tex file usingfontspec
(using TL2009)...– raphinkCommented Jul 20, 2011 at 14:47 -
Are you sure that font names don't work on TeXLive? The font database is generated by lualatex/luaotfload/mkluatexfontsdb and if a font is found at all why shouldn't the font name be in the database too? There is certainly no problem on miktex, lualatex accepts even a lot of name variants like
\setmainfont{TeXGyrePagella}
. Commented Jul 20, 2011 at 15:03 -
@Ulrike: I wrote, that
XeTeX
needs the file name!– user2478Commented Jul 20, 2011 at 15:34 -
Ah. Sorry I read it the other way round. Doesn't this here solve the problem: tug.org/texlive/doc/texlive-en/texlive-en.html#x1-350003.4.4? (But it can also lead to trouble if too much folders are searched and used by xetex. XeTeX doesn't like it very much if a font exists in two variants.) Commented Jul 20, 2011 at 16:01
-
1@Ulrike, sure that's the problem but LuaTeX solved it in user friendly way, XeTeX not ... and of course, all fonts should go into one system and one local folder.– user2478Commented Jul 21, 2011 at 9:47
If you want to move from XeLaTeX to LuaLaTeX, you should read lualatex-doc. If you want to use from ConTeX MkII to MkIV, many things will change.
-
I'm interested in moving to a modern cutting-edge system, and mostly benefiting from font expansion while still keep an easy way to manage TTF/OTF fonts with OpenType features. I do not plan on using ConTeXt though, but rather keep with LaTeX for now (I'm using specific LaTeX packages such as
bibleref
).– raphinkCommented Jul 20, 2011 at 21:12
There are some caveats with multilingual typesetting with OpenType shaping features; I'm not really the one to ask about it, though. XeTeX uses the ICU to do its OpenType magic, which as I understand things is a lot more comprehensive than what's currently done by LuaTeX and its supporting machinery. For example, unless things have changed recently, I don't believe that LuaTeX will be able to typeset Indic languages correctly.
XeTeX isn't a silver bullet here either, but I think its coverage is more comprehensive.
-
Most of my needs as far as OpenType features are concerned are ligatures, letter/word spacing, oldstyle/uppercase numbers, small caps, alternate forms. Nothing really fancy.– raphinkCommented Jul 21, 2011 at 8:24
-
As I actually ended up switching from XeTeX to LuaTeX, I've met a few other problems.
Most notably:
- LetterSpace and WordSpace options in
fontspec
are not supported in LuaTeX, so you have to usetextls
from microtype like in PDFTeX in order to achieve tracking; textls
sometimes break with small caps (see textls breaks smallcaps with luatex).
My main motivation for moving from XeTeX to LuaTeX was movies. As it is said in my posts (Can XeLaTeX | LuaTeX import movies ?, Why \movieref does not work under XeLaTeX) XeTeX has troubles with importing movies. The latter one is still unresolved.