추가 정보

추가 정보

저는 다음 두 가지 글꼴을 다운로드했습니다.

나는 실행 fc-cache -f -v하므로 fc-list해당 글꼴을 알고 있습니다.

fc-list | grep '\.fonts' | grep 'NotoSansMonoCJKsc'
/home/rodrigo/.fonts/NotoSansMonoCJKsc-VF.otf: Noto Sans Mono CJK SC:style=Medium
/home/rodrigo/.fonts/NotoSansMonoCJKsc-Regular.otf: Noto Sans Mono CJK SC:style=Regular
/home/rodrigo/.fonts/NotoSansMonoCJKsc-VF.otf: Noto Sans Mono CJK SC
/home/rodrigo/.fonts/NotoSansMonoCJKsc-VF.otf: Noto Sans Mono CJK SC:style=Bold
/home/rodrigo/.fonts/NotoSansMonoCJKsc-VF.otf: Noto Sans Mono CJK SC:style=Regular

를 사용하면 NotoSansMonoCJKsc-Regular.otf문서가 문제 없이 컴파일됩니다.

\documentclass{article}

\usepackage{xeCJK}

\setCJKmainfont[
  Path = {\string~/.fonts/},
  Extension = .otf
]{NotoSansMonoCJKsc-Regular}

\begin{document}
  你好!
\end{document}
xelatex /tmp/main.tex
This is XeTeX, Version 3.141592653-2.6-0.999996 (TeX Live 2024) (preloaded format=xelatex)
 restricted \write18 enabled.
entering extended mode
(/tmp/main.tex
LaTeX2e <2023-11-01> patch level 1
L3 programming layer <2024-03-14>
(/usr/local/texlive/2024/texmf-dist/tex/latex/base/article.cls
Document Class: article 2023/05/17 v1.4n Standard LaTeX document class
(/usr/local/texlive/2024/texmf-dist/tex/latex/base/size10.clo))
(/usr/local/texlive/2024/texmf-dist/tex/xelatex/xecjk/xeCJK.sty
(/usr/local/texlive/2024/texmf-dist/tex/latex/l3kernel/expl3.sty
(/usr/local/texlive/2024/texmf-dist/tex/latex/l3backend/l3backend-xetex.def))
(/usr/local/texlive/2024/texmf-dist/tex/latex/ctex/ctexhook.sty)
(/usr/local/texlive/2024/texmf-dist/tex/latex/l3packages/xtemplate/xtemplate.st
y
(/usr/local/texlive/2024/texmf-dist/tex/latex/l3packages/xtemplate/xtemplate-20
23-10-10.sty))
(/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/fontspec/fontspec-xetex.sty
(/usr/local/texlive/2024/texmf-dist/tex/latex/base/fontenc.sty)
(/usr/local/texlive/2024/texmf-dist/tex/latex/fontspec/fontspec.cfg)))
(/usr/local/texlive/2024/texmf-dist/tex/xelatex/xecjk/xeCJK.cfg)) (./main.aux)
(/usr/local/texlive/2024/texmf-dist/tex/latex/base/ts1cmr.fd) [1] (./main.aux) 
)
Output written on main.pdf (1 page).
Transcript written on main.log.

그러나 NotoSansMonoCJKSC-VF.otf. file main.pdf may not be valid.다른 오류와 함께 메시지가 표시됩니다.

\documentclass{article}

\usepackage{xeCJK}

\setCJKmainfont[
  Path = {\string~/.fonts/},
  Extension = .otf
]{NotoSansMonoCJKsc-VF}

\begin{document}
  你好!
\end{document}
xelatex /tmp/main.tex
This is XeTeX, Version 3.141592653-2.6-0.999996 (TeX Live 2024) (preloaded format=xelatex)
 restricted \write18 enabled.
