Right now we recognize sans-serif, serif, monospace, fantasy, and cursive but user has to know that. Would be nice to allow defining those formally, and let user define more.
That would be useful for a font-manager kind of scenario, where one can define new virtual families and add multiple fonts as a stack to it.
The latter can be done using existing configuration facilities (mostly), so the part missing is just making it appear in FcFontList() output.
No idea what the config / API for this should look like.
I think this can be done by bug#29497.
Though my initial goal on it was to reduce the cost of creating a font specific configuration related to it. the patch to provide the information about it has already done but I'm still not sure how we can use it effectively and it seems not accomplish my goal at this moment. that's a reason why I'm getting stuck for the merge.
FWIW with that change, we can look up such virtual families like this:
$ fc-list :familyclass=serif
/usr/share/fonts/dejavu/DejaVuSerif-Bold.ttf: DejaVu Serif:style=Bold
/usr/share/fonts/liberation/LiberationSerif-Italic.ttf: Liberation Serif:style=Italic
/usr/share/fonts/dejavu/DejaVuSerif-Italic.ttf: DejaVu Serif:style=Italic
/usr/share/fonts/lilypond/CenturySchL-Roma.otf: Century Schoolbook L:style=Roma
/usr/share/fonts/sazanami/mincho/sazanami-mincho.ttf: さざなみ明朝,Sazanami Mincho:style=Mincho-Regular,Regular
/usr/share/fonts/paktype-naskh-basic/PakTypeNaskhBasic.ttf: PakType Naskh Basic:style=Regular
/usr/share/fonts/liberation/LiberationMono-Bold.ttf: Liberation Mono:style=Bold
Do you expect to see more other than that?
That's great. But this bug was really about user-defined virtual families. Eg "my favorite" or whatever, that stacks multiple fonts and configs into a new name.
stacks? so you want to create a kind of FcFontSet on the configuration rather than FcPattern and leave it to the application how to take care of it?
(In reply to Akira TAGOH from comment #4)
By stack I mean a list of families.
> so you want to create a kind of FcFontSet on the configuration
> rather than FcPattern and leave it to the application how to take care of it?
What I want is to define, eg, "My Favorites", which would resolve to "Nazli" (for Arabic), followed by Open Sans (for Latin), and Noto (for everything else).
(In reply to Behdad Esfahbod from comment #5)
> What I want is to define, eg, "My Favorites", which would resolve to "Nazli"
> (for Arabic), followed by Open Sans (for Latin), and Noto (for everything
IIUC it can be done already. I guess you think that isn't sufficient for you? that's why I was asking at comment#4.
I want config API such that "My Favorites" would show in fc-list output. Even better, a way to list all pseudo-families, which would be the sans, serif, monospace, fantasy, cursive, and custom ones like "My Favorites". The enumeration part is missing right now.
-- GitLab Migration Automatic Message --
This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.
You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/fontconfig/fontconfig/issues/98.