mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-26 17:01:22 +00:00
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:
parent
faee48bffa
commit
cc4d2beb72
2 changed files with 61 additions and 6 deletions
|
@ -86,6 +86,14 @@ extern const float *NSFontIdentityMatrix;
|
||||||
+ (NSFont *)paletteFontOfSize:(float)fontSize;
|
+ (NSFont *)paletteFontOfSize:(float)fontSize;
|
||||||
+ (NSFont *)toolTipsFontOfSize:(float)fontSize;
|
+ (NSFont *)toolTipsFontOfSize:(float)fontSize;
|
||||||
+ (NSFont *)controlContentFontOfSize:(float)fontSize;
|
+ (NSFont *)controlContentFontOfSize:(float)fontSize;
|
||||||
|
+ (NSFont *)labelFontOfSize:(float)fontSize;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Font Sizes
|
||||||
|
//
|
||||||
|
+ (float) labelFontSize;
|
||||||
|
+ (float) smallSystemFontSize;
|
||||||
|
+ (float) systemFontSize;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Preferred Fonts
|
// Preferred Fonts
|
||||||
|
@ -160,14 +168,15 @@ extern const float *NSFontIdentityMatrix;
|
||||||
|
|
||||||
- (NSStringEncoding)mostCompatibleStringEncoding;
|
- (NSStringEncoding)mostCompatibleStringEncoding;
|
||||||
|
|
||||||
//
|
|
||||||
// NSCoding protocol
|
|
||||||
//
|
|
||||||
- (void)encodeWithCoder:aCoder;
|
|
||||||
- initWithCoder:aDecoder;
|
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
#ifndef STRICT_OPENSTEP
|
||||||
|
int NSConvertGlyphsToPackedGlyphs(NSGlyph *glBuf,
|
||||||
|
int count,
|
||||||
|
NSMultibyteGlyphPacking packing,
|
||||||
|
char *packedGlyphs);
|
||||||
|
#endif
|
||||||
|
|
||||||
extern NSString *NSAFMAscender;
|
extern NSString *NSAFMAscender;
|
||||||
extern NSString *NSAFMCapHeight;
|
extern NSString *NSAFMCapHeight;
|
||||||
extern NSString *NSAFMCharacterSet;
|
extern NSString *NSAFMCharacterSet;
|
||||||
|
|
|
@ -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
|
+ (NSFont*) menuFontOfSize: (float)fontSize
|
||||||
{
|
{
|
||||||
static NSFont *font = nil;
|
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
|
- (id) initWithName: (NSString*)name matrix: (const float*)fontMatrix
|
||||||
{
|
{
|
||||||
fontName = [name copy];
|
fontName = [name copy];
|
||||||
|
@ -613,3 +650,12 @@ setNSFont(NSString* key, NSFont* font)
|
||||||
}
|
}
|
||||||
|
|
||||||
@end /* NSFont */
|
@end /* NSFont */
|
||||||
|
|
||||||
|
int NSConvertGlyphsToPackedGlyphs(NSGlyph *glBuf,
|
||||||
|
int count,
|
||||||
|
NSMultibyteGlyphPacking packing,
|
||||||
|
char *packedGlyphs)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue