diff options
author | donal.k.fellows@manchester.ac.uk <dkf> | 2007-05-03 15:21:31 (GMT) |
---|---|---|
committer | donal.k.fellows@manchester.ac.uk <dkf> | 2007-05-03 15:21:31 (GMT) |
commit | 3325e666a016d099c242be36c5659ed797d4bba5 (patch) | |
tree | 4b65e0e57b4ff5c4424e1dd85c980a9425cd118c /unix/tkUnixRFont.c | |
parent | 5c7e0ee8e20f04b75c30cab266544ac8347be7a0 (diff) | |
download | tk-3325e666a016d099c242be36c5659ed797d4bba5.zip tk-3325e666a016d099c242be36c5659ed797d4bba5.tar.gz tk-3325e666a016d099c242be36c5659ed797d4bba5.tar.bz2 |
Tackle [Bug 1711985]
Diffstat (limited to 'unix/tkUnixRFont.c')
-rw-r--r-- | unix/tkUnixRFont.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/unix/tkUnixRFont.c b/unix/tkUnixRFont.c index 96097fa..04f54de 100644 --- a/unix/tkUnixRFont.c +++ b/unix/tkUnixRFont.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkUnixRFont.c,v 1.16 2007/02/27 13:59:53 dkf Exp $ + * RCS: @(#) $Id: tkUnixRFont.c,v 1.17 2007/05/03 15:21:32 dkf Exp $ */ #include "tkUnixInt.h" @@ -119,7 +119,7 @@ InitFont( { TkFontAttributes *faPtr; TkFontMetrics *fmPtr; - char *family; + char *family, **familyPtr = &family; int weight, slant, spacing, i; double size; FcFontSet *set; @@ -183,7 +183,7 @@ InitFont( */ if (XftPatternGetString(ftFont->pattern, XFT_FAMILY, 0, - &family) != XftResultMatch) { + familyPtr) != XftResultMatch) { family = "Unknown"; } @@ -399,7 +399,7 @@ TkpGetFontFamilies( Tcl_Obj *resultPtr, *strPtr; XftFontSet *list; int i; - char *family; + char *family, **familyPtr = &family; resultPtr = Tcl_NewListObj(0, NULL); @@ -407,7 +407,7 @@ TkpGetFontFamilies( XFT_FAMILY, 0); for (i = 0; i < list->nfont; i++) { if (XftPatternGetString(list->fonts[i], XFT_FAMILY, 0, - &family) == XftResultMatch) { + familyPtr) == XftResultMatch) { strPtr = Tcl_NewStringObj(Tk_GetUid(family), -1); Tcl_ListObjAppendElement(NULL, resultPtr, strPtr); } @@ -438,7 +438,9 @@ TkpGetSubFonts( Tcl_Obj *objv[3], *listPtr, *resultPtr; UnixFtFont *fontPtr = (UnixFtFont *) tkfont; FcPattern *pattern; - char *family, *foundry, *encoding; + char *family, **familyPtr = &family; + char *foundry, **foundryPtr = &foundry; + char *encoding, **encodingPtr = &encoding; int i; resultPtr = Tcl_NewListObj(0, NULL); @@ -448,15 +450,15 @@ TkpGetSubFonts( fontPtr->faces[i].source); if (XftPatternGetString(pattern, XFT_FAMILY, 0, - &family) != XftResultMatch) { + familyPtr) != XftResultMatch) { family = "Unknown"; } if (XftPatternGetString(pattern, XFT_FOUNDRY, 0, - &foundry) != XftResultMatch) { + foundryPtr) != XftResultMatch) { foundry = "Unknown"; } if (XftPatternGetString(pattern, XFT_ENCODING, 0, - &encoding) != XftResultMatch) { + encodingPtr) != XftResultMatch) { encoding = "Unknown"; } objv[0] = Tcl_NewStringObj(family, -1); @@ -473,8 +475,8 @@ TkpGetSubFonts( * * TkpGetFontAttrsForChar -- * - * Retrieve the font attributes of the actual font used to render - * a given character. + * Retrieve the font attributes of the actual font used to render a given + * character. * * Results: * None. @@ -499,12 +501,13 @@ TkpGetFontAttrsForChar( XftFont *xftFontPtr = GetFont(fontPtr, ucs4); /* Actual font used to render the character */ const char *family; /* Font family name */ + const char **familyPtr = &family; double size; /* Font size */ int weight; /* Font weight */ int slant; /* Font slant */ if (XftPatternGetString(xftFontPtr->pattern, XFT_FAMILY, 0, - &family) != XftResultMatch) { + familyPtr) != XftResultMatch) { family = "Unknown"; } if (XftPatternGetDouble(xftFontPtr->pattern, XFT_SIZE, 0, |