mirror of
https://github.com/gnustep/libs-back.git
synced 2025-02-24 04:11:28 +00:00
Support for UTF8 font family names for XFT.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@19939 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
92077fc8bb
commit
cfdf161246
2 changed files with 12 additions and 6 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2004-08-30 Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
|
||||||
|
* Source/xlib/GSXftFontInfo.m: Changed usage of CString for font
|
||||||
|
name and family into UTF8String for XFT. Patch by Yen-Ju Chen
|
||||||
|
<yjchenx@hotmail.com>.
|
||||||
|
|
||||||
2004-08-24 Fred Kiefer <FredKiefer@gmx.de>
|
2004-08-24 Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
|
||||||
* Source/win32/WIN32Server.m (-windowbounds:): Corrected variable
|
* Source/win32/WIN32Server.m (-windowbounds:): Corrected variable
|
||||||
|
|
|
@ -101,7 +101,7 @@ static NSArray *faFromFc(FcPattern *pat)
|
||||||
|
|
||||||
name = [NSMutableString stringWithCapacity: 100];
|
name = [NSMutableString stringWithCapacity: 100];
|
||||||
style = [NSMutableString stringWithCapacity: 100];
|
style = [NSMutableString stringWithCapacity: 100];
|
||||||
[name appendString: [NSString stringWithCString: family]];
|
[name appendString: [NSString stringWithUTF8String: family]];
|
||||||
|
|
||||||
switch (weight)
|
switch (weight)
|
||||||
{
|
{
|
||||||
|
@ -190,7 +190,7 @@ static NSArray *faFromFc(FcPattern *pat)
|
||||||
FcFont *aFont;
|
FcFont *aFont;
|
||||||
NSString *name = [fontArray objectAtIndex: 0];
|
NSString *name = [fontArray objectAtIndex: 0];
|
||||||
|
|
||||||
familyString = [NSString stringWithCString: family];
|
familyString = [NSString stringWithUTF8String: family];
|
||||||
if (!(familyArray = [fcxft_allFontFamilies objectForKey: familyString]))
|
if (!(familyArray = [fcxft_allFontFamilies objectForKey: familyString]))
|
||||||
{
|
{
|
||||||
familyArray = [[NSMutableArray alloc] init];
|
familyArray = [[NSMutableArray alloc] init];
|
||||||
|
@ -596,7 +596,7 @@ static NSArray *faFromFc(FcPattern *pat)
|
||||||
|
|
||||||
if (FcPatternGetString(pattern, FC_FAMILY, 0, (FcChar8 **)&family) == FcResultMatch)
|
if (FcPatternGetString(pattern, FC_FAMILY, 0, (FcChar8 **)&family) == FcResultMatch)
|
||||||
{
|
{
|
||||||
ASSIGN(familyName, [NSString stringWithCString: (const char*)family]);
|
ASSIGN(familyName, [NSString stringWithUTF8String: (const char*)family]);
|
||||||
}
|
}
|
||||||
if (FcPatternGetInteger(pattern, FC_SPACING, 0, &fcspacing) == FcResultMatch)
|
if (FcPatternGetInteger(pattern, FC_SPACING, 0, &fcspacing) == FcResultMatch)
|
||||||
{
|
{
|
||||||
|
@ -680,7 +680,7 @@ static NSArray *faFromFc(FcPattern *pat)
|
||||||
|
|
||||||
// Load Xft font and get font info structure.
|
// Load Xft font and get font info structure.
|
||||||
if ((xfontname == nil) ||
|
if ((xfontname == nil) ||
|
||||||
(font_info = XftFontOpenXlfd(xdpy, defaultScreen, [xfontname cString])) == NULL)
|
(font_info = XftFontOpenXlfd(xdpy, defaultScreen, [xfontname UTF8String])) == NULL)
|
||||||
{
|
{
|
||||||
NSLog(@"Unable to open fixed font");
|
NSLog(@"Unable to open fixed font");
|
||||||
return NO;
|
return NO;
|
||||||
|
@ -693,7 +693,7 @@ static NSArray *faFromFc(FcPattern *pat)
|
||||||
if (result != XftResultTypeMismatch)
|
if (result != XftResultTypeMismatch)
|
||||||
{
|
{
|
||||||
ASSIGN(familyName,
|
ASSIGN(familyName,
|
||||||
[NSString stringWithCString: (const char*)xftTypeString]);
|
[NSString stringWithUTF8String: (const char*)xftTypeString]);
|
||||||
}
|
}
|
||||||
result = XftPatternGetInteger(pattern, XFT_SPACING, 0, &xftTypeInt);
|
result = XftPatternGetInteger(pattern, XFT_SPACING, 0, &xftTypeInt);
|
||||||
if (result != XftResultTypeMismatch)
|
if (result != XftResultTypeMismatch)
|
||||||
|
@ -742,7 +742,7 @@ static NSArray *faFromFc(FcPattern *pat)
|
||||||
}
|
}
|
||||||
|
|
||||||
XftPatternGetString(pattern, XFT_ENCODING, 0, &xftTypeString);
|
XftPatternGetString(pattern, XFT_ENCODING, 0, &xftTypeString);
|
||||||
encodingScheme = [NSString stringWithCString: xftTypeString];
|
encodingScheme = [NSString stringWithUTF8String: xftTypeString];
|
||||||
encoding = [encodingScheme componentsSeparatedByString: @"-"];
|
encoding = [encodingScheme componentsSeparatedByString: @"-"];
|
||||||
reg = [encoding objectAtIndex: 0];
|
reg = [encoding objectAtIndex: 0];
|
||||||
if (reg != nil)
|
if (reg != nil)
|
||||||
|
|
Loading…
Reference in a new issue