I have been trying to find a way to locate suitable fonts for a book project. For the purposes of this question, I want to find all the fonts I have available on my Mac which
- are serif fonts, and
- have particular font features (e.g., Old Style Figures).
With regards to the second issue, using otfinfo
on the command line, I can determine which fonts have a given feature (in my example, any ones which have 'onum' among the features).
But, as for the first, I have been looking at fc-list
and the like, but it's not clear to me what I should be passing either it, or an alternate command, to determine whether a font is a serif font.
Is that even possible? I.e., is there any internal encoding to that effect, or is it strictly a matter of visual inspection?
fc-match
that allows you to check if a font is a serif font:fc-match -s serif fontname
. I couldn't get it to work on my Mac though. If that doesn't work, maybe I need to think about a Python script with thefontTools
library.