wxArt2D
Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends | List of all members

Freetype font class. More...

#include <artbase/stylebase.h>

Inheritance diagram for a2dFontFreetypeData:
Inheritance graph
[legend]
Collaboration diagram for a2dFontFreetypeData:
Collaboration graph
[legend]

Public Member Functions

virtual a2dFontType GetType (void) const
 
 a2dFontFreetypeData (const wxString &filename=wxT(""), double size=0.0, wxFontEncoding encoding=wxFONTENCODING_DEFAULT, int faceindex=0)
 Constructor. More...
 
 a2dFontFreetypeData (const a2dFontFreetypeData &other)
 Copy constructor.
 
virtual ~a2dFontFreetypeData ()
 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...
 
void SetEncodingConverter (wxEncodingConverter *converter)
 
const a2dGlyphGetGlyph (wxChar c) const
 Get the glyph of a single character. More...
 
void SetDeviceHeight (double sizeInPixels)
 to set for load glyph from face, to do proper hinting
 
double GetDeviceHeight ()
 
void GetTextExtent (const wxString &string, double &w, double &h, double &descent, double &externalLeading) const
 
double GetWidth (wxChar c) const
 Get width of a single character.
 
double GetGlyphHeight (wxChar c) const
 
double GetKerning (wxChar c1, wxChar c2) const
 Get kerning space between two characters. More...
 
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
 

Static Public Member Functions

static void GetInfoList (a2dFontInfoList &list)
 
static a2dFontFreetypeDataCreateFont (const a2dFontInfo &info, bool force=false)
 
static void SetLoadFlags (wxInt32 loadMethodMask)
 

Protected Types

typedef vector< a2dGlypha2dGlyphCache
 Glyph Cache. This stores the 'normal' part of the alphabet.
 

Protected Member Functions

void ClearCacheLinkes (void)
 

Protected Attributes

wxString m_filename
 Filename of the vector font.
 
a2dGlyphCache m_glyphcache
 
a2dGlyphHash m_extglyphcache
 Glyph cache. This stores the extended characters.
 
wxChar m_lastChar
 last character for glyph cache one character
 
a2dGlyphm_a2dLastGlyph
 Glyph cache one last character.
 
FT_Face m_face
 freetypelib face struct.
 
wxFontEncoding m_encoding
 encoding setting
 
double m_sizeInPixels
 current text drawn its size in pixels to do proper hinting.
 
long m_faceindex
 what font with index to load from file
 
wxEncodingConverter * m_converter
 encoding converter
 
- 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.
 

Static Protected Attributes

static wxInt32 m_loadMethodMask = a2dFont::a2d_LOAD_DEFAULT
 

Friends

class a2dFont
 

Detailed Description

Freetype font class.

Definition at line 940 of file stylebase.cpp.

Constructor & Destructor Documentation

a2dFontFreetypeData::a2dFontFreetypeData ( const wxString &  filename = wxT( "" ),
double  size = 0.0,
wxFontEncoding  encoding = wxFONTENCODING_DEFAULT,
int  faceindex = 0 
)

Constructor.

\param filename Filename of the vector font.
\param size Size in world coordinates.
Parameters
encodingendocing of font

Definition at line 1062 of file stylebase.cpp.

Member Function Documentation

wxString a2dFontFreetypeData::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 1233 of file stylebase.cpp.

const a2dGlyph * a2dFontFreetypeData::GetGlyph ( wxChar  c) const

Get the glyph of a single character.

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

Definition at line 1359 of file stylebase.cpp.

double a2dFontFreetypeData::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 1614 of file stylebase.cpp.

void a2dFontFreetypeData::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 1267 of file stylebase.cpp.

static void a2dFontFreetypeData::SetLoadFlags ( wxInt32  loadMethodMask)
inlinestatic

Set the way glyphs are loaded by freetype. Important for small fonts. a2d_LOAD_DEFAULT; a2d_LOAD_DEFAULT | a2d_LOAD_NO_HINTING; a2d_LOAD_DEFAULT | a2d_LOAD_FORCE_AUTOHINT;

Definition at line 1018 of file stylebase.cpp.


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