Provide FcFontSort-like API without having the fallbacks
Submitted by Behdad Esfahbod
Assigned to fon..@..op.org
Description
Keith has this idea of for performance reasons rebuilding FcFontSort results from FcFontMatch followed by a generic fallback list. This doesn't work for various cases, including for ":lang=en,ja" for example.
To be able to do something like that we need a new API that returns a list of fonts explicitly chosen to fulfill the requested pattern (including stuff added by the config file.) That list then can be expanded by a generic fallback list by the application. Not sure how easy is to implement this.
Example:
[behdad@home ~]$ fc-match --sort | head -n 5 DejaVuLGCSans.ttf: "DejaVu LGC Sans" "Book" DejaVuLGCSans.ttf: "DejaVu LGC Sans" "Book" DejaVuLGCSans-ExtraLight.ttf: "DejaVu LGC Sans" "ExtraLight" DejaVuLGCSans-BoldOblique.ttf: "DejaVu LGC Sans" "Bold Oblique" n019003l.pfb: "Nimbus Sans L" "Regular"
[behdad@home ~]$ fc-match --sort :lang=fa | head -n 5 roya.ttf: "Roya" "Regular" DejaVuLGCSans.ttf: "DejaVu LGC Sans" "Book" DejaVuLGCSans.ttf: "DejaVu LGC Sans" "Book" DejaVuLGCSans-ExtraLight.ttf: "DejaVu LGC Sans" "ExtraLight" DejaVuLGCSans-BoldOblique.ttf: "DejaVu LGC Sans" "Bold Oblique"
[behdad@home ~]$ fc-match --sort :lang=fa,ja | head -n 5 roya.ttf: "Roya" "Regular" sazanami-gothic.ttf: "Sazanami Gothic" "Gothic-Regular" DejaVuLGCSans.ttf: "DejaVu LGC Sans" "Book" DejaVuLGCSans.ttf: "DejaVu LGC Sans" "Book" DejaVuLGCSans-ExtraLight.ttf: "DejaVu LGC Sans" "ExtraLight"
[behdad@home ~]$ fc-match --sort Nazli:lang=fa,ja | head -n 5 nazli.ttf: "Nazli" "Regular" sazanami-gothic.ttf: "Sazanami Gothic" "Gothic-Regular" DejaVuLGCSans.ttf: "DejaVu LGC Sans" "Book" DejaVuLGCSans.ttf: "DejaVu LGC Sans" "Book" DejaVuLGCSans-ExtraLight.ttf: "DejaVu LGC Sans" "ExtraLight"
Version: 2_1