2

While looking at this question I noticed that some of the code ligatures from the JetBrains Mono font (freely available from their website) worked in xelatex, but not in lualatex. Compare:

Xelatex

Lualatex

Source

I had to add some characters to \verbatim@nolig@list so that the ligatures didn't appear in verbatim.

\documentclass[12pt]{article}
\usepackage{fontspec}
\setmonofont{JetBrains Mono}

\makeatletter \AddToHook{cmd/verbatim@nolig@list/after}{\do |\do =\do +\do ~\do #\do .\do /\do ?\do :\do [\do ]} \makeatother

\pagestyle{empty}

\begin{document} \ttfamily \begin{tabular}{rl} <> & \verb|<>| \ |=> & \verb!|=>! \ <=| & \verb!<=|! \ ++ & \verb|++| \ -> & \verb|->| \ <- & \verb|<-| \ <-> & \verb|<->| \ <!-- & \verb|<!--| \ \textasciitilde> & \verb|~>| \ <\textasciitilde & \verb|<~| \ \textasciitilde\textasciitilde> & \verb|>| \ <\textasciitilde\textasciitilde & \verb|<| \ ->> & \verb|->>| \ <<- & \verb|<<-| \ --> & \verb|-->| \ <-- & \verb|<--| \ >-> & \verb|>->| \ <-< & \verb|<-<| \ /= & \verb|/=| \ => & \verb|=>| \ <= & \verb|<=| \ <=> & \verb|<=>| \ \end{tabular} \hspace{2cm} \begin{tabular}{rl} =>> & \verb|=>>| \ <<= & \verb|<<=| \ ==> & \verb|==>| \ <== & \verb|<==| \ <==> & \verb|<==>| \ >=> & \verb|>=>| \ <=< & \verb|<=<| \ ## & \verb|##| \ ### & \verb|###| \ |> & \verb!|>! \ <| & \verb!<|! \[0.5ex] [||] & \verb![||]! \ :?> & \verb|:?>| \ ::= & \verb|::=| \ :: & \verb|::| \ ?? & \verb|??| \ <+> & \verb|<+>| \ .. & \verb|..| \ </ & \verb|</| \ /> & \verb|/>| \ #? & \verb|#?| \ ]# & \verb|]#| \end{tabular} \end{document}

With lualatex the ligatures for <->, ->>, >->, and <-< do not appear correctly. Is this a bug in lualatex (or luaotfload, etc.), or an issue with the font?

Note that adding [Contextuals=Alternate] as in this answer seems to make no difference.

mbert
  • 4,171

1 Answers1

1

As Ulrike Fischer answered in a comment, the first thing to try whenever something works in XeLaTeX and not LuaLaTeX is to load the font with Renderer=HarfBuzz. I don’t have that font to test, but you say it worked for you.

The reason is that, by default, XeTeX uses the HarfBuzz renderer for modern Unicode fonts, and LuaTeX uses its own experimental renderer. You’ve already reported this to them as a bug.

Davislor
  • 44,045