Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CP_Font Class Reference

A class to manage an OSs native font.

Inheritance diagram for CP_Font:

CP_M_RefCounted List of all members.

Public Member Functions

Constructor / Destructor
 CP_Font (CP_Canvas &inOwnerCanvas)
 Constructor.
virtual ~CP_Font () throw ()
 Destructor.
OwnerCanvas
CP_Canvas GetOwnerCanvas ()
Save / Restore
void Save ()
void Restore ()
Getters
SInt16 Height ()
SInt16 AscentHeight ()
CP_String GetName ()
SInt16 GetPointSize ()
SInt16 GetFace ()
Setters
void SetName (const CP_String &inFontName)
void SetSize (const SInt16 inFontSize)
void SetFace (const SInt16 inFontFace)
void SetNameAndSize (const CP_String &inFontName, SInt16 inFontSize)
void SetFromFontSpec (CP_FontSpec &inFontSpec)
void SetCanvas (CP_Canvas &inCanvas)
void UseInCanvas (CP_Canvas &inCanvas)
void ResetCanvas ()
void SetDefault ()

Protected Member Functions

Update
void UpdateFont ()

Protected Attributes

CP_Canvas fOwnerCanvas
CP_String fFontName
SInt16 fFontSize
SInt16 fFontFace
SInt16 fSavedFont
SInt16 fSavedSize
SInt16 fSavedMode
SInt16 fSavedFace
SInt16 fFontNumber
SInt16 fSavedFontNumber
SInt16 fSavedFontFace

Constructor & Destructor Documentation

CPLAT_Begin_Namespace_CPLAT CP_Font::CP_Font CP_Canvas inOwnerCanvas  ) 
 

Constructor.

Parameters:
inOwnerCanvas The canvas that this font is being used in.
Exceptions:
none 

CP_Font::~CP_Font  )  throw () [virtual]
 

Destructor.

Exceptions:
none 


Member Function Documentation

CP_Canvas CP_Font::GetOwnerCanvas  ) 
 

Returns the CP_Canvas object that this font is being used in.

Exceptions:
none 
Returns:
CP_Canvas The canvas using this font.

void CP_Font::Save  ) 
 

Saves the current font state, and if supported by the OS, the OSs font state.

Exceptions:
none 
Returns:
void

void CP_Font::Restore  ) 
 

Restores the previously saved font state, and if supported by the OS, the OSs font state.

Exceptions:
none 
Returns:
void

CP_UseDepreciated_10_4_APIs

SInt16 CP_Font::Height  ) 
 

Return the height of the font. This will be the distance from the top of the ascent to the bottom of the leaading fields.

Exceptions:
none 
Returns:
SInt16 The height of the font.

SInt16 CP_Font::AscentHeight  ) 
 

Return the ascent height of the font.

Exceptions:
none 
Returns:
SInt16 The height of the font.

CP_String CP_Font::GetName  ) 
 

Return the name of the font as a CP_String.

Exceptions:
none 
Returns:
CP_String The name of the font.

SInt16 CP_Font::GetPointSize  ) 
 

Return the point size of the given font, measured in points.

Exceptions:
none 
Returns:
SInt16 The size of the font.

SInt16 CP_Font::GetFace  ) 
 

Return the face of the font, ie normal, bold, italic, etc..

Exceptions:
none 
Returns:
SInt16 The face of the font.

void CP_Font::SetName const CP_String inFontName  ) 
 

Set the name of the font from the passed in CP_String.

Parameters:
inFontName The name of the font.
Exceptions:
none 
Returns:
void

void CP_Font::SetSize const SInt16  inFontSize  ) 
 

Set the size of the font in points.

Parameters:
inFontSize The size of the font.
Exceptions:
none 
Returns:
void

void CP_Font::SetFace const SInt16  inFontFace  ) 
 

Set the face of this font.

Parameters:
inFontFace The face of the font.
Exceptions:
none 
Returns:
void

void CP_Font::SetNameAndSize const CP_String inFontName,
SInt16  inFontSize
 

Sets the name and point size of this font.

Parameters:
inFontName The name of the font.
inFontSize The size of the font.
Exceptions:
none 
Returns:
void

void CP_Font::SetFromFontSpec CP_FontSpec inFontSpec  ) 
 

Setup the font based on information contained in a CP_FontSpec.

Parameters:
inFontSpec The CP_FontSpec that describes this font.
Exceptions:
none 
Returns:
void

void CP_Font::SetCanvas CP_Canvas inCanvas  ) 
 

Set the CP_Canvas object that this font is being used in.

Parameters:
inCanvas The CP_Canvas to use this font in.
Exceptions:
none 
Returns:
void

void CP_Font::UseInCanvas CP_Canvas inCanvas  ) 
 

Update the associated CP_Canvas object with the font information from this object.

Parameters:
inCanvas The CP_Canvas object to associate this font with.
Exceptions:
none 
Returns:
void

void CP_Font::ResetCanvas  ) 
 

Reset the canvas object associated with this font, currently this is used only on Windows to release the GDI HFONT.

Exceptions:
none 
Returns:
void

void CP_Font::SetDefault  ) 
 

Set the default values for this font. This will be a normal system font.

Exceptions:
none 
Returns:
void

void CP_Font::UpdateFont  )  [protected]
 

Rebuild the font for the canvas, currently used in Windows only to update the GDI HFONT for the canvas.

Exceptions:
NULL exceptions
Returns:
void

UInt32 CP_M_RefCounted::AddReference  )  const [inherited]
 

Add a reference to our object, returning the new reference count.

Exceptions:
none 
Returns:
UInt32 const Returns the new reference count.

UInt32 CP_M_RefCounted::RemoveReference  )  const [inherited]
 

Remove a reference to our object, returning the new reference count. If the count is 0, then this object is also deleted, and 0 is returned.

Exceptions:
none 
Returns:
UInt32 const Returns the new reference count.

void CP_M_RefCounted::Autorelease  )  const [inherited]
 

Add the object to the topmost auto-release pool. This will ensure that the object is eventually released.

See also:
CP_AutoReleasePool
Exceptions:
none 
Returns:
void

UInt32 CP_M_RefCounted::GetRefCount  )  const [inherited]
 

Returns the current ref count.

Exceptions:
none 
Returns:
UInt32 The current referencce count.


Member Data Documentation

CP_Canvas CP_Font::fOwnerCanvas [protected]
 

CP_String CP_Font::fFontName [protected]
 

CP_Canvas font is used in.

SInt16 CP_Font::fFontSize [protected]
 

Name of the font.

SInt16 CP_Font::fFontFace [protected]
 

Size of the font, measured in points.

SInt16 CP_Font::fSavedFont [protected]
 

Face for the font, normal, bold, italic, underline, etc.

SInt16 CP_Font::fSavedSize [protected]
 

Saved font from the canvas. Used in Save/Restore to temporarily hold font info.

SInt16 CP_Font::fSavedMode [protected]
 

Saved font size from the canvas. Used in Save/Restore to temporarily hold font info.

SInt16 CP_Font::fSavedFace [protected]
 

Saved font drawing mode from the canvas. Used in Save/Restore to temporarily hold font info.

SInt16 CP_Font::fFontNumber [protected]
 

Saved font face from the canvas. Used in Save/Restore to temporarily hold font info.

SInt16 CP_Font::fSavedFontNumber [protected]
 

MacOS font number for this font.

SInt16 CP_Font::fSavedFontFace [protected]
 

MacOS font number for this font saved version.


The documentation for this class was generated from the following files:
Generated on Tue Sep 20 20:21:46 2005 for CPLAT_MacOS by  doxygen 1.4.0