BHOSC / BUAAthesis

北航毕设论文LaTeX模板
Other
1.02k stars 289 forks source link

can't show cn-zh fonts correctly on macOS Monterey 12.1 #305

Closed raykr closed 2 years ago

sighingnow commented 2 years ago

Have you installed the required fonts correctly?

raykr commented 2 years ago

Yes, I think there are all need fonts on my macos.

current env

macOS Monterey 12.1 MacTex2021 VSCode with LaTex Workshop plugin

issue

When I compile sample-master.tex by xelatex, but error, there's 9+ errors, just like Package fontspec: The font "SimHei" cannot be found., Font TU/SimHei(0)/b/n/10.53937=SimHei/OT:embolden=2.17; at 10.53937pt not loadable: Metric (TFM) file or installed font not found., Font shapeU/rsfs/m/n' in size <22.3999> not available` and so on.

figure

image Can you help me?

raykr commented 2 years ago

I test it in a new test.tex by \documentclass{ctexart} and type Chinese words, run well. image

raykr commented 2 years ago

I change'd two lines of buaathesis.cls like this, then it work.

\setCJKfamilyfont{songti}[AutoFakeBold = {2.17}]{STSongti-SC-Regular}
\setCJKfamilyfont{heiti}[AutoFakeBold = {2.17}]{STHeitiSC-Light}

Maybe caused by different os has different font name. On Windows it named SimSun, but STSongti-SC-Regular on macOS.

So you guys should consider how to fix this problem between different os, especially macOS.

Thanks!

huxuan commented 2 years ago

@RayKr Could you help to try whether removing those \setCJKfamilyfont commands helps to resolve the problem?

I suppose it might be better to follow the usage of ctex toolkit [1][2] rather than those old hackings.

[1] https://github.com/CTeX-org/ctex-kit [2] https://ctan.org/tex-archive/language/chinese/ctex

raykr commented 2 years ago

Removing those two \setCJKfamilyfont lines , it also worked, but it lost the bold style.

huxuan commented 2 years ago

Removing those two \setCJKfamilyfont lines , it also worked, but it lost the bold style.

Please try to add AutoFakeBold in the documentclass options as mentioned here [1]

[1] https://zhuanlan.zhihu.com/p/111368138 (the last part)

sighingnow commented 2 years ago

Yes, I think there are all need fonts on my macos.

current env

macOS Monterey 12.1 MacTex2021 VSCode with LaTex Workshop plugin

issue

When I compile sample-master.tex by xelatex, but error, there's 9+ errors, just like Package fontspec: The font "SimHei" cannot be found., Font TU/SimHei(0)/b/n/10.53937=SimHei/OT:embolden=2.17; at 10.53937pt not loadable: Metric (TFM) file or installed font not found., Font shapeU/rsfs/m/n' in size <22.3999> not available` and so on.

Hi @RayKr 对于Mac上这个报错,按照 #307 安装SimSun和SimHei这两个字体之后可以解决。

raykr commented 2 years ago

Yes, I think there are all need fonts on my macos.

current env

macOS Monterey 12.1 MacTex2021 VSCode with LaTex Workshop plugin

issue

When I compile sample-master.tex by xelatex, but error, there's 9+ errors, just like Package fontspec: The font "SimHei" cannot be found., Font TU/SimHei(0)/b/n/10.53937=SimHei/OT:embolden=2.17; at 10.53937pt not loadable: Metric (TFM) file or installed font not found., Font shapeU/rsfs/m/n' in size <22.3999> not available` and so on.

Hi @RayKr 对于Mac上这个报错,按照 #307 安装SimSun和SimHei这两个字体之后可以解决。

Thanks, it's work!