2

I am using the Lato font for a document, but whenever the letters "ft" and "ti" are next to eachother, this font cannot separate the characters. When doing a copy-paste of the word in the output pdf-viewer, weird things happen as "ti" is considered as one letter.

\documentclass{article}
\usepackage{fontspec}
\setmainfont{Lato}

\begin{document}
Simulations \huge{\textbf{Institute, simulations}}
\end{document}

Output:

One can see that the ti are glued together

This should not be the usual output. As one can try on the website https://fonts2u.com/lato-regular.font?ptext=Simulations the output should look like this (space separation between "t" and "i") One can see that the ti are separated

5
  • 4
    They're not common ligatures, but it sounds like they are ligatures - here are a lot of Q&As on disabling them, depending on which engine you're using
    – Chris H
    Commented Oct 13, 2021 at 14:07
  • 3
    They are part of the liga (Standard Ligatures) feature, so they should be enabled by default in most applications using the font. The website you link probably would show them too, but it uses a much older version of the font which probably didn't have them yet: TeX Live has version 2.015 from 2015-08-06, while the website uses 1.010 from 2010-12-12. Commented Oct 13, 2021 at 14:48
  • 2
    In any case, copy-paste should work correctly for these ligatures. It it doesn't, then there is probably some other issue. But your document works fine with c&p on my system, so it's unclear why it doesn't work for you. Commented Oct 13, 2021 at 14:53
  • 1
    Ah they are called ligatures ! Thanks @ChrisH this solved my problem, \setmainfont{Lato}[Ligatures=NoCommon]
    – user227689
    Commented Oct 13, 2021 at 15:40
  • You can block a ligature for a single instance with zero-width hspace or an empty mbox: Inst\hspace{0pt}itute Inst\mbox{}itute
    – Cicada
    Commented Oct 15, 2021 at 13:47

3 Answers 3

4

Apparently, the Lato TrueType font has peculiar ligatures, besides the really standard ones, in the liga (Standard Ligatures) feature.

\documentclass{article}
\usepackage{fontspec}
\setmainfont{Lato}

\begin{document}

Institute, simulations

flagstaff finicky official

\end{document}

enter image description here

On the other hand, this is what I get from copy-pasting here the text from the PDF file:

Institute, simulations
flagstaff finicky official

so the strange ligatures are split in the process.

You can disable the ligatures, but you can only disable all of them.

\documentclass{article}
\usepackage{fontspec}
\setmainfont{Lato}[
 Ligatures=NoCommon,
]

\begin{document}

Institute, simulations

flagstaff finicky official

\end{document}

enter image description here

Actually, this is even better: the glyph shapes don't really need ligatures.

4
  • Font features can be restricted locally to a brace group: {\addfontfeatures{Ligatures=NoCommon}Institute} disables all ligatures for the word - so its usefulness will depend on the specific word. Otherwise, the \mbox{} trick could be used for a specific pairing.
    – Cicada
    Commented Oct 15, 2021 at 13:56
  • Off-the-wall question: Since this font is so picky as to have a "ti" ligature, does it have an "fj" ligature? (There are fjords in some English-speaking countries too.) Commented Nov 6, 2021 at 17:52
  • @barbarabeeton Yes, from its liga feature, sub \f \j by \f_j.liga;
    – Thérèse
    Commented Nov 6, 2021 at 18:07
  • Thanks. More fonts should do this. Commented Nov 6, 2021 at 18:23
1

This font family behaves in surprising ways. One should be able to turn off the ligatures you dislike in this way:

\documentclass{article}
\usepackage{fontspec}
\directlua{
  fonts.handlers.otf.addfeature{
    name = "noft",
    type = "multiple",
    data = {
      ['f_f_t.liga'] = { "f", "f", "t" },
      ['f_t.liga'] = { "f", "t" },
      ['t_t_i.liga'] = { "t", "t", "i" },
      ['t_i.liga'] = { "t", "i" },
    },
  }
}
\setsansfont{Lato}[RawFeature=+noft]
\begin{document}
\sffamily
Institute attic simulations pfft baffle five flying officials
\end{document}

However, the output is full of the t-ligatures.

If you want the standard ligatures without the others, turn off liga and add back the desired ligatures as rlig (which is on by default):

\documentclass{article}
\usepackage{fontspec}
\directlua{
  fonts.handlers.otf.addfeature{
    name = "rlig",
    type = "ligature",
    data = {
      ['ffi'] = { "f", "f", "i" },
      ['ffl'] = { "f", "f", "l" },
      ['ff'] = { "f", "f" },
      ['fi'] = { "f", "i" },
      ['fl'] = { "f", "l" },
    },
  }
}
\setsansfont{Lato}[Ligatures=NoCommon]
\begin{document}
\sffamily
Institute attic simulations pfft baffle five flying officials
\end{document}

output

I can think of no reason why this second approach works but not the first. The solution requires compiling with lualatex.

0

enter image description here

\documentclass{article}
\usepackage[default]{lato}
\usepackage[T1]{fontenc}

\begin{document}
Simulations \huge{\textbf{Institute, simulations}}
\end{document}
1
  • This solution would appear to employ pdfLaTeX for compilation, whereas the OP's use of the fontspec package clearly indicates that either XeLaTeX or LuaLaTeX ought to be used.
    – Mico
    Commented Oct 14, 2021 at 8:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .