Class CPFont

CPObject
    extended byCPFont
Direct Known Subclasses:
NSFont

@implementation CPFont : CPObject

The CPFont class allows control of the fonts used for displaying text anywhere on the screen. The primary method for getting a particular font is through one of the class methods that take a name and/or size as arguments, and return the appropriate CPFont.


Method Summary
+(CPFont)boldFontWithName:(CPString)aName size:(float)aSize
          Returns a bold font with the specified name and size.
+(CPFont)boldSystemFontOfSize:(CPSize)aSize
          Returns the bold system font scaled to the specified size.
+(CPFont)fontWithName:(CPString)aName size:(float)aSize
          Returns a font with the specified name and size.
+(CPFont)systemFontOfSize:(CPSize)aSize
          Returns the system font scaled to the specified size.
-(id)initWithCoder:(CPCoder)aCoder
          Initializes the font from a coder.
-(id)NS_initWithCoder:(CPCoder)aCoder
-(CPString)cssString
          Returns the font as a CSS string.
-(void)encodeWithCoder:(CPCoder)aCoder
          Writes the font information out to a coder.
-(CPString)familyName
          Returns the font's family name.
-(float)size
          Returns the font size (in points).

Methods inherited from class CPObject
initialize, alloc, class, instanceMethodForSelector, instancesRespondToSelector, isSubclassOfClass, load, new, setVersion, superclass, version, init, autorelease, awakeAfterUsingCoder, class, classForCoder, classForKeyedArchiver, className, copy, dealloc, description, doesNotRecognizeSelector, forwardInvocation, hash, isEqual, isKindOfClass, isMemberOfClass, isProxy, methodForSelector, methodSignatureForSelector, mutableCopy, performSelector, performSelector, performSelector, release, replacementObjectForArchiver, replacementObjectForCoder, replacementObjectForKeyedArchiver, respondsToSelector, retain, self, superclass


Method Detail

boldFontWithName

+(CPFont)boldFontWithName:(CPString)aName size:(float)aSize
Returns a bold font with the specified name and size.
Parameters:
aName - the name of the font
aSize - the size of the font (in points)
Returns:
the requested bold font

boldSystemFontOfSize

+(CPFont)boldSystemFontOfSize:(CPSize)aSize
Returns the bold system font scaled to the specified size
Parameters:
aSize - the size of the font (in points)
Returns:
the requested bold system font

fontWithName

+(CPFont)fontWithName:(CPString)aName size:(float)aSize
Returns a font with the specified name and size.
Parameters:
aName - the name of the font
aSize - the size of the font (in points)
Returns:
the requested font

systemFontOfSize

+(CPFont)systemFontOfSize:(CPSize)aSize
Returns the system font scaled to the specified size
Parameters:
aSize - the size of the font (in points)
Returns:
the requested system font

initWithCoder

-(id)initWithCoder:(CPCoder)aCoder
Initializes the font from a coder.
Parameters:
aCoder - the coder from which to read the font data
Returns:
the initialized font

NS_initWithCoder

-(id)NS_initWithCoder:(CPCoder)aCoder
Parameters:
aCoder

cssString

-(CPString)cssString
Returns the font as a CSS string

encodeWithCoder

-(void)encodeWithCoder:(CPCoder)aCoder
Writes the font information out to a coder.
Parameters:
aCoder - the coder to which the data will be written

familyName

-(CPString)familyName
Returns the font's family name

size

-(float)size
Returns the font size (in points)

Created on Sat Sep 13 14:15:43 PDT 2008