Skip to content

Instantly share code, notes, and snippets.

@cld4h
Created February 8, 2023 13:33
Show Gist options
  • Save cld4h/ac49acb98c9260aa29d8c5708144cd6f to your computer and use it in GitHub Desktop.
Save cld4h/ac49acb98c9260aa29d8c5708144cd6f to your computer and use it in GitHub Desktop.
LaTeX: Print out all fonts! 字体样式清单!
% !TeX TS-program = xelatex
\documentclass[UTF8]{article}
\usepackage[UTF8]{ctex}
\usepackage{times}
\usepackage{pgffor}
\usepackage{fontspec}
\newcommand{\testphrase}{The quick brown fox jumps over the lazy dog.}
\newcommand{\testCNphrase}{鷙鷹隼鵰鷲鳶鵟鷂鴞鵂鶹魚鷹蛇鷲禿鷲碁奂奒奓奘奙奚奛奜奝奞奟奡奣奤奦奨奁奫妸奯奰奱奲}
\setCJKfamilyfont{fzst}{FZShuTi}%方正舒体
\setCJKfamilyfont{fzyt}{FZYaoTi}%方正姚体
\setCJKfamilyfont{ipaexm}{IPAexMincho}%IPAex明朝,
\setCJKfamilyfont{lishu}{LiSu}%LiSu,隶书,
\setCJKfamilyfont{srchansans}{Source Han Sans CN}%思源黑体,
\setCJKfamilyfont{srchanserif}{Source Han Serif CN}%思源黑体,
\setCJKfamilyfont{hwcy}{STCaiyun}%华文彩云,
\setCJKfamilyfont{hwfs}{STFangsong}%华文仿宋,
\setCJKfamilyfont{hwhp}{STHupo}%华文琥珀,
\setCJKfamilyfont{hwkt}{STKaiti}%华文楷体,
\setCJKfamilyfont{hwls}{STLiti}%华文隶书,
\setCJKfamilyfont{hwst}{STSong}%华文宋体,
\setCJKfamilyfont{hwxh}{STXihei}%华文细黑,
\setCJKfamilyfont{hwxk}{STXingkai}%华文行楷,
\setCJKfamilyfont{hwxw}{STXinwei}%华文新魏,
\setCJKfamilyfont{hwzs}{STZhongsong}%华文中宋,
\setCJKfamilyfont{youyuan}{YouYuan}%幼圆
% Source Han Sans CN ExtraLight,
% Source Han Sans CN Heavy,
% Source Han Sans CN Light,
% Source Han Sans CN Medium,
% Source Han Sans CN Normal,
% Source Han Serif CN ExtraLight,
% Source Han Serif CN Heavy,
% Source Han Serif CN Light,
% Source Han Serif CN Medium,
% Source Han Serif CN SemiBold,
\begin{document}
Default font: Times New Roman
\foreach \x in {
Arial,
Arial Narrow,
Book Antiqua,
Bookman Old Style,
Century,
Century Gothic,
D050000L,
DejaVu Sans Mono,
Dubai,
Dubai,Dubai Light,
Dubai,Dubai Medium,
FreeMono,
FreeSans,
FreeSerif,
FZShuTi,方正舒体,
FZYaoTi,方正姚体,
Garamond,
IPAexMincho,IPAex明朝,
Liberation Mono,
Liberation Sans,
Liberation Serif,
Linux Biolinum,
Linux Biolinum Keyboard,
Linux Biolinum Keyboard O,
Linux Biolinum O,
Linux Libertine,
Linux Libertine Display,
Linux Libertine Display O,
Linux Libertine Mono,
Linux Libertine Mono O,
Linux Libertine O,
LiSu,隶书,
Monotype Corsiva,
MS Reference Sans Serif,
Nimbus Mono PS,
Nimbus Roman,
Nimbus Sans,
Nimbus Sans Narrow,
Noto Sans,
Noto Sans Math,
Noto Sans Mono,
Noto Sans Mono,Noto Sans Mono Black,
Noto Sans Mono,Noto Sans Mono Light,
Noto Sans Mono,Noto Sans Mono Medium,
Noto Sans Mono,Noto Sans Mono Thin,
Noto Sans,Noto Sans Black,
Noto Sans,Noto Sans Light,
Noto Sans,Noto Sans Medium,
Noto Sans,Noto Sans Thin,
Noto Serif,
Noto Serif Display,
Noto Serif Display,Noto Serif Display Black,
Noto Serif Display,Noto Serif Display Light,
Noto Serif Display,Noto Serif Display Medium,
Noto Serif Display,Noto Serif Display Thin,
Noto Serif Tangut,
Noto Serif,Noto Serif Black,
Noto Serif,Noto Serif Light,
Noto Serif,Noto Serif Medium,
Noto Serif,Noto Serif Thin,
P052,
Source Code Pro,
Source Code Pro Black,
Source Code Pro ExtraLight,
Source Code Pro Light,
Source Code Pro Medium,
Source Code Pro Semibold,
Source Han Sans CN,
Source Han Sans CN ExtraLight,
Source Han Sans CN Heavy,
Source Han Sans CN Light,
Source Han Sans CN Medium,
Source Han Sans CN Normal,
Source Han Serif CN,
Source Han Serif CN ExtraLight,
Source Han Serif CN Heavy,
Source Han Serif CN Light,
Source Han Serif CN Medium,
Source Han Serif CN SemiBold,
Standard Symbols PS,
STCaiyun,华文彩云,
STFangsong,华文仿宋,
STHupo,华文琥珀,
STKaiti,华文楷体,
STLiti,华文隶书,
STSong,华文宋体,
STXihei,华文细黑,
STXingkai,华文行楷,
STXinwei,华文新魏,
STZhongsong,华文中宋,
URW Bookman,
URW Gothic,
YouYuan,幼圆,
Z003}{
\section{\x}
\begingroup
\setmainfont{\x}
\testphrase
\endgroup
}
\newpage
\testCNphrase\\
{\songti ctex定义好的宋体:\testCNphrase}\\
{\kaishu ctex定义好的楷体:\testCNphrase}\\
{\heiti ctex定义好的黑体:\testCNphrase}\\
{\fangsong ctex定义好的仿宋:\testCNphrase}\\
{\CJKfamily{srchanserif}思源宋体: \testCNphrase}\\
{\CJKfamily{srchansans}思源黑体: \testCNphrase}\\
{\CJKfamily{fzst}方正舒体: \testCNphrase}\\
{\CJKfamily{fzyt}方正姚体: \testCNphrase}\\
{\CJKfamily{ipaexm}IPAex明朝: \testCNphrase}\\
{\CJKfamily{lishu}隶书: \testCNphrase}\\
{\CJKfamily{hwcy}华文彩云: \testCNphrase}\\
{\CJKfamily{hwfs}华文仿宋: \testCNphrase}\\
{\CJKfamily{hwhp}华文琥珀: \testCNphrase}\\
{\CJKfamily{hwkt}华文楷体: \testCNphrase}\\
{\CJKfamily{hwls}华文隶书: \testCNphrase}\\
{\CJKfamily{hwst}华文宋体: \testCNphrase}\\
{\CJKfamily{hwxh}华文细黑: \testCNphrase}\\
{\CJKfamily{hwxk}华文行楷: \testCNphrase}\\
{\CJKfamily{hwxw}华文新魏: \testCNphrase}\\
{\CJKfamily{hwzs}华文中宋: \testCNphrase}\\
{\CJKfamily{youyuan}幼圆: \testCNphrase}\\
\end{document}
%OR fc-list :lang=zh
% Arial,Arial Narrow
% Book Antiqua
% Bookman Old Style
% Bookshelf Symbol 7
% C059
% Cantarell
% Century
% Century Gothic
% D050000L
% DejaVu Sans Mono
% Dubai
% Dubai,Dubai Light
% Dubai,Dubai Medium
% FreeMono
% FreeSans
% FreeSerif
% FZShuTi,方正舒体
% FZYaoTi,方正姚体
% Garamond
% IPAexMincho,IPAex明朝
% Liberation Mono
% Liberation Sans
% Liberation Serif
% Linux Biolinum
% Linux Biolinum Keyboard
% Linux Biolinum Keyboard O
% Linux Biolinum O
% Linux Libertine
% Linux Libertine Display
% Linux Libertine Display O
% Linux Libertine Initials
% Linux Libertine Initials O
% Linux Libertine Mono
% Linux Libertine Mono O
% Linux Libertine O
% LiSu,隶书
% Monotype Corsiva
% MS Reference Sans Serif
% MS Reference Specialty
% Nimbus Mono PS
% Nimbus Roman
% Nimbus Sans
% Nimbus Sans Narrow
% Noto Sans
% Noto Sans Math
% Noto Sans Mono
% Noto Sans Mono,Noto Sans Mono Black
% Noto Sans Mono,Noto Sans Mono Light
% Noto Sans Mono,Noto Sans Mono Medium
% Noto Sans Mono,Noto Sans Mono Thin
% Noto Sans Symbols
% Noto Sans Symbols,Noto Sans Symbols Black
% Noto Sans Symbols,Noto Sans Symbols Light
% Noto Sans Symbols,Noto Sans Symbols Medium
% Noto Sans Symbols,Noto Sans Symbols Thin
% Noto Sans,Noto Sans Black
% Noto Sans,Noto Sans Light
% Noto Sans,Noto Sans Medium
% Noto Sans,Noto Sans Thin
% Noto Serif
% Noto Serif Display
% Noto Serif Display,Noto Serif Display Black
% Noto Serif Display,Noto Serif Display Light
% Noto Serif Display,Noto Serif Display Medium
% Noto Serif Display,Noto Serif Display Thin
% Noto Serif Tangut
% Noto Serif,Noto Serif Black
% Noto Serif,Noto Serif Light
% Noto Serif,Noto Serif Medium
% Noto Serif,Noto Serif Thin
% P052
% Source Code Pro
% Source Code Pro,Source Code Pro Black
% Source Code Pro,Source Code Pro ExtraLight
% Source Code Pro,Source Code Pro Light
% Source Code Pro,Source Code Pro Medium
% Source Code Pro,Source Code Pro Semibold
% Source Code Variable
% Source Han Sans CN,思源黑体 CN
% Source Han Sans CN,思源黑体 CN,Source Han Sans CN ExtraLight,思源黑体 CN
% ExtraLight
% Source Han Sans CN,思源黑体 CN,Source Han Sans CN Heavy,思源黑体 CN Heavy
% Source Han Sans CN,思源黑体 CN,Source Han Sans CN Light,思源黑体 CN Light
% Source Han Sans CN,思源黑体 CN,Source Han Sans CN Medium,思源黑体 CN Medium
% Source Han Sans CN,思源黑体 CN,Source Han Sans CN Normal,思源黑体 CN Normal
% Source Han Serif CN,思源宋体 CN
% Source Han Serif CN,思源宋体 CN,Source Han Serif CN ExtraLight,思源宋体 CN
% ExtraLight
% Source Han Serif CN,思源宋体 CN,Source Han Serif CN Heavy,思源宋体 CN Heavy
% Source Han Serif CN,思源宋体 CN,Source Han Serif CN Light,思源宋体 CN Light
% Source Han Serif CN,思源宋体 CN,Source Han Serif CN Medium,思源宋体 CN
% Medium
% Source Han Serif CN,思源宋体 CN,Source Han Serif CN SemiBold,思源宋体 CN
% SemiBold
% Standard Symbols PS
% STCaiyun,华文彩云
% STFangsong,华文仿宋
% STHupo,华文琥珀
% STKaiti,华文楷体
% STLiti,华文隶书
% STSong,华文宋体
% STXihei,华文细黑
% STXingkai,华文行楷
% STXinwei,华文新魏
% STZhongsong,华文中宋
% URW Bookman
% URW Gothic
% Wingdings 2
% Wingdings 3
% YouYuan,幼圆
% Z003
% MT Extra
%
% Building list of available fonts
% For this one can use `albatross`, a command line tool included in tex distributions like texlive. It is designed to find fonts which include certain glyphs, e.g. if you want to typeset a text in English, you can use something like
%
% albatross -b 3 T h e
%
%(replace T h e with whatever glyphs your font should be able to typeset)
%This will give you a list of font names
% https://stackoverflow.com/questions/5109550/how-to-get-a-list-of-all-available-ttf-fonts-with-xetex
%
% fonts setup
% https://blog.csdn.net/xiazdong/article/details/8892070
%
% Fonts for Chinese that overleaf supports:
% https://www.cnblogs.com/wodedow/p/13845213.html
% https://cn.overleaf.com/learn/latex/Questions/Which_OTF_or_TTF_fonts_are_supported_via_fontspec%3F#Chinese
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment