I have a series of lectures using the same font settings and the same commands. One or two of these started not to compile on a certain computer. On two other computers I am using, in a directory environment which is guaranteed to be identical as the relevant locations are all contained in the same synchronised OneDrive folder, the same file compiles beautifully. Furthermore, on the same computer, other files using the same fonts and and the same settings and commands compile without problem.
Certain offending files, however, produce this error:
dvipdfmx:fatal: Invalid font: -1 (22)
No output PDF file written.
I am then advised to consult the xelatex.log
file, in which I can find such lines that may contain relevant information:
2021-09-29 10:00:16,680+0200 INFO xelatex - this process (11704) started by 'texstudio' with command line: xelatex.exe -synctex=1 -interaction=nonstopmode Waves-Optics-hu.tex
2021-09-29 10:00:16,683+0200 INFO xelatex - this is MiKTeX-XETEX 4.5.0 (0.999993) (MiKTeX 21.8)
2021-09-29 10:00:16,690+0200 INFO xelatex - allowing known shell commands
2021-09-29 10:00:22,626+0200 INFO xelatex - executing input pipe: extractbb "--version"
2021-09-29 10:00:22,626+0200 INFO xelatex.core - starting input pipe: extractbb "--version"
2021-09-29 10:00:22,627+0200 INFO xelatex.core - start process: C:\Windows\system32\cmd.exe /c "extractbb "--version""
2021-09-29 10:00:25,346+0200 INFO xelatex.core - start process: miktex-dvipdfmx.exe -q -E -o Waves-Optics-hu.pdf
2021-09-29 10:00:29,736+0200 FATAL xelatex.core - Invalid argument
2021-09-29 10:00:29,737+0200 FATAL xelatex.core - Function: fwrite
2021-09-29 10:00:29,737+0200 FATAL xelatex.core - Result: 22
2021-09-29 10:00:29,737+0200 FATAL xelatex.core - Data: <no data>
2021-09-29 10:00:29,737+0200 FATAL xelatex.core - Source: Libraries\MiKTeX\TeXAndFriends\include\miktex/C4P/C4P.h:646
2021-09-29 10:00:29,738+0200 FATAL xelatex - Invalid argument
2021-09-29 10:00:29,738+0200 FATAL xelatex - Info:
2021-09-29 10:00:29,738+0200 FATAL xelatex - Source: Libraries\MiKTeX\TeXAndFriends\include\miktex/C4P/C4P.h
2021-09-29 10:00:29,739+0200 FATAL xelatex - Line: 646
2021-09-29 10:00:29,742+0200 INFO xelatex - this process (11704) finishes with exit code 1
I have tried to research the problem, and found two hits that may be relevant:
- https://tug.org/pipermail/tex-live/2021-April/046700.html Well, I cannot claim I understand what they discuss here. I use MiKTeX, they refer to TexLive in a Linux environment. I could not locate any fontconfig files from which I could delete type1 lines, and to be honest, I dared not cleave round without understanding what I am doing. So even if it does contain the solution to my problem, I cannot proceed without further clarification.
- XeLaTeX - Invalid Font: -1 This does not seem to align with my case as I do not use Type 1 fonts but OpenType and TrueType ones.
Due to the nature of the problem (compiling on most computers, not compiling on one, so it must be environment-dependent), I cannot produce an MWE, sorry. My font selection commands are the following:
% Fontspec font settings:
\defaultfontfeatures{Ligatures=TeX}
\setmainfont{Minion Pro}[
Path = \FontsFolder/Minion Pro/,
Extension = .otf,
Scale = MatchLowercase,
UprightFont = MinionPro-Regular,
BoldFont = MinionPro-Bold,
ItalicFont = MinionPro-It,
BoldItalicFont = MinionPro-BoldIt,
SmallCapsFont = MinionPro-Regular]
\setsansfont{Open Sans}[
Path = \FontsFolder/open-sans/,
Extension = .ttf,
Scale = MatchLowercase,
UprightFont = OpenSans-Regular,
BoldFont = OpenSans-ExtraBold,
ItalicFont = OpenSans-Italic,
BoldItalicFont = OpenSans-ExtraBoldItalic]
Here \FontsFolder
is a path to a folder within OneDrive for business, which has uneliminable space in it (E:\OneDrive - Szegedi Tudományegyetem\Fonts
, to be specific). I used to have problems with that path until the latest MiKTeX updates, but since then, it seems to work correctly in all cases (with the probable exception of this one, if this is the problem).
Any help or suggestions are appreciated.
C:\Users\tethe\AppData\Roaming\MiKTeX\fontconfig\config
). There is a file calledlocalfonts.conf
. If I delete the line<dir>C:\Programs\MiKTeX\fonts\type1</dir>
from it, the offending file seems to compile. I just need to take care NOT to refresh font map files in MiKTeX console, as it seems to write back the deleted type 1 line.