a2dFontInfo Class Reference
[objects used for styling a2dCanvasObject'sText related classes]

Font info class, used as a single element for enumerating fonts. More...

#include <stylebase.h>

List of all members.

Public Member Functions

 a2dFontInfo ()
 Constructor.
 a2dFontInfo (const wxString &type, const wxString &name, const wxString &style=wxT(""), double size=1.0, const wxString &extra=wxT(""))
 Constructor.
 a2dFontInfo (const wxString &type, const wxString &name, const wxString &style, const wxString &extra=wxT(""))
 Constructor.
 a2dFontInfo (const wxString &info)
 Constructor.
a2dFontInfooperator= (const a2dFontInfo &other)
 Assignment operator.
bool operator== (const a2dFontInfo &other) const
 Comparison operator.
a2dFont CreateFont (double size)
 Create this enumerated font.
const wxString & GetType () const
 Get type of font, e.g. Freetype or Stroke.
void SetType (const wxString &type)
 Set type of font, e.g. Freetype or Stroke.
const wxString & GetName () const
 Get name of font, e.g. Arial.
void SetName (const wxString &name)
 Set name of font, e.g. Arial.
const wxString & GetStyle () const
 Get style of font, e.g. Bold.
void SetStyle (const wxString &style)
 Set style of font, e.g. Bold.
double GetSize () const
 Get size of the font.
void SetSize (double size)
 Set size of the font.
wxString CreateString () const
 Assemble a string containing this class in a readable format.
void ParseString (wxString string)
 Fill this class from a string.
const wxString & GetExtra () const
 Get the extra information ( e.g. the filename of the font ).
void SetExtra (const wxString &extra)
 Set the extra information ( e.g. the filename of the font ).

Protected Attributes

wxString m_type
 Font type.
wxString m_name
 Font name.
wxString m_style
 Font style.
double m_size
 Font Size.
wxString m_extra
 Extra information (e.g. the filename of the font).


Detailed Description

Font info class, used as a single element for enumerating fonts.

The a2dFontInfo class is used as a font description class. Fonts can be generated from this. It is also used for saving and loading a font.

This class consists of six items

When a font description in string form is needed call CreateString(). (or the other way with ParseString() ).

This will create a string in the form of "[FAMILY-LIST] [STYLE-OPTIONS] [SIZE]", where FAMILY-LIST is a comma separated list of families optionally terminated by a comma, STYLE_OPTIONS is a whitespace separated list of words where each WORD describes one of style, variant, weight, or stretch, and SIZE is an decimal number (size in points). Any one of the options may be absent. If FAMILY-LIST is absent, then the family_name field of the resulting font description will be initialized to NULL. If STYLE-OPTIONS is missing, then all style options will be set to the default values. If SIZE is missing, the size in the resulting font description will be set to 0.

The string representation is compatible with the pango font descriptions.

e.g.

Freetype font,Arial Bold 10.0

or just

Arial Bold 10.0

Definition at line 668 of file stylebase.h.


Member Function Documentation

a2dFont a2dFontInfo::CreateFont ( double  size  ) 

Create this enumerated font.

This function will allways return a valid font. NULL will never be returned

Definition at line 248 of file stylebase.cpp.


The documentation for this class was generated from the following files:
a2dFontInfo Class Reference -- Tue Aug 31 18:27:31 2010 -- 31 Aug 2010 -- 1.5.5 -- wxArt2D -- . -- Main Page Reference Documentation