wxArt2D
Public Member Functions | Static Public Member Functions | Protected Attributes | Friends | List of all members
a2dFontStrokeData Class Reference
Inheritance diagram for a2dFontStrokeData:
Inheritance graph
[legend]
Collaboration diagram for a2dFontStrokeData:
Collaboration graph
[legend]

Public Member Functions

virtual a2dFontType GetType (void) const
 
 a2dFontStrokeData (const wxString &filename=wxT(""), double size=0.0, bool monoSpaced=false, double weight=0.0)
 Constructor. More...
 
 a2dFontStrokeData (const a2dFontStrokeData &other)
 Copy constructor.
 
virtual ~a2dFontStrokeData ()
 Destructor.
 
void SetFilename (const wxString &filename)
 Set the font filename and load the font. More...
 
wxString GetFilename (bool filenameonly=false) const
 Get the font filename. More...
 
double GetWeight () const
 Get the weight of the font. More...
 
void SetWeight (double weight)
 Set the weight of the font. More...
 
void SetWeight (const wxString &weight)
 Set the weight of the font, from a string. More...
 
double GetWidth (wxChar c) const
 Get width of a single character.
 
double GetKerning (wxChar c1, wxChar c2) const
 Get kerning space between two characters. More...
 
double GetStrokeWidth () const
 Get stroke width. More...
 
a2dStrokeGlyph GetGlyph (wxChar c) const
 Get the glyph of a single character. More...
 
virtual bool GetVpath (wxChar c, a2dVpath &glyph, const a2dAffineMatrix &affine=a2dIDENTITY_MATRIX)
 
- Public Member Functions inherited from a2dFontRefData
 a2dFontRefData (double size)
 
 a2dFontRefData ()
 constructor
 
 a2dFontRefData (const a2dFontRefData &other)
 
bool Ok ()
 
virtual void SetSize (double size)
 
double GetSize () const
 
double GetDescent () const
 
double GetLineHeight () const
 
virtual void GetTextExtent (const wxString &string, double &w, double &h, double &descent, double &externalLeading) const
 

Static Public Member Functions

static void GetInfoList (a2dFontInfoList &list)
 
static a2dFontStrokeDataCreateFont (const a2dFontInfo &info, bool force=false)
 

Protected Attributes

wxString m_filename
 Filename of the font.
 
wxUint16 * m_width
 Width storage.
 
a2dStrokeGlyphm_characters
 Glyph storage.
 
wxUint16 m_beginchar
 First character in font.
 
wxUint16 m_count
 Number of characters in font.
 
wxUint16 m_intsize
 Font size in internal coordinates.
 
double m_weight
 Font weight.
 
bool m_monoSpaced
 
- Protected Attributes inherited from a2dFontRefData
a2dFontInfo m_fontinfo
 Font info.
 
double m_height
 Font height cache normalized to a font height of 1.
 
double m_desc
 Font descender cache normalized to a font height of 1.
 
double m_lead
 Font external leading normalized to a font height of 1.
 
bool m_ok
 True if a valid font is set.
 

Friends

class a2dFont
 

Detailed Description

Definition at line 2038 of file stylebase.cpp.

Constructor & Destructor Documentation

a2dFontStrokeData::a2dFontStrokeData ( const wxString &  filename = wxT( "" ),
double  size = 0.0,
bool  monoSpaced = false,
double  weight = 0.0 
)

Constructor.

Parameters
filenameFilename of the vector font.
sizeSize in world coordinates.
monoSpacedif true, all character will have eqaul distance

Definition at line 2171 of file stylebase.cpp.

Member Function Documentation

wxString a2dFontStrokeData::GetFilename ( bool  filenameonly = false) const

Get the font filename.

Parameters
filenameonlyThe returned filename will be stripped of drive-letters and directories.
Returns
The filename of the font.

Definition at line 2213 of file stylebase.cpp.

a2dStrokeGlyph a2dFontStrokeData::GetGlyph ( wxChar  c) const

Get the glyph of a single character.

Returns
The glyph of the character, in a coordinate space, normalized to the font size.

Definition at line 2504 of file stylebase.cpp.

double a2dFontStrokeData::GetKerning ( wxChar  c1,
wxChar  c2 
) const
virtual

Get kerning space between two characters.

Kerning is a method, which moves characters closer together/further apart, to improve the look of the font. Eg. the letter combination LT will be moved closer together. The return value is negative or positive, to respectively move characters closer together, or further apart.

Reimplemented from a2dFontRefData.

Definition at line 2498 of file stylebase.cpp.

double a2dFontStrokeData::GetStrokeWidth ( ) const

Get stroke width.

Returns
The stroke width in world coordinates. In case of a pixel font, 0.0 is returned.
See Also
GetWeight()

Definition at line 2485 of file stylebase.cpp.

double a2dFontStrokeData::GetWeight ( ) const
inline

Get the weight of the font.

Returns
The weight (in this case stroke width) in percentages of the font size. There are two exceptions. 0: Draws the font with a pen of 1 pixel wide. -1: Draws the font with a normalized pen, as the font-designer intended it.

Definition at line 2074 of file stylebase.cpp.

void a2dFontStrokeData::SetFilename ( const wxString &  filename)

Set the font filename and load the font.

Parameters
filenameThe filename of the font. This may either be a full path, or just the fontname. In the latter case, the fontpath of a2dGlobals will be used to search the font.
See Also
a2dGlobal

Definition at line 2224 of file stylebase.cpp.

void a2dFontStrokeData::SetWeight ( double  weight)

Set the weight of the font.

Parameters
weightThe weight (in this case stroke width) in percentages of the font size. There are two exceptions. 0: Draws the font with a pen of 1 pixel wide. -1: Draws the font with a normalized pen, as the font-designer intended it.

Definition at line 2419 of file stylebase.cpp.

void a2dFontStrokeData::SetWeight ( const wxString &  weight)

Set the weight of the font, from a string.

Parameters
weightOne of: "Normalized Pen", "Pixel pen" or a string starting with the width in percentages, ending with %.

Definition at line 2435 of file stylebase.cpp.


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