How to get a list of all available (TTF-) fonts with XeTeX?

It’s very neat that I can use any Truetype font available for my Windows computer using MikTex and XeTeX .

%!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} 

Is there a way to automatically generate a fotn test page for every available font? . So I don’t need to enter a test page for each available font manually?

Actually, I don’t even know how to get to the long font name needed for \setromanfont - without typing it from the screen. The Windows directory lists the file names, obviously. It may be possible to do this in TeX, but I could manage it using a Python script or such.

+4
source share
2 answers

Not a worked-out answer, but an idea. All you have to do is EnumFontFamiliesEx over all the installed font families for which the API function exists: EnumFontFamiliesEx .

0
source
 fc-list | cut -d\ -f2-99 | cut -d: -f1 | sort -u 
+4
source

Source: https://habr.com/ru/post/1341200/


All Articles