Fontspec + JuliaMono: missing glyphs in LuaLaTeX compared to XeLaTeX

fontspecluatextypewriterunicodexetex

I am trying to typeset a document that contains monospaced text with Greek-letter Unicode glyphs, e.g. alpha, beta, etc. To do so, I'm using the JuliaMono font, which has extensive support for mathy Unicode glyphs.

Strangely, the same LaTeX code correctly produces the desired Unicode output in XeLaTeX but not in LuaLaTeX (where many glyphs are replaced with "no glyph" rectangles). Here is the code:

\documentclass{article}

\usepackage{fontspec}
\setmonofont{JuliaMono}

\begin{document}
\ttfamily α β δ σ π γ ϵ ε η ς θ ϑ ϕ φ ψ
\end{document}
  • Here is the XeLaTeX output:

    xelatex-output-correct

  • Here is the LuaLaTeX output:

    lualatex-output-incorrect

Does anybody know what's going on? Why does LuaLaTeX fail to load certain glyphs (and oddly enough is OK loading pi) compared to XeLaTeX? Is this a bug or intended restriction of LuaLaTeX, and is there a way to fix the difference (e.g., explicitly tell LuaLaTeX to load in all glyphs)?

Best Answer

The fonts have a strange naming scheme. Call them explicitly.

\documentclass{article}

\usepackage{fontspec}
\setmonofont{JuliaMono}[
  Extension=.ttf,
  UprightFont=*-Regular,
  BoldFont=*-Bold,
  ItalicFont=*-RegularItalic,
  BoldItalicFont=*-BoldItalic,
]

\begin{document}
\ttfamily α β δ σ π γ ϵ ε η ς θ ϑ ϕ φ ψ ά έ ή ί ό ύ ώ
\end{document}

enter image description here

Related Question