Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

default bold and italic fonts in windows #695

Open
davidcarlisle opened this issue Feb 12, 2024 · 1 comment
Open

default bold and italic fonts in windows #695

davidcarlisle opened this issue Feb 12, 2024 · 1 comment

Comments

@davidcarlisle
Copy link

This issue is caused by looking at

https://tex.stackexchange.com/questions/709358/pdflatexfile-simsun-ttc-in-wsl2-cannot-open-truetype-font-file-for-reading

If you have fontset=windows then as far as I understand the code ctex-fontset-windows.def ends up checking if msyh.ttc exists and if it does, does this (with ttf or ttc)

\setCJKmainfont { simsun.ttc }
          [ BoldFont = simhei.ttf, ItalicFont = simkai.ttf 

However a default European Windows 10 or 11 just has simsun and simsunb and not simhei or simkai

This means that the example in the question works with pdflatex but with lualatex it fails

luaotfload | db : Reload initiated (formats: otf,ttf,ttc); reason: Font "KaiTi" not found.

and if you add \textbf it also fails in pdflatex

\documentclass[fontset=windows, UTF8]{article}
%\documentclass[fontset=fandol, UTF8]{article}
\usepackage{ctex}

\begin{document}


好 \textbf{好}
\end{document}

produces

!pdfTeX error: pdflatex (file simhei.ttf): cannot open TrueType font file for r
eading
 ==> Fatal error occurred, no output PDF file produced!

Would it be possible to add a test for these fonts and have no bold or different bold (is simsunb usable?) in that case rather than hitting these low level errors.

(Sorry for writing in English)

@muzimuzhi
Copy link
Contributor

Ah both Simkai.ttf and Simhei.ttf are part of the Chinese (Simplified) Supplemental Fonts. From this post Supplemental Font Packages can be installed through

Settings > Apps > Optional Features > Add a feature > Select the desired Supplemental Font Packages > Click install

but yes ctex can provide more helpful error messages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants