Added some methods for font size and one function for glyphs from

the MacOS X specification.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@9753 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Fred Kiefer 2001-05-01 21:19:33 +00:00
parent 82a4641f70
commit 01f6f990dc
2 changed files with 61 additions and 6 deletions

View file

@ -86,6 +86,14 @@ extern const float *NSFontIdentityMatrix;
+ (NSFont *)paletteFontOfSize:(float)fontSize;
+ (NSFont *)toolTipsFontOfSize:(float)fontSize;
+ (NSFont *)controlContentFontOfSize:(float)fontSize;
+ (NSFont *)labelFontOfSize:(float)fontSize;
//
// Font Sizes
//
+ (float) labelFontSize;
+ (float) smallSystemFontSize;
+ (float) systemFontSize;
//
// Preferred Fonts
@ -160,14 +168,15 @@ extern const float *NSFontIdentityMatrix;
- (NSStringEncoding)mostCompatibleStringEncoding;
//
// NSCoding protocol
//
- (void)encodeWithCoder:aCoder;
- initWithCoder:aDecoder;
@end
#ifndef STRICT_OPENSTEP
int NSConvertGlyphsToPackedGlyphs(NSGlyph *glBuf,
int count,
NSMultibyteGlyphPacking packing,
char *packedGlyphs);
#endif
extern NSString *NSAFMAscender;
extern NSString *NSAFMCapHeight;
extern NSString *NSAFMCharacterSet;

View file

@ -237,6 +237,25 @@ setNSFont(NSString* key, NSFont* font)
}
}
+ (NSFont*) labelFontOfSize: (float)fontSize
{
static NSFont *font = nil;
if (fontSize != 0)
{
return getNSFont (@"NSLabelFont", @"Helvetica", fontSize);
}
else
{
if ((font == nil) || (userCacheNeedsRecomputing == YES))
{
ASSIGN (font, getNSFont (@"NSLabelFont", @"Helvetica", 0));
userCacheNeedsRecomputing = NO;
}
return font;
}
}
+ (NSFont*) menuFontOfSize: (float)fontSize
{
static NSFont *font = nil;
@ -334,6 +353,24 @@ setNSFont(NSString* key, NSFont* font)
}
}
//
// Font Sizes
//
+ (float) labelFontSize
{
return 12.0;
}
+ (float) smallSystemFontSize
{
return 9.0;
}
+ (float) systemFontSize
{
return 12.0;
}
- (id) initWithName: (NSString*)name matrix: (const float*)fontMatrix
{
fontName = [name copy];
@ -613,3 +650,12 @@ setNSFont(NSString* key, NSFont* font)
}
@end /* NSFont */
int NSConvertGlyphsToPackedGlyphs(NSGlyph *glBuf,
int count,
NSMultibyteGlyphPacking packing,
char *packedGlyphs)
{
// TODO
return 0;
}