[Fontconfig] Finding a font but without fallback

Sairus Patel sppatel at adobe.com
Fri Apr 25 13:34:55 PDT 2008


I haven't seen a response yet.

Is querying for fonts without fallback not possible, or is it that 
folks don't know (or is the answer so obvious you have refrained from 
replying :^)?

Any response, including a "I always want fallback to happen, so I 
don't know the answer" appreciated. Feel free to email me privately as well.

Best,
Sairus


At 4/15/2008 02:51 PM, Sairus Patel wrote:
>Greetings.
>
>I'd like to ask FontConfig to find a font but *not* do font fallback
>if a precise match isn't found.
>
>Is there a way I can tell FcFontMatch to do this (see below) or is
>there another API I should be using?
>
>The FC documentation says:
>  > Font configuration is separate from font matching; applications
>needing to do their own matching can access the available fonts from
>the library and perform private matching.
>
>Does this means that there is no explicit findfont API and I should
>be using FcFontList and managing things myself?
>
>TIA,
>Sairus
>
>
>
>      FcPattern* pattern = FcPatternBuild(0,
>                              FC_SCALABLE, FcTypeBool, 1,
>                              FC_FAMILY, FcTypeString, familyUtf8,
>                              FC_WEIGHT, FcTypeInteger, weight,
>                              FC_SLANT, FcTypeInteger, slant,
>                              (char *)0);
>      if (pattern) {
>          FcResult result;
>          FcPattern* match;
>
>          /* These *must* be called before FcFontMatch or the results
>won't be correct: */
>          FcConfigSubstitute(0, pattern, FcMatchPattern);
>          FcDefaultSubstitute(pattern); /* Add default values for
>other attribs */
>
>          /* FcFontMatch substitutes a fallback font if not found; can
>we suppress this? */
>          match = FcFontMatch(0, pattern, &result);
>          if (match) {
>              ....
>
>_______________________________________________
>Fontconfig mailing list
>Fontconfig at lists.freedesktop.org
>http://lists.freedesktop.org/mailman/listinfo/fontconfig



More information about the Fontconfig mailing list