You are not logged in.

#1 2020-08-13 12:26:39

newsboost
Member
Registered: 2016-07-24
Posts: 157

[SOLVED] [luatex/texlive]: fontspec Error: font "Arial" can't be found

Hi all,

I haven't used latex for some years and I see lualatex is the new kid in town, and it's already installed on my side (I think as part of texlive-most). I got a document that is being compiled using:

Latexmk: This is Latexmk, John Collins, 17 Apr. 2020, version: 4.69a.
Latexmk: applying rule 'pdflatex'...
Rule 'pdflatex': File changes, etc:
...
...
------------
Running 'lualatex --shell-escape  -recorder  "my_document.tex"'
------------
This is LuaHBTeX, Version 1.12.0 (TeX Live 2020/Arch Linux)
 system commands enabled.
...
LaTeX2e <2020-02-02> patch level 5
 L3 programming layer <2020-06-03> (./some_report.cls
Document Class: some_report 2014/09/23 v2.0 Custom SOME LaTeX document class
(/usr/share/texmf-dist/tex/latex/base/fleqn.clo)
(/usr/share/texmf-dist/tex/latex/base/size11.clo)
(/usr/share/texmf-dist/tex/generic/iftex/ifluatex.sty
(/usr/share/texmf-dist/tex/generic/iftex/iftex.sty))
(/usr/share/texmf-dist/tex/latex/fontspec/fontspec.sty
(/usr/share/texmf-dist/tex/latex/l3packages/xparse/xparse.sty
(/usr/share/texmf-dist/tex/latex/l3kernel/expl3.sty
(/usr/share/texmf-dist/tex/latex/l3backend/l3backend-pdfmode.def))
(/usr/share/texmf-dist/tex/latex/l3packages/xparse/xparse-generic.tex))
(/usr/share/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty
(/usr/share/texmf-dist/tex/latex/base/fontenc.sty)
(/usr/share/texmf-dist/tex/latex/fontspec/fontspec.cfg)))
luaotfload | db : Reload initiated (formats: otf,ttf,ttc); reason: "Font Arial not found.".
luaotfload | resolve : sequence of 3 lookups yielded nothing appropriate.

! Package fontspec Error: The font "Arial" cannot be found.

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

l.195 \newfontfamily
                  \sometitlepagefont{Tahoma}

I'm not allowed to share the document, but if needed, maybe I could make a minimal working document... I hope however we generally speaking maybe could solve it... I've tried to guess at which font package to install, e.g. "yay -S ttf-merge-one" and currently have both aur/urw-arial and extra/ttf-croscore installed + texlive-most. Not solved. Then I came across https://www.tug.org/fonts/getnonfreefonts/ and tried "texlua install-getnonfreefonts" and installing locally (to avoid possibly conflicts with package managers aur/pacman): "getnonfreefonts --user -a"... Still not working. Finally, the second-latest thing I tried was to follow https://wiki.archlinux.org/index.php/Microsoft_fonts and copy all fonts - but I still get the same error with the "Arial"-font... Last thing I tried was deleting ~/.texlive and run luatex again (it was slower, and wrote "luaotfload | db : Font names database not found, generating new one" + "luaotfload | db : This can take several minutes; please be patient" so I hoped this would work) - but also that failed...

Now I don't have any more ideas... I'm hoping there's a font/latex/luatex user who can/could guide me a bit and help solve this problem? I would be grateful for possible solutions/ideas, thanks...

Last edited by newsboost (2020-08-13 15:55:27)

Offline

#2 2020-08-13 12:38:06

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: [SOLVED] [luatex/texlive]: fontspec Error: font "Arial" can't be found

I use xelatex, not lualatex, but I believe they handle fonts similarly through fontspec: are you loading the fontspec package?  If so, it will depend on fontconfig for identifying fonts, right?  What does `fc-match Arial` return?


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#3 2020-08-13 14:14:57

newsboost
Member
Registered: 2016-07-24
Posts: 157

Re: [SOLVED] [luatex/texlive]: fontspec Error: font "Arial" can't be found

Trilby wrote:

I use xelatex, not lualatex, but I believe they handle fonts similarly through fontspec: are you loading the fontspec package?  If so, it will depend on fontconfig for identifying fonts, right?  What does `fc-match Arial` return?

The fontspec package is loaded via a .cls-file that the document uses:

\usepackage{fontspec}
\setmainfont{Calibri}
\newfontfamily\someheadingfont{Cambria}
\newfontfamily\someaddressfont{Arial}
\newfontfamily\sometitlepagefont{Tahoma}

It's weird, I don't know about the "fc-match"-command, but this is the output:

$ fc-match Arial
arial.ttf: "Arial" "Regular"

It seems incorrect, when the font fails to load, based on this? But I don't know enough about how these things works - appreciate your help, thanks!

Offline

#4 2020-08-13 14:24:50

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: [SOLVED] [luatex/texlive]: fontspec Error: font "Arial" can't be found

Out of curiosity, can you try xelatex and post the errors it produces if it still fails.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#5 2020-08-13 14:47:16

newsboost
Member
Registered: 2016-07-24
Posts: 157

Re: [SOLVED] [luatex/texlive]: fontspec Error: font "Arial" can't be found

Trilby wrote:

Out of curiosity, can you try xelatex and post the errors it produces if it still fails.

Yeah, no problem, that also won't work:

(/usr/share/texmf-dist/tex/latex/base/fleqn.clo)
(/usr/share/texmf-dist/tex/latex/base/size11.clo)
(/usr/share/texmf-dist/tex/generic/iftex/ifluatex.sty
(/usr/share/texmf-dist/tex/generic/iftex/iftex.sty))

! Must be compiled with lualatex. Or even better: 'latexmk -lualatex main.tex' 
.

\par 
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.202 \fi
         
? q
OK, entering \batchmode%                                                 

I don't understand how that font-stuff works... Any ideas? I would be happy to try :-)

Offline

#6 2020-08-13 14:56:47

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,330
Website

Re: [SOLVED] [luatex/texlive]: fontspec Error: font "Arial" can't be found

Sorry, I guess your document has lualatex specifics.  I'm not familiar with lualatex errors, so I was hoping to see if it'd replicate with xelatex - but there's a different error with that.  From what I know of it, lualatex *should* use font-config to get system fonts, and as fc-match finds Arial, lualatex should as well - so I'm not sure why it's failing.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#7 2020-08-13 15:05:01

newsboost
Member
Registered: 2016-07-24
Posts: 157

Re: [SOLVED] [luatex/texlive]: fontspec Error: font "Arial" can't be found

Yeah, ok... Thanks a lot for the suggestions anyway,luatex is also new to me! :-)

