[luatex] ligatures with luaotfload

Khaled Hosny khaledhosny at eglug.org
Mon Oct 10 01:56:15 CEST 2011

On Sun, Oct 09, 2011 at 12:58:37PM +0200, Javier Múgica de Rivera wrote:
> > you have to explicitly set kern and ligatures: [...] +liga;+kern
> > if you don't select a script no feature will be enabled by default
> Thank you two, both of
> \def\otffont#1=#2 at{\font#1={#2: +kern;+liga} at}
> \def\otffont#1=#2 at{\font#1={#2: script=latn} at}
> work.
> Now that I know the answer I have looked again into the luaoftload
> manual and the OpenType Feature File Specification, and see that all
> the nedeed pieces are present, but they appear scatered here and
> there. You don't need to know anything about .tfm fonts in order to
> use them. I would expect the same for otf fonts as long as you don't
> ask for complicate operations. That is, I would expect
> \input luaotfload.sty
> \font\tenrm=LMRoman10-Regular
> to be the same as
> \font\tenrm=ec-lmr10
> I _had_ read:
> "script
> OpenType script string, default value is dflt. Some fonts don’t assign
> features to
> the dflt script, in which case the script need to be set explicitly."
> but since Latin Modern fonts are designed just for the Latin script I
> could not imagine that keeping the default would miss features.
> And it is true that at the section of "Troubleshooting" there appears
> the example
> \font\myfont = MyFont.otf:script=latn;+liga;
> but here the key words latn and liga just happen to appear. That is,
> if you want kerning you still have to find the appropriate word for
> that somewhere else, as well as if you want some other script. And
> after a good deal of browsing through the Internet to find the right
> answer (the name for the kerning and ligature features) I had simply
> forgotten about this last example, something likely to happen if you
> need to put ten different pieces of information together in order to
> make something work.
> To summarize, in my opinion
>     a) The package should try hard to make its default behavior what a
> user would want when loading an OpenType font.

OpenType is a complicated beast and will never be as simple as old TFM
fonts (feature activation wise, else I see nothing simple about TFM
fonts; you had to do a good deal of complicated setup to merely install
them). However, \font\tenrm=LMRoman10-Regular was supposed to such work,
but the way it was actually implemented requires selecting a script for
things to work. This have been fixed in the unstable branch, so you may
want to use that until there is a release.

> and
>     b) It should provide a list of script names when it describes the
> keyword script, and a list of feature names when it mentions that font
> features are enabled/disabled "in the form of +feat/-feat" (there is
> not a single example).

I'm not going to duplicate OpenType layout tag[1] registry in the
package documentation, sorry. However, improvements to make the
documentation more clear to people not familiar with OpenType are very

>    The solution for point a) may just be to always activate kerning,
> ligatures and final or other alternatives shapes for glyphs (is this
> what is called contextual ligatures?)

Things are more complicated than that since different scripts have
different set of features that need to be activated by default, this why
the old code required setting a script, now if no script is specified I
just assume it is DFLT and activates the respective set of feature
(which is the same as that of Latin script).

> Finally, Khaled, thank you very much for the package! I had asked some
> two or three years ago how I could use an OpenType font in Luatex and
> the answer was essentially "program it yourself"

Thanks all goes to Hans who is doing all the real work, Elie and others
who wrote the plain tex/latex package, I'm merely glueing things


[1] http://www.microsoft.com/typography/otspec/ttoreg.htm

 Khaled Hosny

More information about the luatex mailing list