4

I've installed a font (in this case "Rubik") that's not in the LaTeX Font Catalogue (those seem to all work fine), and tried to use it in a simple MWE:

\documentclass{article}

\usepackage{fontspec}
\setsansfont{Rubik}[
    Path = /Users/<USER>/Library/Fonts/,
    Extension = .ttf,
    UprightFont = *-Regular,
    ItalicFont = *-Italic,
    BoldFont = *-Bold,
    BoldItalicFont = *-BoldItalic
]

\begin{document}

Test.

\end{document}

This yields Package fontspec Error: The font "Rubik-Regular" cannot be found..

Of course, there's a myriad of answers to similar problems, e.g. How to properly install and use a new font with LuaLaTeX?. I tried troubleshooting as follows:

  • Tried any sensible path for Path = ..., I could think of (and moved the font files around correspondingly, even to the same folder as the root TeX file).
  • Tried "calling" the font in different ways (in particular, "directly" with Rubik-Regular.ttf)
  • Updated to newest tex distro, updated all packages, reinstalled luaotfload;
  • Ran luaotfload-tool -vvv --update --force

Interestingly, luaotfload seems to be able to find the font; luaotfload-tool --find="Rubik" succeeds:

luaotfload | resolve : Font "Rubik" found!
luaotfload | resolve : Resolved file name "/Users/<USER>/Library/Fonts/Rubik-Regular.ttf"

Also interesting is that luaotfload-tool --diagnose="files" returns a warning stating it found the following five errors:

luaotfload | diagnose : FAILED: file mktests missing.
luaotfload | diagnose : FAILED: file mkstatus missing.
luaotfload | diagnose : FAILED: file mkcharacters missing.
luaotfload | diagnose : FAILED: file mkglyphlist missing.
luaotfload | diagnose : FAILED: file mkimport missing.

I found these scripts on luaotfload's GitHub repository, and tried to add them manually to /usr/local/texlive/2022/texmf-dist/tex/luatex/luaotfload/, but it wouldn't change the output of the above diagnostic. All other diagnostics found no issues. As mentioned before, I reinstalled and updated luaotfload, and it's indeed on the latest version:

(base) [...] luaotfload-tool -V  
luaotfload-tool version: "3.21"
Revision: nil
Lua interpreter: stock; version "Lua 5.3"
Luatex version: 1.15
Platform: type=unix name=macosx
    +  machine: x86_64
[...]

I don't know if those missing scripts are actually relevant, however.

Any hints as to further troubleshooting I could do would be greatly appreciated. Thank you so much!

Full error log:

This is LuaHBTeX, Version 1.15.0 (TeX Live 2022)  (format=lualatex 2022.5.29)  29 MAY 2022 04:10
 system commands enabled.
 file:line:error style messages enabled.
