mirror of
https://github.com/gnustep/libs-back.git
synced 2025-05-30 00:40:55 +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;
|
||||
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;
|
||||
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue