## class XGFont

> Declared in <XDraw.h>

> Font management class. This is the class object which is used to handle font by encapsulating them

Construction/Destruction

> XGFont::XGFont
> XGFont::~XGFont

Attach/Detach Semantics

> XGFont::Attach
> XGFont::Detach

Font Specification

> XGFont::GetFontFlags
> XGFont::GetFontName
> XGFont::GetFontSize
> XGFont::GetFontVariant
> XGFont::LoadFont
> XGFont::SetFontFlags
> XGFont::SetFontName
> XGFont::SetFontSize

Construction/Destruction

XGFont::XGFont

> Usage: XGFont::XGFont()

> Create a font, marked as attached.

XGFont::~XGFont

> Usage: XGFont::~XGFont()

> Delete a font. Normally you should use the 'Detach' method instead of directly destroying this object; otherwise, the font cache can become confused.

Attach/Detach Semantics

XGFont::Attach

> Usage: void Attach(void)

> This increments the 'attach' count of the font. When the font is first created, it's created with an attach count of one.

XGFont::Detach

> Usage: void XGFont::Detach(void)

> Detach; this detaches this font, and when this hits zero, delete

Font Specification

XGFont::GetFontFlags

> Usage: short GetFontFlags()const

> Get the flags associated with this font. This returns the 'bold', 'italic' and 'underline' settings

XGFont::GetFontName

> Usage: void XGFont::GetFontName(char*f)const

> Get the name of this font

XGFont::GetFontSize

> Usage: short GetFontSize(void)const

> Returns the current size of this font in points.

XGFont::GetFontVariant

> Usage: XGFont*XGFont::GetFontVariant(XGFont*f,short newflags)

> This allows me to get a font which is exactly like the font I have on hand, but with the 'underline', 'italic', or 'bold' attributes different. This also sets the 'attach' flag

XGFont::LoadFont

> Usage: XGFont*XGFont::LoadFont(short resID)

> Load the font from a resource

XGFont::SetFontFlags

> Usage: void XGFont::SetFontFlags(short f)

> Set the font flags. This <<only>> works if there is only one attached object; the assumption is that this is not in use or shared with someone else

XGFont::SetFontName

> Usage: void XGFont::SetFontName(const char*f)

> Set the font name. This <<only>> works if there is only one attached object; the assumption is that this is not in use or shared with someone else

XGFont::SetFontSize

> Usage: void XGFont::SetFontSize(short f)

> Set the font size. This <<only>> works if there is only one attached object; the assumption is that this is not in use or shared with someone else