LuaTeX does not find liga OpenType feature

I created a custom font in FontForge and generated an OTF of it. It contains the usual ligatures fi, fl, ff, ffi, and ffl. I use the font like this:

\documentclass{article}

\usepackage{fontspec}
\setmainfont[Ligatures={Common}]{MyFont-Regular}

\begin{document}
fi
\end{document}


Calling “lualatex mytest” yields:

This is LuaTeX, Version 1.10.0 (TeX Live 2019/Debian)
restricted system commands enabled.
(./mytest.tex
LaTeX2e <2020-02-02> patch level 2
L3 programming layer <2020-02-14>
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2019/12/20 v1.4l Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo
luaotfload | db : This can take several minutes; please be patient.))
(/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec.sty
(/usr/share/texlive/texmf-dist/tex/latex/l3packages/xparse/xparse.sty
(/usr/share/texlive/texmf-dist/tex/latex/l3kernel/expl3.sty
(/usr/share/texlive/texmf-dist/tex/latex/l3backend/l3backend-pdfmode.def)))
(/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty
(/usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty)
(/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec.cfg)))

Package fontspec Warning: OpenType feature 'Ligatures=Common' (liga) not
(fontspec)                available for font 'MyFont-Regular' with script
(fontspec)                'CustomDefault' and language 'Default'.

Package fontspec Warning: OpenType feature 'Ligatures=Common' (liga) not
(fontspec)                available for font 'MyFont-Regular' with script
(fontspec)                'CustomDefault' and language 'Default'.

(./mytest.aux) (/usr/share/texlive/texmf-dist/tex/latex/base/ts1cmr.fd) [1{/var/l
ib/texmf/fonts/map/pdftex/updmap/pdftex.map}] (./mytest.aux))
406 words of node memory still in use:
3 hlist, 1 vlist, 1 rule, 2 glue, 3 kern, 1 glyph, 4 attribute, 48 glue_spec
, 4 attribute_list, 1 write nodes
avail lists: 1:1,2:15,3:2,4:1,5:21,6:1,7:14,9:7
</home/bronger/fonts/MyFont-Regular.otf>
Output written on mytest.pdf (1 page, 2424 bytes).
Transcript written on mytest.log.


I don’t see my fi ligature in the PDF. XeLaTeX processes the very same script with no warnings, and an fi ligature in the PDF. Moreover, LibreOffice writer shows the ligature, and does not show it if I remove the “lookup” “liga” entry with the substitution table from the font metadata. The script given in FontForge for this lookup entry is “latn{dflt}”.

However, professional OTF files that I have here do work with LuaTeX, so somehow it should be possible to make the ligature table available to LuaTeX. Unfortunately, I don’t see the decisive difference in FontForge.

How can I get my ligatures in the PDF using LuaTeX? (Without manual character selection, of course.)

(Remark: I’d like to use LuaTeX over XeTeX because it supports microtype’s characters expansion for better line breaks.)

• you probably will have to set the Script to another value (or the language). Check the fontspec docu. Jun 14, 2021 at 10:10

At least the following two things are necessary so that LuaTeX recognises the ligatures as an OTF font feature:

• The scrips/languages metadata of the “liga” feature needs to contain the entry “DFLN{dflt}”. This in conjunction with “latn{dflt}” is inserted by default by FontForge.
• When generating the OTF font (I made a CFF OpenType), you must check in the SFTN section of the export options “OpenType” and unmark “Apple”. This, too, is default for FontForge.

The latter was different in my case and turned out to be fatal. I do not know why it was different for me. Possibly my setting used to be default in a previous FontForge release, or I fiddled around with the settings years ago. Anyway.

I should add that the [Ligatures={Common}] above is not needed if everything is set up correctly in the OTF file.

• I have a similar problem. Created a custom font in fontforge with a "latn{dflt}" lookup for some custom and unusual ligatures. I exported it as OpenType and checked SFTN and so on, just as you said. I imported it into a XeTeX document using the fontspec package but it doesn't show my ligatures. In LibreOffice etc. they are shown properly. Jun 3 at 8:52