entering extended mode
(/tmp/main.tex
LaTeX2e <2023-11-01> patch level 1
L3 programming layer <2024-03-14>
(/usr/local/texlive/2024/texmf-dist/tex/latex/base/article.cls
Document Class: article 2023/05/17 v1.4n Standard LaTeX document class
(/usr/local/texlive/2024/texmf-dist/tex/latex/base/size10.clo))
(/usr/local/texlive/2024/texmf-dist/tex/xelatex/xecjk/xeCJK.sty
(/usr/local/texlive/2024/texmf-dist/tex/latex/l3kernel/expl3.sty
(/usr/local/texlive/2024/texmf-dist/tex/latex/l3backend/l3backend-xetex.def))
(/usr/local/texlive/2024/texmf-dist/tex/latex/ctex/ctexhook.sty)
(/usr/local/texlive/2024/texmf-dist/tex/latex/l3packages/xtemplate/xtemplate.st
y
(/usr/local/texlive/2024/texmf-dist/tex/latex/l3packages/xtemplate/xtemplate-20
23-10-10.sty))
(/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/fontspec/fontspec-xetex.sty
(/usr/local/texlive/2024/texmf-dist/tex/latex/base/fontenc.sty)
(/usr/local/texlive/2024/texmf-dist/tex/latex/fontspec/fontspec.cfg)))
(/usr/local/texlive/2024/texmf-dist/tex/xelatex/xecjk/xeCJK.cfg)) (./main.aux)
(/usr/local/texlive/2024/texmf-dist/tex/latex/base/ts1cmr.fd) [1] (./main.aux)
xdvipdfmx:fatal: Invalid font: -1 (0)

No output PDF file written.
 
)
Error 256 (driver return code) generating output;
file main.pdf may not be valid.
Transcript written on main.log.

xelatex아직 가변 글꼴을 지원하지 않기 때문에 이런 일이 발생하는 것 같습니다 .

가변 글꼴을 지원하는 경우 xelatex문서를 컴파일하려고 할 때 내 시스템에서 이러한 오류가 표시되는 이유를 누군가 말해 줄 수 있습니까?

가변 글꼴을 지원하지 않는 경우 xelatex누군가 이 내용이나 내가 결론을 내릴 수 있는 소스 코드의 일부를 설명하는 신뢰할 수 있는 소스를 제공할 수 있다면 감사하겠습니다.

추가 정보

VF파일 이름 의 의미를 모르는 사람들을 위해 설명하자면 NotoSansMonoCJKSC-VF"가변 글꼴"을 의미합니다.(위키피디아 기사 링크).

나는 찾았다이 문제.xelatex

아래 표시된 코드 블록은 xelatex위에 표시된 두 문서를 컴파일하는 데 사용한 의 버전을 보여줍니다.

xelatex --version
XeTeX 3.141592653-2.6-0.999996 (TeX Live 2024)
kpathsea version 6.4.0
Copyright 2024 SIL International, Jonathan Kew and Khaled Hosny.
There is NO warranty.  Redistribution of this software is
covered by the terms of both the XeTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the XeTeX source.
Primary author of XeTeX: Jonathan Kew.
Compiled with ICU version 74.2; using 74.2
Compiled with zlib version 1.3.1; using 1.3.1
Compiled with FreeType2 version 2.13.2; using 2.13.2
Compiled with Graphite2 version 1.3.14; using 1.3.14
Compiled with HarfBuzz version 8.3.0; using 8.3.0
Compiled with libpng version 1.6.43; using 1.6.43
Compiled with pplib version v2.2
Compiled with fontconfig version 2.13.0; using 2.13.1

답변1

문서를 읽어보면 fontspecLuaLaTeX만이 가변 글꼴을 지원하는 것으로 보입니다. fontspec최근 버전 2.9a에 이에 대한 지원이 추가되었습니다.

답변2

문서에 따르면 현재는 fontspecXeTeX에서 다중 마스터 글꼴을 지원하지만 Variable은 지원하지 않는 반면, Variable은 LuaTeX에서 지원하지만 다중 마스터는 지원하지 않습니다.

fontspec.pdf섹션 7 32페이지:

현재 OpenType 가변 글꼴은 LuaTeX에서만 지원되는 반면 다중 마스터 글꼴은 XeTeX에서만 작동합니다.

fontspec2024/02/13 v2.9a

현재 CTAN에 있는 버전입니다 fontspec(2024-04-27).

관련 정보