diff --git a/Source/winlib/WIN32FontInfo.m b/Source/winlib/WIN32FontInfo.m index 132c41d..23f7b24 100644 --- a/Source/winlib/WIN32FontInfo.m +++ b/Source/winlib/WIN32FontInfo.m @@ -211,7 +211,6 @@ TEXTMETRIC metric; HFONT old; LOGFONT logfont; - NSString *weightString; NSRange range; //NSLog(@"Creating Font %@ of size %f", fontName, matrix[0]); @@ -242,19 +241,13 @@ SelectObject(hdc, old); ReleaseDC(NULL, hdc); - // Fill the afmDitionary and ivars - [fontDictionary setObject: fontName forKey: NSAFMFontName]; - //ASSIGN(familyName, XGFontFamily(xdpy, font_info)); - //[fontDictionary setObject: familyName forKey: NSAFMFamilyName]; + // Fill the ivars + // NSAFMFamilyName isFixedPitch = TMPF_FIXED_PITCH & metric.tmPitchAndFamily; isBaseFont = NO; ascender = metric.tmAscent; //NSLog(@"Resulted in height %d and ascent %d", metric.tmHeight, metric.tmAscent); - [fontDictionary setObject: [NSNumber numberWithFloat: ascender] - forKey: NSAFMAscender]; descender = -metric.tmDescent; - [fontDictionary setObject: [NSNumber numberWithFloat: descender] - forKey: NSAFMDescender]; fontBBox = NSMakeRect((float)(0), (float)(0 - metric.tmAscent), @@ -307,12 +300,6 @@ else traits |= NSUnitalicFontMask; - weightString = [GSFontInfo stringForWeight: weight]; - if (weightString != nil) - { - [fontDictionary setObject: weightString forKey: NSAFMWeight]; - } - // Should come from metric.tmCharSet mostCompatibleStringEncoding = NSISOLatin1StringEncoding; diff --git a/Source/xlib/GSXftFontInfo.m b/Source/xlib/GSXftFontInfo.m index dd4aa98..838ba5d 100644 --- a/Source/xlib/GSXftFontInfo.m +++ b/Source/xlib/GSXftFontInfo.m @@ -756,8 +756,6 @@ static NSArray *faFromFc(FcPattern *pat) if (mostCompatibleStringEncoding == NSUnicodeStringEncoding) mostCompatibleStringEncoding = NSUTF8StringEncoding; RETAIN(encodingScheme); - [fontDictionary setObject: encodingScheme - forKey: NSAFMEncodingScheme]; } } else @@ -766,19 +764,7 @@ static NSArray *faFromFc(FcPattern *pat) // Should use XA_ITALIC_ANGLE, XA_UNDERLINE_POSITION, XA_UNDERLINE_THICKNESS #endif - // Fill the afmDitionary and ivars - [fontDictionary setObject: fontName forKey: NSAFMFontName]; - - if (familyName != nil) - { - [fontDictionary setObject: familyName forKey: NSAFMFamilyName]; - } - - if (weightString != nil) - { - [fontDictionary setObject: weightString forKey: NSAFMWeight]; - } - + // Fill the ivars if (weight >= 9) traits |= NSBoldFontMask; else @@ -789,11 +775,7 @@ static NSArray *faFromFc(FcPattern *pat) isBaseFont = NO; ascender = font_info->ascent; - [fontDictionary setObject: [NSNumber numberWithFloat: ascender] - forKey: NSAFMAscender]; descender = -(font_info->descent); - [fontDictionary setObject: [NSNumber numberWithFloat: descender] - forKey: NSAFMDescender]; capHeight = ascender - descender; // TODO xHeight = capHeight*0.6; //Errr... TODO fontBBox = NSMakeRect( diff --git a/Source/xlib/XGFont.m b/Source/xlib/XGFont.m index f5617e9..215a105 100644 --- a/Source/xlib/XGFont.m +++ b/Source/xlib/XGFont.m @@ -267,7 +267,6 @@ static BOOL XGInitAtoms(Display *dpy) - (BOOL) setupAttributes { Display *xdpy = [XGServer currentXDisplay]; - NSString *weightString; NSString *reg; long height; NSString *xfontname; @@ -292,18 +291,12 @@ static BOOL XGInitAtoms(Display *dpy) else NSDebugLog(@"Loaded font: %@", xfontname); - // Fill the afmDitionary and ivars - [fontDictionary setObject: fontName forKey: NSAFMFontName]; + // Fill the ivars ASSIGN(familyName, XGFontFamily(xdpy, font_info)); - [fontDictionary setObject: familyName forKey: NSAFMFamilyName]; isFixedPitch = XGFontIsFixedPitch(xdpy, font_info); isBaseFont = NO; ascender = font_info->ascent; - [fontDictionary setObject: [NSNumber numberWithFloat: ascender] - forKey: NSAFMAscender]; descender = -(font_info->descent); - [fontDictionary setObject: [NSNumber numberWithFloat: descender] - forKey: NSAFMDescender]; fontBBox = NSMakeRect( (float)(0 + font_info->min_bounds.lbearing), (float)(0 - font_info->max_bounds.ascent), @@ -315,13 +308,6 @@ static BOOL XGInitAtoms(Display *dpy) weight = XGWeightOfFont(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); if (reg != nil) { @@ -337,8 +323,6 @@ static BOOL XGInitAtoms(Display *dpy) NSDebugLog(@"Found encoding %d for %@", mostCompatibleStringEncoding, encodingScheme); RETAIN(encodingScheme); - [fontDictionary setObject: encodingScheme - forKey: NSAFMEncodingScheme]; } } @@ -346,16 +330,12 @@ static BOOL XGInitAtoms(Display *dpy) if (height != 0) { xHeight = (float)height; - [fontDictionary setObject: [NSNumber numberWithFloat: xHeight] - forKey: NSAFMXHeight]; } height = XGFontPropULong(xdpy, font_info, XA_CAP_HEIGHT); if (height != 0) { capHeight = (float)height; - [fontDictionary setObject: [NSNumber numberWithFloat: capHeight] - forKey: NSAFMCapHeight]; } // FIXME: italicAngle, underlinePosition, underlineThickness are not set.