Using the LaTeX, font configuration is often a headache when dealing with Chinese documents. When you get a Chinese LaTeX template, using XeLaTeX to compile it often gets some error about the lack of specific fonts, such as the lack of Source Han Serif CN font.
To download free commercial fonts and use them without installing, it is my solution.
- Download Source Han, Founder, and other free commercial fonts. They are:
- Source Han Sans font library Adobe Fonts. The main free commercial fonts are
Source Han Serif
andSource Han Sans
. - Founder Type official website Founder Type. The main free commercial fonts are
Founder Song
,Founder Kai
,Founder Hei
andFounder Fang Song
. - Wenyuan font WenYuanFonts. This is newly released at the end of 2024, based on the Source Han font for secondary development, making it more suitable for use in simplified Chinese scenarios and simplified Chinese TeX typesetting fields. It is open source and free for commercial use. The main font is
WenYuan Mincho
,WenYuan Gothic
,WenYuan Maru
.
- Source Han Sans font library Adobe Fonts. The main free commercial fonts are
- In the Latex source file, specify the font file path.
- Set
AutoFakeBold
andAutoFakeSlant
.
Here is an example of the font settings.
\documentclass[fontset=none]{ctexart} %Turn off the default font configuration in the ctex package
\setCJKmainfont[Path={font/},BoldFont={WenYuanGothic-Medium.ttf}, ItalicFont=FZKai-Z03.ttf]{WenYuanMincho-Regular.ttf}
\setCJKsansfont[Path={font/}]{WenYuanGothic-Regular.ttf}
\setCJKmonofont[Path={font/},AutoFakeBold, AutoFakeSlant]{WenYuanMaru-Medium.ttf}