UPDATE: Oh, figured it out after spending TOO MANY HOURS looking the wrong places... I used fonts from here: https://wiki.archlinux.org/index.php/Microsoft_fonts - the instructions tells to "chmod 644 /usr/share/fonts/WindowsFonts/*". I didn't think too much about it. When rebuilding font cache as root, there are no problems. But for things to work as a normal user, I had to do................ (so simple, as root)...

chmod +x /usr/share/fonts/WindowsFonts

So the directory was missing the executable permission (I began noticing something about permissions)... Damn... Thanks again for the help, I'm happy it works now! :-)

Last edited by newsboost (2020-08-13 15:54:15)

Offline

#8 2020-08-13 15:36:27

progandy
Member
Registered: 2012-05-17
Posts: 5,259

Re: [SOLVED] [luatex/texlive]: fontspec Error: font "Arial" can't be found

You can try to update the luatex font database and look at which font files are scanned with

luaotfload-tool -uvvvv >fontdbupdates.log

The fonts currently in the database can be listed with

luaotfload-tool --list=format

Last edited by progandy (2020-08-13 15:43:21)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Online

#9 2020-08-13 15:57:49

newsboost
Member
Registered: 2016-07-24
Posts: 157

Re: [SOLVED] [luatex/texlive]: fontspec Error: font "Arial" can't be found

Thanks progandy, I didn't knew these commands - but I was also looking for something like those commands... Now I also know these commands, if something similar happens in the future...

Last edited by newsboost (2020-08-13 15:58:17)

Offline

Board footer

Powered by FluxBB