wxArt2D
Public Member Functions | Protected Attributes | List of all members

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

#include <stylebase.h>

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. More...
 
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. More...
 
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.

Device font-Arial For CAE-Light Italic-300.000000-

Freetype font-Book Antiqua-Bold Italic-300.000000–ANTQUABI.TTF

Definition at line 686 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 157 of file stylebase.cpp.

void a2dFontInfo::SetSize ( double  size)
inline

Set size of the font.

Sets the size of the EM square in world coordinates. Characters/glyphs are designed on this square. Glyphs can be bigger than it. See freetype documentation. The EM sqaure is often 2048 (font units) in size, meaning it has thus resolution.

Definition at line 735 of file stylebase.h.


The documentation for this class was generated from the following files:
a2dFontInfo Class Reference -- Sun Oct 12 2014 17:04:39 -- Sun Oct 12 2014 -- 1.8.5 -- wxArt2D -- . -- Main Page Reference Documentation