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

With Renderer=HarfBuzz, \fontname output has no quotes #525

Open
1 of 4 tasks
jfbu opened this issue Jul 19, 2024 · 3 comments
Open
1 of 4 tasks

With Renderer=HarfBuzz, \fontname output has no quotes #525

jfbu opened this issue Jul 19, 2024 · 3 comments

Comments

@jfbu
Copy link
Contributor

jfbu commented Jul 19, 2024

Description

With Renderer=HarfBuzz, \fontname output has no quotes.

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}

\begin{document}

\fontspec{TeX Gyre Termes}

\small

\edef\foo{\fontname\font}

\fontspec[Renderer=HarfBuzz]{TeX Gyre Termes}

\edef\bar{\fontname\font}

\ttfamily

\foo

\bar

\end{document}
% Local variables:
% TeX-engine: luatex
% End:

Capture d’écran 2024-07-19 à 18 51 26

Further details

I am using \small because without it, the second line in output ends with at 10pt and I wanted to exclude that it may have to do with missing quotes.

For background I hit againts this while updating a mathastext work-around to also take care of Renderer=HarfBuzz. Due to missing quotes, an error arose later when using the transmogrified output of \fontname.

edit: mathastext 1.4 soon to get released works around this at macro level.

It may be that this has nothing to do with fontspec and does not belong here.

However for non-expert the world of LuaLaTeX font is simply too complex to try to disentangle what belongs to fontspec, what belongs to luaotfload and what belongs to LuaTeX proper or perhaps again something else.

@jfbu
Copy link
Contributor Author

jfbu commented Jul 19, 2024

EDIT. Only after posting I made the link with a problem I had encountered some time ago where I was forced to use TeXGyreTermes and not TeX Gyre Termes.

here is the MWE.

\documentclass{book}% no (immediate) problem with article class
\usepackage{fontspec}
\defaultfontfeatures{Renderer=HarfBuzz}
%\usepackage{luaotfload}% does not solve the problem anything
\setmainfont{TeX Gyre Termes}[% no issue with TeXGyreTermes
    Numbers={OldStyle},%
]
\begin{document}
0123456789
\end{document}
% Local variables:
% TeX-engine: luatex
% End:

One gets:

$ lualatex other_fontspec_fontname
This is LuaHBTeX, Version 1.18.0 (TeX Live 2024) 
 restricted system commands enabled.
(./other_fontspec_fontname.tex
LaTeX2e <2024-06-01> patch level 2
L3 programming layer <2024-05-27>
 (/usr/local/texlive/2024/texmf-dist/tex/latex/base/book.cls
Document Class: book 2024/02/08 v1.4n Standard LaTeX document class
(/usr/local/texlive/2024/texmf-dist/tex/latex/base/bk10.clo))
(/usr/local/texlive/2024/texmf-dist/tex/latex/fontspec/fontspec.sty
(/usr/local/texlive/2024/texmf-dist/tex/latex/l3packages/xparse/xparse.sty
(/usr/local/texlive/2024/texmf-dist/tex/latex/l3kernel/expl3.sty
(/usr/local/texlive/2024/texmf-dist/tex/latex/l3backend/l3backend-luatex.def)))
 (/usr/local/texlive/2024/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty
(/usr/local/texlive/2024/texmf-dist/tex/latex/base/fontenc.sty)
(/usr/local/texlive/2024/texmf-dist/tex/latex/fontspec/fontspec.cfg)))
No file other_fontspec_fontname.aux.
(/usr/local/texlive/2024/texmf-dist/tex/latex/base/ts1cmr.fd)

luaotfload | db : Reload initiated (formats: otf,ttf,ttc); reason: Font "TeX" not found.
! Font \TU/TeXGyreTermes(0)/m/it/10=name:TeX not loadable: metric data not foun
d or bad.
<to be read again> 
G
l.10 \end{document}
                 
? X
 700 words of node memory still in use:
   5 hlist, 1 vlist, 2 rule, 1 local_par, 6 dir, 8 glue, 3 kern, 2 penalty, 11 
glyph, 9 attribute, 63 glue_spec, 9 attribute_list, 6 temp, 3 if_stack, 1 write
 nodes
   avail lists: 1:1,2:9,3:2,4:1,6:1,7:14,9:1

warning  (pdf backend): no pages of output.
Transcript written on other_fontspec_fontname.log.

I am attaching the full log.
other_fontspec_fontname.log

@khaledhosny
Copy link
Contributor

See latex3/luaotfload#285

@jfbu
Copy link
Contributor Author

jfbu commented Jul 19, 2024

@khaledhosny ouch, I should have minimally checked. Does look like a duplicate indeed.

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

2 participants