**test.tex
(./test.tex
LaTeX2e <2021-11-15> patch level 1
Lua module: luaotfload 2022-03-18 3.21 Lua based OpenType font support
Lua module: lualibs 2021-05-20 2.74 ConTeXt Lua standard libraries.
Lua module: lualibs-extended 2021-05-20 2.74 ConTeXt Lua libraries -- extended collection.
luaotfload | conf : Root cache directory is "/Users/<USER>/Library/texlive/2022/texmf-var/luatex-cache/generic/names".
luaotfload | init : Loading fontloader "fontloader-2022-02-24.lua" from kpse-resolved path "/usr/local/texlive/2022/texmf-dist/tex/luatex/luaotfload/fontloader-2022-02-24.lua".
Lua-only attribute luaotfload@noligature = 1
luaotfload | init : Context OpenType loader version 3.119
Inserting `luaotfload.node_processor' at position 1 in `pre_linebreak_filter'.
Inserting `luaotfload.node_processor' at position 1 in `hpack_filter'.
Inserting `luaotfload.glyph_stream' at position 1 in `glyph_stream_provider'.
Inserting `luaotfload.define_font' at position 1 in `define_font'.
Lua-only attribute luaotfload_color_attribute = 2
luaotfload | conf : Root cache directory is "/Users/<USER>/Library/texlive/2022/texmf-var/luatex-cache/generic/names".
Inserting `luaotfload.harf.strip_prefix' at position 1 in `find_opentype_file'.
Inserting `luaotfload.harf.strip_prefix' at position 1 in `find_truetype_file'.
Removing  `luaotfload.glyph_stream' from `glyph_stream_provider'.
Inserting `luaotfload.harf.glyphstream' at position 1 in `glyph_stream_provider'.
Inserting `luaotfload.harf.finalize_vlist' at position 1 in `post_linebreak_filter'.
Inserting `luaotfload.harf.finalize_hlist' at position 2 in `hpack_filter'.
Inserting `luaotfload.cleanup_files' at position 1 in `wrapup_run'.
Inserting `luaotfload.harf.finalize_unicode' at position 1 in `finish_pdffile'.
Inserting `luaotfload.glyphinfo' at position 1 in `glyph_info'.
Lua-only attribute luaotfload.letterspace_done = 3
Inserting `luaotfload.aux.set_sscale_dimens' at position 1 in `luaotfload.patch_font'.
Inserting `luaotfload.aux.set_font_index' at position 2 in `luaotfload.patch_font'.
Inserting `luaotfload.aux.patch_cambria_domh' at position 3 in `luaotfload.patch_font'.
Inserting `luaotfload.aux.fixup_fontdata' at position 1 in `luaotfload.patch_font_unsafe'.
Inserting `luaotfload.aux.set_capheight' at position 4 in `luaotfload.patch_font'.
Inserting `luaotfload.aux.set_xheight' at position 5 in `luaotfload.patch_font'.
Inserting `luaotfload.rewrite_fontname' at position 6 in `luaotfload.patch_font'. L3 programming layer <2022-05-04>
Inserting `tracingstacklevels' at position 1 in `input_level_string'. (/usr/local/texlive/2022/texmf-dist/tex/latex/base/article.cls
Document Class: article 2021/10/04 v1.4n Standard LaTeX document class
(/usr/local/texlive/2022/texmf-dist/tex/latex/base/size10.clo
File: size10.clo 2021/10/04 v1.4n Standard LaTeX file (size option)
luaotfload | db : Font names database loaded from /Users/<USER>/Library/texlive/2022/texmf-var/luatex-cache/generic/names/luaotfload-names.luc.gz)
\c@part=\count183
\c@section=\count184
\c@subsection=\count185
\c@subsubsection=\count186
\c@paragraph=\count187
\c@subparagraph=\count188
\c@figure=\count189
\c@table=\count190
\abovecaptionskip=\skip47
\belowcaptionskip=\skip48
\bibindent=\dimen137
) (/usr/local/texlive/2022/texmf-dist/tex/latex/fontspec/fontspec.sty (/usr/local/texlive/2022/texmf-dist/tex/latex/l3packages/xparse/xparse.sty (/usr/local/texlive/2022/texmf-dist/tex/latex/l3kernel/expl3.sty
Package: expl3 2022-05-04 L3 programming layer (loader)
 (/usr/local/texlive/2022/texmf-dist/tex/latex/l3backend/l3backend-luatex.def
File: l3backend-luatex.def 2022-04-20 L3 backend support: PDF output (LuaTeX)
\l__color_backend_stack_int=\count191
\l__pdf_internal_box=\box50
))
Package: xparse 2022-01-12 L3 Experimental document command parser
)
Package: fontspec 2022/01/15 v2.8a Font selection for XeLaTeX and LuaLaTeX
Lua module: fontspec 2022/01/15 2.8a Font selection for XeLaTeX and LuaLaTeX (/usr/local/texlive/2022/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty
Package: fontspec-luatex 2022/01/15 v2.8a Font selection for XeLaTeX and LuaLaTeX
\l__fontspec_script_int=\count192
\l__fontspec_language_int=\count193
\l__fontspec_strnum_int=\count194
\l__fontspec_tmp_int=\count195
\l__fontspec_tmpa_int=\count196
\l__fontspec_tmpb_int=\count197
\l__fontspec_tmpc_int=\count198
\l__fontspec_em_int=\count199
\l__fontspec_emdef_int=\count266
\l__fontspec_strong_int=\count267
\l__fontspec_strongdef_int=\count268
\l__fontspec_tmpa_dim=\dimen138
\l__fontspec_tmpb_dim=\dimen139
\l__fontspec_tmpc_dim=\dimen140
 (/usr/local/texlive/2022/texmf-dist/tex/latex/base/fontenc.sty
Package: fontenc 2021/04/29 v2.0v Standard LaTeX package
) (/usr/local/texlive/2022/texmf-dist/tex/latex/fontspec/fontspec.cfg)))

./test.tex:11: Package fontspec Error: The font "Rubik-Regular" cannot be found.

For immediate help type H <return>.
 ...

l.11 ]


A font might not be found for many reasons.
 Check the spelling, where the font is installed etc. etc.

 When in doubt, ask someone for help!


luaotfload | aux : no font with id 0
luaotfload | aux : no font with id 0

