latex3 / fontspec

Font selection in LaTeX for XeTeX and LuaTeX
http://latex3.github.io/fontspec/
LaTeX Project Public License v1.3c
277 stars 34 forks source link

Renderer=HarfBuzz is XeTeX. #430

Open kberry opened 4 years ago

kberry commented 4 years ago

I'd like to run a document (tugboat article) with both xelatex and lualatex. With LuaLaTeX, Renderer=HarfBuzz is required to use hb, as in:

\newfontfamily\devanagarifont[Script=Devanagari,Renderer=HarfBuzz]
  {NotoSerifDevanagari-Regular.ttf}

when run with xelatex, this generates a warning:

Package fontspec Warning: Ignored LuaTeX-only feature:
(fontspec)                'Renderer=Full/Basic/Node/Base/HarfBuzz'.

Ok, it's just a warning, but still, it's rather irritating. XeTeX is already rendering with HarfBuzz. So it would be nice if this particular setting would be silently accepted, instead of complained about. I know it's probably not simple though :(. Fine if you want to call it "wontfix" : ), just thought i'd suggest it. thanks.

Davislor commented 3 years ago

You can write

\usepackage{iftex}

\ifluahbtex
  \defaultfontfeatures{ Renderer=HarfBuzz, Scale=MatchLowercase, Ligatures=TeX }
\else
  \defaultfontfeatures{ Scale=MatchLowercase, Ligatures=TeX }
\fi

Or


\usepackage{iftex}

\ifluahbtex
   \defaultfontfeatures[NotoSerifDevanagari]{Renderer=HarfBuzz}
\fi

\newfontfamily\devanagarifont{NotoSerifDevanagari}[
  Scale = MatchUppercase,
  Script = Devanagari,
  UprightFont = *-Regular,
  BoldFont = *-Bold,
  Extension = .ttf ]
kberry commented 3 years ago

Yes, thanks. I know. The point of my message is that with xetex, since the renderer is always harfbuzz, it would be nice to silently accept that setting instead of warning about Renderer=harfbuzz. Then no conditional in the source is needed to avoid warnings when harfbuzz is desired for both engines.

However, I have my doubts that Will is ever going to have time to think about this, at least for the next N years while the kids gets older. And that's ok :).

Davislor commented 3 years ago

It’s a good suggestion. I usually just live with the warning, but it’s better not to have spurious warnings.