Fixed fontWithName:size: to work for 0.0 size

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@12800 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Nicola Pero 2002-02-26 18:31:07 +00:00
parent 980df81a93
commit eff5521f00

View file

@ -360,6 +360,7 @@ setNSFont(NSString* key, NSFont* font)
//
+ (float) labelFontSize
{
/* FIXME - if the user has set a default, shouldn't this return that ? */
return 12.0;
}
@ -384,7 +385,18 @@ setNSFont(NSString* key, NSFont* font)
size: (float)fontSize
{
NSFont*font;
float fontMatrix[6] = { fontSize, 0, 0, fontSize, 0, 0 };
float fontMatrix[6] = { 0, 0, 0, 0, 0, 0 };
if (fontSize == 0)
{
fontSize = [defaults floatForKey: @"NSUserFontSize"];
if (fontSize == 0)
{
fontSize = 12;
}
}
fontMatrix[0] = fontSize;
fontMatrix[3] = fontSize;
font = [self fontWithName: name matrix: fontMatrix];
font->matrixExplicitlySet = NO;