Overview
Examples
Screenshots
Comparisons
Applications
Download
Manual
Status & Roadmap
FAQ
Authors & License
Forums
Wiki
Funding Ultimate++
Search on this site











SourceForge.net Logo



class Font : private AssignValueTypeNo<Font, FONT_V, Moveable<Font> >

Font is a concrete class that describes the appearance of text. It is Moveable, has cheap copy operation and is Value convertible with rich-Value abilities.

 

It is storing several attributes to describe the text. The corresponding system font is stored in the form of face index - each system font has specific index value. There are some predefined indexes for common fonts:

 

Font::STDFONT

Standard GUI font defined by platform. Can be altered by Draw::SetStdFont.

Font::ROMAN

Standard serif font.

Font::ARIAL

Standard sans-serif font.

Font::COURIER

Standard monospaced font.

Font::SYMBOL

Standard symbol font.

 

Text metrics for Font instance can be obtained by Info method in the form of FontInfo value.

 

static int GetFaceCount()

Returns the number of face-names available.

 

static String GetFaceName(int index)

Returns the name of face index.

 

static int FindFaceNameIndex(const char *name)

Finds the face index of face-name.

 

static dword GetFaceInfo(int index)

Returns the information about face index as combination of binary flags:

 

Font::FIXEDPITCH

Font-face is monospaced.

Font::SCALEABLE

Font-face is freely scalable (it is in vector format, e.g. Truetype).

Font::SYMBOLTYPE

Font contains symbols instead of letters.

Font::COMPOSED

U++ uses special code to compose missing Latin characters by combining existing characters.

 

int GetFace() const

Face index of Font.

 

int GetHeight() const

Returns the height of font.

 

int GetWidth() const

Return the width of font or 0 for default width.

 

String GetFaceName() const

Returns the face-name text for current instance.

 

dword GetFaceInfo() const

Same as GetFaceInfo(GetFace()).

 

FontInfo Info() const

Returns the object providing complete information about font metrics.

 

FontFace(int n)

Sets the face index.

 

FontHeight(int n)

Sets the font height (in pixels/dots).

 

FontWidth(int n)

Sets the font width. Use 0 for default width (in pixels/dots).

 

FontBold()

FontNoBold()

FontBold(bool b)

FontItalic()

FontNoItalic()

FontItalic(bool b)

FontUnderline()

FontNoUnderline()

FontUnderline(bool b)

FontStrikeout()

FontNoStrikeout()

FontStrikeout(bool b)

Sets or unsets bold/italic/undeline/strikeout modes.

 

FontNonAntiAliased()

FontNoNonAntiAliased()

FontNonAntiAliased(bool b)

Sets/unsets non-anti-aliased flag. This indicates that anti-aliasing should not be used when painting the font.

 

bool IsBold() const

bool IsItalic() const

bool IsUnderline() const

bool IsStrikeout() const

Tests whether bold/italic/underline/strikeout is active.

 

bool IsNonAntiAliased() const

True if NonAntiAliased is active.

 

FontFaceName(const String& name)

Sets the face to name. If name is not valid face-name, Font is set to Null.

 

Font operator()() const

Returns a copy of Font. Useful to simplify notation when altering existing Font values.

 

Font operator()(int nconst

Returns a copy of Font, with height changed to n.

 

void Serialize(Stream& s)

Serializes the font value (face index is stored as face-name text).

 

bool operator==(Font fconst

bool operator!=(Font fconst

Compares two Font instances.

 

dword GetHashValue() const

Returns the font hash value.

 

bool IsNull() const

True if Font is Null.

 

Font()

Initializes Font to STDFONT, default height, all attributes not active.

 

Font(int face, int height)

Initializes font to face index and height.

 

Font(const Nuller&)

Sets the font Null.

 

operator Value() const

Converts the Font to the Value (font is rich Value).

 

Font(const Value& q)

Converts the Value to the Font.