font pattern -> font file : without X11 dependencies?

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

 



Around 13 o'clock on Mar 16, John Ellson wrote:

> Is there any example code for converting a font-pattern to a font 
> filename *without* any X11 dependencies?

I don't know of any examples, but certainly Xft itself has code which does 
that that you can rip out of the library and use.   The basic routine is 
something like:


    if (!FcInit (0))
        return 0;

    FcConfigSubstitute (0, pattern, FcMatchPattern);
    FcDefaultSubstitute (pattern)
 
    match = FcFontMatch (0, pattern, result);
    return match;

'match' now contains all of the information needed to access the font file.

If you want to find a list of fonts, you use FcFontSort instead; that's 
useful if you need to do glyph fill-in to handle glyphs not present in the 
best matching font.

-keith





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

  Powered by Linux