[XeTeX] fontspec – only XeTeX?
Arthur Reutenauer
arthur.reutenauer at normalesup.org
Mon Nov 17 23:37:01 CET 2008
Hello,
> I hope, someone here can help me: How deep is fontspec into XeTeX?
Very. I leave it to Will to describe it a bit more if he wants to,
but to sum up, fontspec uses XeTeX-specific features at its core, which
are implemented in very different ways in LuaTeX.
> Is
> there a chance for the same or a similar interface in LuaTeX?
Yes, but someone has to write it. And it will almost certainly not be
exactly identical.
> There would be no sense to read everything about
> fontspec and later use something totally different.
If something like a LuaTeX "port" of fontspec is ever written, and I
sure hope it will be some day, one can only hope that the author(s) will
try do give it an interface similar to the original fontspec's, but I
doubt it can be made 100% compatible. Thus, if your question is "Will I
be able to compile my documents unchanged under LuaTeX, using this
hypothetical fontspec?", the answer is probably no. Then again, if the
ground work for a LuaTeX-fontspec is done, it should be quite easy to
emulate the high-level interface of Will's fontspec.
> So does anyone know anything about the future of fontspec, maybe with
> LuaTeX, or similar projects?
Will can say for himself what future he envisions for his package; as
for this hypothetical fontspec-for-LuaTeX package you enquire about, I
already gave thoughts about what it should look like, and there are
quite a number of issues that need to be addressed, because fonts are
handled so differently in XeTeX and LuaTeX:
1. Lookup: XeTeX uses external libraries to look a font up, while
LuaTeX doesn't know of any such library, and would rely on external
programs, or on itself alone; for example, on Mac OS, XeTeX has access
to the Apple library functions for font search, and there exists no
standalone program which LuaTeX could use in their place. We can of
course use other tools (e.g., fontconfig), but this means that, at the
macro level, some decision must be made as to how LuaTeX-fontspec will
be looking for fonts on the system, whereas in XeTeX, everything is
taken care of by the \font primitive (and LaTeX and ConTeXt will
always find the same fonts on any given system).
2. OpenType layout engine: again, in XeTeX, this is taken care of by
external libraries (with Apple Type Services on Mac / ICU elsewhere),
and in LuaTeX, the responsibility is shifted to the macro package,
where everything needs to be implemented with Lua code. As a matter
of fact, LuaTeX doesn't even know what to do with a TrueType or an
OpenType font by default. You need to instruct it how to load these
fonts, and you also have to implement the whole OpenType layout engine
at the Lua level. I already wrote some basic code to handle the
former (http://luatex.bluwiki.com/go/Use_a_TrueType_font); the latter
is huge work and would need a lot of development time (my guess would
be months).
I wish to add that most of the above has already been implemented for
ConTeXt -- which is why I have personally little interest in porting
fontspec, a LaTeX-centric package, to LuaTeX -- even if there is still
work left to be done. The development has been led by the main ConTeXt
developers and has given rise to what is now called "Mark IV", and I'm
convinced that any reasonable attempt at writing a fontspec-for-LuaTeX
package should be done in close collaboration with the LaTeX development
team; in particular for point 1 above, which shouldn't be a huge amount
of work (in my opinion), but involves some critical design choices
(would we use fontconfig? Other third-party font lookup utilities? A
home-cooked font search engine? -- this is more or less what Mark IV
does).
Arthur
More information about the XeTeX
mailing list