./test.tex:11: Package fontspec Error: The font "Rubik-Regular" cannot be found.

For immediate help type H <return>.
 ...

l.11 ]


A font might not be found for many reasons.
 Check the spelling, where the font is installed etc. etc.

 When in doubt, ask someone for help!



./test.tex:11: Package fontspec Error: The font "Rubik-Regular" cannot be found.

For immediate help type H <return>.
 ...

l.11 ]


A font might not be found for many reasons.
 Check the spelling, where the font is installed etc. etc.

 When in doubt, ask someone for help!



Package fontspec Info: Font family 'Rubik-Regular.ttf(0)' created for font
(fontspec)             'Rubik-Regular.ttf' with options [Ligatures=TeX,Path =
(fontspec)             /Users/<USER>/Library/Fonts/].
(fontspec)
(fontspec)              This font family consists of the following NFSS
(fontspec)             series/shapes:
(fontspec)
(fontspec)             - 'normal' (m/n) with NFSS spec.:
(fontspec)             <->"[/Users/<USER>/Library/Fonts/Rubik-Regular.ttf]:mode=node;language=dflt;+tlig;"
(fontspec)             - 'small caps'  (m/sc) with NFSS spec.:

(./build/test.aux)
\openout1 = test.aux

LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 13.
LaTeX Font Info:    ... okay on input line 13.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 13.
LaTeX Font Info:    ... okay on input line 13.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 13.
LaTeX Font Info:    ... okay on input line 13.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 13.
LaTeX Font Info:    ... okay on input line 13.
LaTeX Font Info:    Checking defaults for TS1/cmr/m/n on input line 13.
LaTeX Font Info:    Trying to load font information for TS1+cmr on input line 13.
 (/usr/local/texlive/2022/texmf-dist/tex/latex/base/ts1cmr.fd
File: ts1cmr.fd 2019/12/16 v2.5j Standard LaTeX font definitions
)
LaTeX Font Info:    ... okay on input line 13.
LaTeX Font Info:    Checking defaults for TU/lmr/m/n on input line 13.
LaTeX Font Info:    ... okay on input line 13.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 13.
LaTeX Font Info:    ... okay on input line 13.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 13.
LaTeX Font Info:    ... okay on input line 13.

Package fontspec Info: Adjusting the maths setup (use [no-math] to avoid
(fontspec)             this).

