mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-01 00:50:49 +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
fefef48607
commit
b74ea57ae9
1 changed files with 13 additions and 1 deletions
|
@ -360,6 +360,7 @@ setNSFont(NSString* key, NSFont* font)
|
||||||
//
|
//
|
||||||
+ (float) labelFontSize
|
+ (float) labelFontSize
|
||||||
{
|
{
|
||||||
|
/* FIXME - if the user has set a default, shouldn't this return that ? */
|
||||||
return 12.0;
|
return 12.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -384,7 +385,18 @@ setNSFont(NSString* key, NSFont* font)
|
||||||
size: (float)fontSize
|
size: (float)fontSize
|
||||||
{
|
{
|
||||||
NSFont*font;
|
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 = [self fontWithName: name matrix: fontMatrix];
|
||||||
font->matrixExplicitlySet = NO;
|
font->matrixExplicitlySet = NO;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue