如何使用XeTeX获取所有可用(TTF-)字体的列表?

tow*_*owi 5 latex miktex truetype xetex

非常简洁,我可以使用MikTex和XeTeX在我的Windows机器上使用任何可用的Truetype字体.

%!TEX TS-program = xelatex
%!TEX encoding = UTF-8 Unicode
\documentclass[]{article}
\usepackage{xltxtra,fontspec,xunicode}
\defaultfontfeatures{Scale=MatchLowercase}
\title{Fonttest}   
\begin{document} 
  \section{Section Title} {
    \setromanfont{Palatino Linotype}
      The quick brown fox jumps over the lazy dog.
  }
  \section{Section Title} {
    \setromanfont{ProggyCleanTTSZBP}
      The quick brown fox jumps over the lazy dog.
  }
\end{document}
Run Code Online (Sandbox Code Playgroud)

有没有办法为每个可用的字体自动生成一个fotn测试页?这样我就不必手动为每个可用字体键入测试页面了吗?

实际上,我甚至不知道如何获得所需的长字体名称\setromanfont - 除了从屏幕输入它.Windows目录显然只列出文件名.也许这可以在TeX本身完成,但我可以使用Python脚本等管理它.

小智 5

fc-list  | cut -d\  -f2-99 | cut -d: -f1 | sort -u
Run Code Online (Sandbox Code Playgroud)

  • 在我的 Windows 10 上的最新 (2.9) MikTeX 上,命令是“miktex-fc-list”。 (2认同)

Phi*_*ipp 0

不是一个可行的答案,而是一个想法。您所要做的就是迭代所有已安装的字体系列,其中存在 API 函数:EnumFontFamiliesEx.