CTeX-org / ctex-kit

Macro Packages and Scripts for Chinese TeX users
976 stars 124 forks source link

New Mac cannot find fonts Kaiti SC #540

Closed wenxingguo closed 3 years ago

wenxingguo commented 3 years ago
Full log This is XeTeX, Version 3.14159265-2.6-0.999992 (MiKTeX 20.6.29) entering extended mode (test.tex LaTeX2e <2020-02-02> patch level 5 L3 programming layer <2020-09-03> ("/Users/wood/Library/Application Support/MiKTeX/texmfs/install/tex/latex/base/ article.cls" Document Class: article 2019/12/20 v1.4l Standard LaTeX document class ("/Users/wood/Library/Application Support/MiKTeX/texmfs/install/tex/latex/base/ size10.clo")) ("/Users/wood/Library/Application Support/MiKTeX/texmfs/install/tex/latex/ctex/ ctex.sty" ("/Users/wood/Library/Application Support/MiKTeX/texmfs/install/tex/latex/l3ker nel/expl3.sty" ("/Users/wood/Library/Application Support/MiKTeX/texmfs/install/tex/latex/l3bac kend/l3backend-xetex.def")) ("/Users/wood/Library/Application Support/MiKTeX/texmfs/install/tex/latex/l3pac kages/xparse/xparse.sty" ("/Users/wood/Library/Application Support/MiKTeX/texmfs/install/tex/latex/l3pac kages/xparse/xparse-generic.tex")) ("/Users/wood/Library/Application Support/MiKTeX/texmfs/install/tex/latex/l3pac kages/l3keys2e/l3keys2e.sty") ("/Users/wood/Library/Application Support/MiKTeX/texmfs/install/tex/latex/ctex/ ctexhook.sty") ("/Users/wood/Library/Application Support/MiKTeX/texmfs/install/tex/latex/ctex/ ctexpatch.sty") ("/Users/wood/Library/Application Support/MiKTeX/texmfs/install/tex/latex/base/ fix-cm.sty" ("/Users/wood/Library/Application Support/MiKTeX/texmfs/install/tex/latex/base/ ts1enc.def")) ("/Users/wood/Library/Application Support/MiKTeX/texmfs/install/tex/latex/ms/ev erysel.sty") ("/Users/wood/Library/Application Support/MiKTeX/texmfs/install/tex/latex/ctex/ config/ctexopts.cfg") ("/Users/wood/Library/Application Support/MiKTeX/texmfs/install/tex/latex/ctex/ engine/ctex-engine-xetex.def" ("/Users/wood/Library/Application Support/MiKTeX/texmfs/install/tex/xelatex/xec jk/xeCJK.sty" ("/Users/wood/Library/Application Support/MiKTeX/texmfs/install/tex/latex/l3pac kages/xtemplate/xtemplate.sty") ("/Users/wood/Library/Application Support/MiKTeX/texmfs/install/tex/latex/fonts pec/fontspec.sty" ("/Users/wood/Library/Application Support/MiKTeX/texmfs/install/tex/latex/fonts pec/fontspec-xetex.sty" ("/Users/wood/Library/Application Support/MiKTeX/texmfs/install/tex/latex/base/ fontenc.sty") ("/Users/wood/Library/Application Support/MiKTeX/texmfs/install/tex/latex/fonts pec/fontspec.cfg"))) ("/Users/wood/Library/Application Support/MiKTeX/texmfs/install/tex/xelatex/xec jk/xeCJK.cfg"))) ("/Users/wood/Library/Application Support/MiKTeX/texmfs/install/tex/latex/zhnum ber/zhnumber.sty" ("/Users/wood/Library/Application Support/MiKTeX/texmfs/install/tex/latex/zhnum ber/zhnumber-utf8.cfg")) ("/Users/wood/Library/Application Support/MiKTeX/texmfs/install/tex/latex/ctex/ scheme/ctex-scheme-chinese.def" ("/Users/wood/Library/Application Support/MiKTeX/texmfs/install/tex/latex/ctex/ config/ctex-name-utf8.cfg")) ("/Users/wood/Library/Application Support/MiKTeX/texmfs/install/tex/latex/tools /indentfirst.sty") ("/Users/wood/Library/Application Support/MiKTeX/texmfs/install/tex/latex/ctex/ ctex-c5size.clo") ("/Users/wood/Library/Application Support/MiKTeX/texmfs/install/tex/latex/ctex/ fontset/ctex-fontset-mac.def" ("/Users/wood/Library/Application Support/MiKTeX/texmfs/install/tex/latex/ctex/ fontset/ctex-fontset-macnew.def"Running miktex-makemf... Running miktex-hbf2gf... Package fontspec Warning: Font "Songti SC Light" does not contain requested (fontspec) Script "CJK". ! Package fontspec Error: The font "Kaiti SC" cannot be found. For immediate help type H . ... l.99 } ? Running miktex-makemf... Running miktex-hbf2gf... ! Package fontspec Error: The font "Kaiti SC" cannot be found. For immediate help type H . ... l.99 } ? Running miktex-makemf... Running miktex-hbf2gf... ! Package fontspec Error: The font "Kaiti SC Bold" cannot be found. For immediate help type H . ... l.99 } ? Running miktex-makemf... Running miktex-hbf2gf... ! Package fontspec Error: The font "Kaiti SC Bold" cannot be found. For immediate help type H . ... l.99 } ? ))) ("/Users/wood/Library/Application Support/MiKTeX/texmfs/install/tex/latex/ctex/ config/ctex.cfg") (test.aux) ABD: EverySelectfont initializing macros [1] (test.aux) ) Output written on test.pdf (1 page). Transcript written on test.log.
muzimuzhi commented 3 years ago

Apart from the standard output, please provide a minimal working example (MWE), and the versions of both your macOS and installed ctex bundle.

wenxingguo commented 3 years ago

test.tex %%%%%%%%%%%%%%%%%%%%% \documentclass{article} \usepackage{ctex} \title{first tex article} \author{guowenxing} \begin{document} \maketitle 你好 \end{document} %%%%%%%%%%%%%%%%% macOS 10.15.6 MikTex with ctex 2.5.4

wenxingguo commented 3 years ago

font Kaiti.ttc can be found in /System/Library/AssetsV2/com_apple_MobileAsset_Font6/XXXXXXXXXXXXXX.asset/AssetData/Kaiti.ttc

Liam0205 commented 3 years ago

This is a known issue. The system detecting feature of CTeX fails in MikTeX, on both macOS & Linux.

Specifying fontset = mac solves this problem.

wenxingguo commented 3 years ago

It really does not work, but I solve this problem by moving the Kaiti.ttc to /Library/Fonts. It seems that the fc-list program cannot find fonts in non-standard path.

muzimuzhi commented 3 years ago

@wenxingguo Does running sudo tlmgr conf texmf OSFONTDIR /System/Library/AssetsV2/com_apple_MobileAsset_Font6 help?

wenxingguo commented 3 years ago

@wenxingguo Does running sudo tlmgr conf texmf OSFONTDIR /System/Library/AssetsV2/com_apple_MobileAsset_Font6 help?

Miktex manages packages through mpm, not tlmgr.

Liam0205 commented 3 years ago

It really does not work, but I solve this problem by moving the Kaiti.ttc to /Library/Fonts. It seems that the fc-list program cannot find fonts in non-standard path.

Well, specifying fontset = mac also relays on the broken mechanism, sorry for that.

Try fontset = macnew instead.

btstream commented 3 years ago

@wenxingguo Does running sudo tlmgr conf texmf OSFONTDIR /System/Library/AssetsV2/com_apple_MobileAsset_Font6 help?

Miktex manages packages through mpm, not tlmgr.

I use this method to make it work.

Edit ~/Library/Application Support/MiKTeX/texmfs/config/fontconfig/config/localfonts2.conf file, add /System/Library/AssetsV2/com_apple_MobileAsset_Font6 to it.

gaotongsh commented 3 years ago

I use this method to make it work.

Edit /Users/lzc/Library/Application Support/MiKTeX/texmfs/config/fontconfig/config/localfonts2.conf file, add /System/Library/AssetsV2/com_apple_MobileAsset_Font6 to it.

This also did the trick for me. I think we should add this to an FAQ or wiki page for all those MikTeX users on Mac.

talengu commented 2 years ago

macOS 12.0.1 Kaiti.ttc may in this path

/System/Library/AssetsV2/com_apple_MobileAsset_Font7

/Users/lzc/Library/Application Support/MiKTeX/texmfs/config/fontconfig/config/localfonts2.conf

<?xml version="1.0"?>
<fontconfig>
<dir>/System/Library/AssetsV2/com_apple_MobileAsset_Font7</dir>
</fontconfig>

Then work OK 😸 Thanks!

reisenmiao commented 2 years ago

open the Pages once. It will install Kaiti into you font library.

rami3l commented 1 year ago

@talengu This post seems to have found a better path for such fonts that seems to be consistent for longer:

<?xml version="1.0"?>
<fontconfig>
<dir>/System/Library/PrivateFrameworks/FontServices.framework/Resources/Fonts</dir>
</fontconfig>