mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 15:11:37 +00:00
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:
parent
980df81a93
commit
eff5521f00
1 changed files with 13 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue