Summary: | Allow matching on FC_FILE | ||
---|---|---|---|
Product: | fontconfig | Reporter: | Behdad Esfahbod <freedesktop> |
Component: | library | Assignee: | Akira TAGOH <akira> |
Status: | RESOLVED FIXED | QA Contact: | Behdad Esfahbod <freedesktop> |
Severity: | enhancement | ||
Priority: | medium | CC: | akira, fontconfig-bugs, freedesktop, mpsuzuki |
Version: | 2.7 | ||
Hardware: | Other | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: |
Description
Behdad Esfahbod
2010-06-10 10:31:05 UTC
the proposed fix: http://cgit.freedesktop.org/~tagoh/fontconfig/commit/?h=bz28491 would be nice to match in regexp maybe. done for regexp this may be redundancy but may be good to check the filename strictly and give different score for them? The idea looks like: static double FcCompareFilename (FcValue *v1, FcValue *v2) { const FcChar8 *s1 = FcValueString (v1), *s2 = FcValueString (v2); if (FcStrCmp (s1, s2) == 0) return 0.0; else if (FcStrCmpIgnoreCase (s1, s2) == 0) return 1.0; else if (FcStrRegexCmp (s2, s1)) return 2.0; else if (FcStrRegexCmpIgnoreCase (s2, s1)) return 3.0; else return 4.0; } Humm. Thinking back, to be honest I'm not quite as sure about the usefulness of this. But probably not harmful to add. Would help adding API to Pango to request a specific font. More interesting perhaps would be if FC_FACE is set, and just return that before anything else. (In reply to comment #4) > Humm. Thinking back, to be honest I'm not quite as sure about the usefulness > of this. But probably not harmful to add. Would help adding API to Pango to > request a specific font. More interesting perhaps would be if FC_FACE is set, > and just return that before anything else. Yes, specifying FC_FILE would be reliable to request a specific font. and though I had a comment on Bug#25670, this would ensure the consistent result of FcFontMatch() too because the filename is unique. fixed in 9231d79a |
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.