Bug 90428

Summary: Config format (and api?) to define virtual families
Product: fontconfig Reporter: Behdad Esfahbod <freedesktop>
Component: libraryAssignee: fontconfig-bugs
Status: RESOLVED MOVED QA Contact: Behdad Esfahbod <freedesktop>
Severity: normal    
Priority: medium CC: akira, freedesktop
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Behdad Esfahbod 2015-05-12 21:42:30 UTC
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.
Comment 1 Akira TAGOH 2015-05-13 01:53:38 UTC
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.
Comment 2 Akira TAGOH 2015-06-04 07:43:41 UTC
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?
Comment 3 Behdad Esfahbod 2015-06-04 18:38:17 UTC
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.
Comment 4 Akira TAGOH 2015-06-05 02:56:05 UTC
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?
Comment 5 Behdad Esfahbod 2015-08-18 14:34:10 UTC
(In reply to Akira TAGOH from comment #4)
> stacks?

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).
Comment 6 Akira TAGOH 2015-08-20 08:44:44 UTC
(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
> else).

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.
Comment 7 Behdad Esfahbod 2015-08-20 10:40:13 UTC
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.
Comment 8 GitLab Migration User 2018-08-20 21:52:27 UTC
-- 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.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.