Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LuaLaTeX: Trying to set the Renderer to OpenType with \defaultfontfeatures gives inconsistent results #491

Open
2 of 4 tasks
callegar opened this issue Oct 31, 2023 · 0 comments

Comments

@callegar
Copy link

Description

I am trying to use \defaultfontfeatures{Renderer=OpenType} before configuring any font to set OpenType as the renderer for all fonts in place of node, that is the LuaLaTeX default.

The motivation is that LuaLaTeX appears to be way faster (twice as fast on small documents) when using HarfBuzz in place of the lua coded renderer. Currently my experiments are targeted at identifying problems and benchmarking. In perspective it would be nice to use \defaultfontfeatures to default to HarfBuzz and ask for the node renderer only in a few fonts where HarfBuzz mode can cause issues.

The problem is that by adding the Renderer=OpenType option to the individual fonts the compilation time is effectively slashed, while using \defaultfontfeatures{Renderer=OpenType} before loading the fonts actually makes the compilation slowlier as if node was still used (or maybe used in addition to HarfBuzz).

The fact that the fonts do not really switch to an HarfBuzz-only management is further confirmed by the fact that OpenType Math fonts have issues with HarfBuzz and cause LuaLaTeX to error out on many documents with them. However, using \defaultfontfeatures{Renderer=OpenType} which should cause all fonts to use OpenType does not trigger the error with the Math fonts.

Check/indicate

  • Relevant for XeTeX
  • Relevant for LuaTeX
  • Issue tracker has been searched for similar issues?
  • Links to <tex.stackexchange.com> discussion if appropriate

Minimal example demonstrating the issue

\documentclass{article}
\usepackage{fontspec}
\defaultfontfeatures{Renderer=OpenType}
\usepackage{unicode-math}
\setmainfont{Source Serif 4}
\setsansfont{Source Sans 3}[Scale=MatchLowercase]
\setmonofont{Source Code Pro}[Scale=MatchLowercase]
\setmathfont{XITS Math}[Scale=MatchLowercase]
\setmathfont[range=\mathup/{num,latin,Latin,greek,Greek}]{%
  Source Serif 4} 
\setmathfont[range=\mathbfup/{num,latin,Latin,greek,Greek}]{%
  Source Serif 4 Bold} 
\setmathfont[range=\mathit/{latin,Latin,greek,Greek}]{%
  Source Serif 4 Italic} 
\setmathfont[range=\mathbfit/{latin,Latin,greek,Greek}]{%
  Source Serif 4 Bold Italic}
\newfontface{\fontIstituzione}{Cinzel[wght].ttf}[%
  Scale=1.076, FakeStretch=1.038, RawFeature={+axis={wght=428}}]
\newfontfamily{\sansfontlarge}{Source Sans 3}[%
  Scale=MatchUppercase]

\begin{document}
hello \emph{hello}
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant