Around 11 o'clock on Jan 18, Paul Cheyrou wrote:

>         //     Using this function leads to segfaults if fonts wasn't there...
>       //      XftPatternGetString (match, XFT_FILE, 0, filename); 
>       //   so here its content, a little hacked
>       // 
>       r = XftPatternGet (match, XFT_FILE, 0, &v);

You should be able to use:

        char    *s;

        if (XftPatternGetString (match, XFT_FILE, 0, &s) == XftResultMatch)
                strcpy (file, s);

XftPatternGetString doesn't copy the string, it gives you a pointer to the 
string stored in the pattern.

Please note that using XLFD strings with Xft won't give you the same fonts 
as with the core server; XftFontMatch *always* returns something.  Also, 
XLFD names don't express all of the matching options that Xft can support.

Unless  your application is already hard coded to accept XLFD names all
over the place, you might consider switching to the native Xft font names.

Keith Packard        XFree86 Core Team        Compaq Cambridge Research Lab


_______________________________________________
Fonts mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/fonts

Reply via email to