\symlegacymaths=\mathgroup4
LaTeX Font Info:    Overwriting symbol font `legacymaths' in version `bold'
(Font)                  OT1/cmr/m/n --> OT1/cmr/bx/n on input line 13.
LaTeX Font Info:    Redeclaring math accent \acute on input line 13.
LaTeX Font Info:    Redeclaring math accent \grave on input line 13.
LaTeX Font Info:    Redeclaring math accent \ddot on input line 13.
LaTeX Font Info:    Redeclaring math accent \tilde on input line 13.
LaTeX Font Info:    Redeclaring math accent \bar on input line 13.
LaTeX Font Info:    Redeclaring math accent \breve on input line 13.
LaTeX Font Info:    Redeclaring math accent \check on input line 13.
LaTeX Font Info:    Redeclaring math accent \hat on input line 13.
LaTeX Font Info:    Redeclaring math accent \dot on input line 13.
LaTeX Font Info:    Redeclaring math accent \mathring on input line 13.
LaTeX Font Info:    Redeclaring math symbol \colon on input line 13.
LaTeX Font Info:    Redeclaring math symbol \Gamma on input line 13.
LaTeX Font Info:    Redeclaring math symbol \Delta on input line 13.
LaTeX Font Info:    Redeclaring math symbol \Theta on input line 13.
LaTeX Font Info:    Redeclaring math symbol \Lambda on input line 13.
LaTeX Font Info:    Redeclaring math symbol \Xi on input line 13.
LaTeX Font Info:    Redeclaring math symbol \Pi on input line 13.
LaTeX Font Info:    Redeclaring math symbol \Sigma on input line 13.
LaTeX Font Info:    Redeclaring math symbol \Upsilon on input line 13.
LaTeX Font Info:    Redeclaring math symbol \Phi on input line 13.
LaTeX Font Info:    Redeclaring math symbol \Psi on input line 13.
LaTeX Font Info:    Redeclaring math symbol \Omega on input line 13.
LaTeX Font Info:    Redeclaring math symbol \mathdollar on input line 13.
LaTeX Font Info:    Redeclaring symbol font `operators' on input line 13.
LaTeX Font Info:    Encoding `OT1' has changed to `TU' for symbol font
(Font)              `operators' in the math version `normal' on input line 13.
LaTeX Font Info:    Overwriting symbol font `operators' in version `normal'
(Font)                  OT1/cmr/m/n --> TU/lmr/m/n on input line 13.
LaTeX Font Info:    Encoding `OT1' has changed to `TU' for symbol font
(Font)              `operators' in the math version `bold' on input line 13.
LaTeX Font Info:    Overwriting symbol font `operators' in version `bold'
(Font)                  OT1/cmr/bx/n --> TU/lmr/m/n on input line 13.
LaTeX Font Info:    Overwriting symbol font `operators' in version `normal'
(Font)                  TU/lmr/m/n --> TU/lmr/m/n on input line 13.
LaTeX Font Info:    Overwriting math alphabet `\mathit' in version `normal'
(Font)                  OT1/cmr/m/it --> TU/lmr/m/it on input line 13.
LaTeX Font Info:    Overwriting math alphabet `\mathbf' in version `normal'
(Font)                  OT1/cmr/bx/n --> TU/lmr/b/n on input line 13.
LaTeX Font Info:    Overwriting math alphabet `\mathsf' in version `normal'
(Font)                  OT1/cmss/m/n --> TU/Rubik-Regular.ttf(0)/m/n on input line 13.
LaTeX Font Info:    Overwriting math alphabet `\mathtt' in version `normal'
(Font)                  OT1/cmtt/m/n --> TU/lmtt/m/n on input line 13.
LaTeX Font Info:    Overwriting symbol font `operators' in version `bold'
(Font)                  TU/lmr/m/n --> TU/lmr/b/n on input line 13.
LaTeX Font Info:    Overwriting math alphabet `\mathit' in version `bold'
(Font)                  OT1/cmr/bx/it --> TU/lmr/b/it on input line 13.
LaTeX Font Info:    Overwriting math alphabet `\mathsf' in version `bold'
(Font)                  OT1/cmss/bx/n --> TU/Rubik-Regular.ttf(0)/b/n on input line 13.
LaTeX Font Info:    Overwriting math alphabet `\mathtt' in version `bold'
(Font)                  OT1/cmtt/m/n --> TU/lmtt/b/n on input line 13.
 [1

{/usr/local/texlive/2022/texmf-var/fonts/map/pdftex/updmap/pdftex.map}] (./build/test.aux))

Here is how much of LuaTeX's memory you used:
 2798 strings out of 477742
 100000,552014 words of node,token memory allocated
 406 words of node memory still in use:
   3 hlist, 1 vlist, 1 rule, 2 glue, 3 kern, 1 glyph, 4 attribute, 48 glue_spec, 4 attribute_list, 1 write nodes
   avail lists: 2:23,3:4,4:1,5:23,6:2,7:46,9:18,11:2
 23571 multiletter control sequences out of 65536+600000
 16 fonts using 856399 bytes
 72i,5n,79p,237b,243s stack positions out of 10000i,1000n,20000p,200000b,200000s
</usr/local/texlive/2022/texmf-dist/fonts/opentype/public/lm/lmroman10-regular.otf>
Output written on test.pdf (1 page, 3288 bytes).

PDF statistics: 15 PDF objects out of 1000 (max. 8388607)
 8 compressed objects within 1 object stream
 0 named destinations out of 1000 (max. 131072)
 1 words of extra memory for PDF output out of 10000 (max. 100000000)
0

1 Answer 1

6

The font triggers a bug in the Node fontloader due to some unusual tables. This will be fixed in the next luaotfload version, until then you can use it by specifying Renderer=HarfBuzz to use the unaffected HarfBuzz based fontloader:

\documentclass{article}

\usepackage{fontspec}
\setsansfont{Rubik}[
    Renderer = HarfBuzz,
]

\begin{document}

\textsf{Test.}

\end{document}

enter image description here

If you are wondering why the error message says "The font "Rubik-Regular" cannot be found.": The font loading in LuaTeX basically either succeeds or it fails, it doesn't communicate why it failed. Since a not found font is by far the most common cause for being unable to load a font that's what the error message sais, but actually it just indicates that "something" went wrong.

2
  • Thank you so much for your answer! This should probably be a separate question, but do you know if the missing luaotfload scripts indicate that something’s wrong with my installation, and if so how I might remedy that?
    – steve
    May 29 at 13:41
  • @steve No, they don't matter at all. The only issue is that they probably shouldn't be reported as missing. (The are only needed during development, so there's no reason to have them installed on a user system) May 29 at 13:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.