Finding a font but without fallback

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/fontconfig

[Index of Archives]     [Fedora Fonts]     [Fedora Users]     [Fedora Cloud]     [Kernel]     [Fedora Packaging]     [Fedora Desktop]     [PAM]     [Gimp Graphics Editor]     [Yosemite News]

  Powered by Linux