mirror of
https://github.com/gnustep/libs-back.git
synced 2025-05-31 01:11:00 +00:00
In [setupAttributes] removed setting of fontDictionary values.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@16561 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
b88ca8d8a6
commit
0616e7cbc2
3 changed files with 4 additions and 55 deletions
|
@ -211,7 +211,6 @@
|
||||||
TEXTMETRIC metric;
|
TEXTMETRIC metric;
|
||||||
HFONT old;
|
HFONT old;
|
||||||
LOGFONT logfont;
|
LOGFONT logfont;
|
||||||
NSString *weightString;
|
|
||||||
NSRange range;
|
NSRange range;
|
||||||
|
|
||||||
//NSLog(@"Creating Font %@ of size %f", fontName, matrix[0]);
|
//NSLog(@"Creating Font %@ of size %f", fontName, matrix[0]);
|
||||||
|
@ -242,19 +241,13 @@
|
||||||
SelectObject(hdc, old);
|
SelectObject(hdc, old);
|
||||||
ReleaseDC(NULL, hdc);
|
ReleaseDC(NULL, hdc);
|
||||||
|
|
||||||
// Fill the afmDitionary and ivars
|
// Fill the ivars
|
||||||
[fontDictionary setObject: fontName forKey: NSAFMFontName];
|
// NSAFMFamilyName
|
||||||
//ASSIGN(familyName, XGFontFamily(xdpy, font_info));
|
|
||||||
//[fontDictionary setObject: familyName forKey: NSAFMFamilyName];
|
|
||||||
isFixedPitch = TMPF_FIXED_PITCH & metric.tmPitchAndFamily;
|
isFixedPitch = TMPF_FIXED_PITCH & metric.tmPitchAndFamily;
|
||||||
isBaseFont = NO;
|
isBaseFont = NO;
|
||||||
ascender = metric.tmAscent;
|
ascender = metric.tmAscent;
|
||||||
//NSLog(@"Resulted in height %d and ascent %d", metric.tmHeight, metric.tmAscent);
|
//NSLog(@"Resulted in height %d and ascent %d", metric.tmHeight, metric.tmAscent);
|
||||||
[fontDictionary setObject: [NSNumber numberWithFloat: ascender]
|
|
||||||
forKey: NSAFMAscender];
|
|
||||||
descender = -metric.tmDescent;
|
descender = -metric.tmDescent;
|
||||||
[fontDictionary setObject: [NSNumber numberWithFloat: descender]
|
|
||||||
forKey: NSAFMDescender];
|
|
||||||
|
|
||||||
fontBBox = NSMakeRect((float)(0),
|
fontBBox = NSMakeRect((float)(0),
|
||||||
(float)(0 - metric.tmAscent),
|
(float)(0 - metric.tmAscent),
|
||||||
|
@ -307,12 +300,6 @@
|
||||||
else
|
else
|
||||||
traits |= NSUnitalicFontMask;
|
traits |= NSUnitalicFontMask;
|
||||||
|
|
||||||
weightString = [GSFontInfo stringForWeight: weight];
|
|
||||||
if (weightString != nil)
|
|
||||||
{
|
|
||||||
[fontDictionary setObject: weightString forKey: NSAFMWeight];
|
|
||||||
}
|
|
||||||
|
|
||||||
// Should come from metric.tmCharSet
|
// Should come from metric.tmCharSet
|
||||||
mostCompatibleStringEncoding = NSISOLatin1StringEncoding;
|
mostCompatibleStringEncoding = NSISOLatin1StringEncoding;
|
||||||
|
|
||||||
|
|
|
@ -756,8 +756,6 @@ static NSArray *faFromFc(FcPattern *pat)
|
||||||
if (mostCompatibleStringEncoding == NSUnicodeStringEncoding)
|
if (mostCompatibleStringEncoding == NSUnicodeStringEncoding)
|
||||||
mostCompatibleStringEncoding = NSUTF8StringEncoding;
|
mostCompatibleStringEncoding = NSUTF8StringEncoding;
|
||||||
RETAIN(encodingScheme);
|
RETAIN(encodingScheme);
|
||||||
[fontDictionary setObject: encodingScheme
|
|
||||||
forKey: NSAFMEncodingScheme];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -766,19 +764,7 @@ static NSArray *faFromFc(FcPattern *pat)
|
||||||
// Should use XA_ITALIC_ANGLE, XA_UNDERLINE_POSITION, XA_UNDERLINE_THICKNESS
|
// Should use XA_ITALIC_ANGLE, XA_UNDERLINE_POSITION, XA_UNDERLINE_THICKNESS
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Fill the afmDitionary and ivars
|
// Fill the ivars
|
||||||
[fontDictionary setObject: fontName forKey: NSAFMFontName];
|
|
||||||
|
|
||||||
if (familyName != nil)
|
|
||||||
{
|
|
||||||
[fontDictionary setObject: familyName forKey: NSAFMFamilyName];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (weightString != nil)
|
|
||||||
{
|
|
||||||
[fontDictionary setObject: weightString forKey: NSAFMWeight];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (weight >= 9)
|
if (weight >= 9)
|
||||||
traits |= NSBoldFontMask;
|
traits |= NSBoldFontMask;
|
||||||
else
|
else
|
||||||
|
@ -789,11 +775,7 @@ static NSArray *faFromFc(FcPattern *pat)
|
||||||
|
|
||||||
isBaseFont = NO;
|
isBaseFont = NO;
|
||||||
ascender = font_info->ascent;
|
ascender = font_info->ascent;
|
||||||
[fontDictionary setObject: [NSNumber numberWithFloat: ascender]
|
|
||||||
forKey: NSAFMAscender];
|
|
||||||
descender = -(font_info->descent);
|
descender = -(font_info->descent);
|
||||||
[fontDictionary setObject: [NSNumber numberWithFloat: descender]
|
|
||||||
forKey: NSAFMDescender];
|
|
||||||
capHeight = ascender - descender; // TODO
|
capHeight = ascender - descender; // TODO
|
||||||
xHeight = capHeight*0.6; //Errr... TODO
|
xHeight = capHeight*0.6; //Errr... TODO
|
||||||
fontBBox = NSMakeRect(
|
fontBBox = NSMakeRect(
|
||||||
|
|
|
@ -267,7 +267,6 @@ static BOOL XGInitAtoms(Display *dpy)
|
||||||
- (BOOL) setupAttributes
|
- (BOOL) setupAttributes
|
||||||
{
|
{
|
||||||
Display *xdpy = [XGServer currentXDisplay];
|
Display *xdpy = [XGServer currentXDisplay];
|
||||||
NSString *weightString;
|
|
||||||
NSString *reg;
|
NSString *reg;
|
||||||
long height;
|
long height;
|
||||||
NSString *xfontname;
|
NSString *xfontname;
|
||||||
|
@ -292,18 +291,12 @@ static BOOL XGInitAtoms(Display *dpy)
|
||||||
else
|
else
|
||||||
NSDebugLog(@"Loaded font: %@", xfontname);
|
NSDebugLog(@"Loaded font: %@", xfontname);
|
||||||
|
|
||||||
// Fill the afmDitionary and ivars
|
// Fill the ivars
|
||||||
[fontDictionary setObject: fontName forKey: NSAFMFontName];
|
|
||||||
ASSIGN(familyName, XGFontFamily(xdpy, font_info));
|
ASSIGN(familyName, XGFontFamily(xdpy, font_info));
|
||||||
[fontDictionary setObject: familyName forKey: NSAFMFamilyName];
|
|
||||||
isFixedPitch = XGFontIsFixedPitch(xdpy, font_info);
|
isFixedPitch = XGFontIsFixedPitch(xdpy, font_info);
|
||||||
isBaseFont = NO;
|
isBaseFont = NO;
|
||||||
ascender = font_info->ascent;
|
ascender = font_info->ascent;
|
||||||
[fontDictionary setObject: [NSNumber numberWithFloat: ascender]
|
|
||||||
forKey: NSAFMAscender];
|
|
||||||
descender = -(font_info->descent);
|
descender = -(font_info->descent);
|
||||||
[fontDictionary setObject: [NSNumber numberWithFloat: descender]
|
|
||||||
forKey: NSAFMDescender];
|
|
||||||
fontBBox = NSMakeRect(
|
fontBBox = NSMakeRect(
|
||||||
(float)(0 + font_info->min_bounds.lbearing),
|
(float)(0 + font_info->min_bounds.lbearing),
|
||||||
(float)(0 - font_info->max_bounds.ascent),
|
(float)(0 - font_info->max_bounds.ascent),
|
||||||
|
@ -315,13 +308,6 @@ static BOOL XGInitAtoms(Display *dpy)
|
||||||
weight = XGWeightOfFont(xdpy, font_info);
|
weight = XGWeightOfFont(xdpy, font_info);
|
||||||
traits = XGTraitsOfFont(xdpy, font_info);
|
traits = XGTraitsOfFont(xdpy, font_info);
|
||||||
|
|
||||||
weightString = [GSFontInfo stringForWeight: weight];
|
|
||||||
|
|
||||||
if (weightString != nil)
|
|
||||||
{
|
|
||||||
[fontDictionary setObject: weightString forKey: NSAFMWeight];
|
|
||||||
}
|
|
||||||
|
|
||||||
reg = XGFontPropString(xdpy, font_info, XA_CHARSET_REGISTRY);
|
reg = XGFontPropString(xdpy, font_info, XA_CHARSET_REGISTRY);
|
||||||
if (reg != nil)
|
if (reg != nil)
|
||||||
{
|
{
|
||||||
|
@ -337,8 +323,6 @@ static BOOL XGInitAtoms(Display *dpy)
|
||||||
NSDebugLog(@"Found encoding %d for %@",
|
NSDebugLog(@"Found encoding %d for %@",
|
||||||
mostCompatibleStringEncoding, encodingScheme);
|
mostCompatibleStringEncoding, encodingScheme);
|
||||||
RETAIN(encodingScheme);
|
RETAIN(encodingScheme);
|
||||||
[fontDictionary setObject: encodingScheme
|
|
||||||
forKey: NSAFMEncodingScheme];
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -346,16 +330,12 @@ static BOOL XGInitAtoms(Display *dpy)
|
||||||
if (height != 0)
|
if (height != 0)
|
||||||
{
|
{
|
||||||
xHeight = (float)height;
|
xHeight = (float)height;
|
||||||
[fontDictionary setObject: [NSNumber numberWithFloat: xHeight]
|
|
||||||
forKey: NSAFMXHeight];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
height = XGFontPropULong(xdpy, font_info, XA_CAP_HEIGHT);
|
height = XGFontPropULong(xdpy, font_info, XA_CAP_HEIGHT);
|
||||||
if (height != 0)
|
if (height != 0)
|
||||||
{
|
{
|
||||||
capHeight = (float)height;
|
capHeight = (float)height;
|
||||||
[fontDictionary setObject: [NSNumber numberWithFloat: capHeight]
|
|
||||||
forKey: NSAFMCapHeight];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: italicAngle, underlinePosition, underlineThickness are not set.
|
// FIXME: italicAngle, underlinePosition, underlineThickness are not set.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue