9

I have a font named Berling containing fi and fl ligatures on glyph 109 and 110. How can I activate these with lualatex? For the moment I am trying:

\documentclass[a4paper]{memoir}
\usepackage[utf8]{inputenc}
\usepackage{fontspec}

\begin{document}
\setmainfont[ItalicFont={BerlIt}, Ligatures={Required}]{Berling}

Fi fi Fl fl \textit{Foo Fii fi}

\end{document}

But I get:

*************************************************
* fontspec warning: "icu-feature-not-exist-in-font"
* 
* OpenType feature 'Ligatures=Required' (+rlig) not available for font
* 'Berling' with script 'Latin' and language 'Default'.
*************************************************

enter image description here


EDIT: I have now also tried (and both with and without Script=Default)

\documentclass[a4paper]{memoir}
\usepackage{fontspec}

\begin{document}
\setmainfont[ItalicFont={BerlIt}, Ligatures={Common, TeX}, Script=Default]{Berling}

Fi fi Fl fl \textit{Foo Fii fi}

\end{document}

  • Either the font does not have the features at all, or they are not registered for Latin script, try Script=Default, and see if it works. – Khaled Hosny Feb 17 '13 at 17:13
  • 1
    Also do not use inputenc with lualatex/xelatex. These 2 already assume you use UTF-8 in your source. – ArTourter Feb 17 '13 at 17:39
  • Where did you get the font from? – egreg Feb 17 '13 at 18:43
  • 1
    The f-ligatures are usually contained in the Common ligature group rather than in the Required ligature group. You may want to try the option Ligatures=Common or, better still, Ligatures={Common, TeX} when executing the \setmainfont instruction. – Mico Feb 17 '13 at 18:45
  • 1
    Have a look at this answer: tex.stackexchange.com/a/31218/4427 – egreg Feb 18 '13 at 9:20
7

Thanks to egregs help and this answer the I got the following solution which works for me:

\documentclass[a4paper]{memoir}
\usepackage{fontspec}

\begin{document}
\setmainfont[ItalicFont={BerlIt}, FeatureFile=myligatures.fea]{Berling}

Fi fi Fl fl \textit{Foo Fii fi}

\end{document}

And the following feature file:

languagesystem DFLT dflt ;
languagesystem latn dflt ;
feature liga {
       sub f i by f_i ;
       sub f l by f_l ;
} liga ;

enter image description here

Now I am gonna take a last look at the glyphs in that file and see if there are any other ligatures worth using :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.