Open Firestar-Reimu opened 7 months ago
I don't have the FZKai-Z03
font, so maybe that is causing your issue, but otherwise I can't reproduce this.
After initially building the caches I get further runs in 2.6 seconds. That's slow, but much faster than 44s and not primarily caused by luaotfload. This was tested with system fonts in Arch Linux.
Do you still have the issue also without FZKai-Z03
and can you send an example without ctex?
Please also attach your log file.
Sorry I changed the MWE so that no FZKai-Z03
is required. It is just Source Han's fault.
console output
https://paste.c-net.org/LaurieBeets log file
Another MWE using fontspec
\documentclass{article}
\usepackage{fontspec}
\setmainfont{Source Han Serif CN}[BoldFont=Source Han Sans CN Medium]
\title{\textbf{作业}}
\author{作业}
\date{\today}
\begin{document}
\maketitle
正文123
\end{document}
log: https://paste.c-net.org/ValidityTanaka
Time: 41s
Delete the [BoldFont]
section does not reduce time
Another question may be the same: https://tex.stackexchange.com/questions/75118/why-does-it-take-lualatex-so-long-to-load-fonts-and-can-i-speed-it-up which also use 30~40s to load a font.
mwe2.log I need 16s to produce the MWE on the question above
if its not a lipsum which I need 2 runs of lualatex
a abc123
MWE with Times need only 3s
You seem to be using ArchLinux, but your font is stored in /usr/share/fonts/SourceHanSerifCN-Regular.otf
(instead of Arch's default location /usr/share/fonts/adobe-source-han-serif/SourceHanSerifCN-Regular.otf
) Do both files exist on your system? Is the file you are using installed manually?
Both files exist on my system, one of them is installed manually from my USB drive (with a large collection of fonts), the other is installed by pacman.
I tried to delete the manually installed one, and use the pacman installed one to compile
The first time use ~6s, and after it the compile use ~1s
\documentclass{article}
\usepackage{fontspec}
\setmainfont{Source Han Serif CN}
\title{\textbf{作业}}
\author{作业}
\date{\today}
\begin{document}
\maketitle
正文1234
\end{document}
So what about other manually installed fonts? Do they have a recommended location other than /usr/share/fonts
?
Also I found that adobe source code pro
adobe source han sans
adobe source han serif
Noto Sans/Serif/Mono/Math
are also not in the default place (installed twice)
But for english fonts, the time shortage between default/manual installed font is not so obvious, which is both ~780ms
You shouldn't manually install files into system directories period. You could make packages yourself, which should declare conflicts
and/or provides
etc. so you don't get conflicting files installed. Font packages should also trigger the relevant post-installation hooks to ensure fontconfig updates the database. You can also install into e.g. /usr/local/share/fonts or into your personal fonts directory. See the files in /etc/fonts/ and the wiki for details. If you install into /usr/local/share/fonts, you need to update the fontconfig database yourself and you should still avoid conflicting files.
Issue maybe related to #49
Multiple tests see https://github.com/CTeX-org/ctex-kit/issues/708
in a simple mwe:
It take ~44s to compile and although luaotfload generate font cache, the next compile still need ~44s