version 3.3

VRS::Font Class Reference

#include <vrs/text/deprecated/font.h>

Inheritance diagram for VRS::Font:

VRS::SharedObj VRS::Visitable

List of all members.

Public Types

enum  FontType {
  BITMAP, PIXMAP, TEXTURE, OUTLINE,
  POLYGON, EXTRUDE
}

Public Member Functions

 VRS_SERIALIZABLE_CLASS_ENUM (FontType)
 defines the geometric representation of characters.
void setFontFileName (const std::string &newFileName)
 Loads a new font file.
const std::string & getFontFileName () const
 Returns the file name of the currently loaded font.
const std::string & getFontName () const
 Returns the font name, if there was one (searchFont has been used).
void setFontType (FontType newType)
 Specifies the type of the geometric representation of font characters.
FontType getFontType () const
 Returns the current geometric type.
void setResolution (double newResolution)
 The resolution defines the geometric resolution of characters.
double getResolution () const
 Returns the current resolution.
GlyphgetGlyph (char ch) const
GlyphgetGlyph (wchar_t ch) const
 Returns an glyph. Internal use only!
double getAdvance (wchar_t from, wchar_t to) const
 Returns the needed advance form one glyph to another. Internal use only!
 VRS_TYPEINFO (Font, SharedObj)
 VRS_SERIALIZABLE (Font)

Static Public Member Functions

static FontcreateFont (const std::string &fontFileName, Font::FontType fType, double resolution=50.0, const std::string &fontName="")
 Constructs a font object for the given font file.
static FontsearchFont (const std::string &fontName, Font::FontType fType, double resolution=50.0)
 Tries to open a font by searching in the system information.
static std::string getFontFileNameByFontName (const std::string &fontName)
 Tries to use the system information to find a font file.
static bool fontAvailable (const std::string &fontName)
 Returns whether a font can be found by using the system information.
static bool fontSupported (const std::string &fontName)
 Returns whether a font is actually supported by VRS.


Detailed Description

DEPRECATED: class for storing the glyphs of a font This class loads any truetype font specified by its filename with a given type. Resolution affects the different font types differently: BITMAP, PIXMAP: height of the glyphs in pixels. recommended higher than 10 TEXTURE: the resolution of the texture in pixel OUTLINE, POLYGON, EXTRUDE: influences the tessellation, in fact, defines the height of a glyph in normal coordinates, but the painter scales it back so that a constant height of 1 in normal coordinates is kept independent from the resolution. recommended above 50 The depth of the EXTRUDED font is always 1. Use the z scaling of the text (or any other z scaling) to manipulate it.

Member Enumeration Documentation

Enumerator:
BITMAP 
PIXMAP 
TEXTURE 
OUTLINE 
POLYGON 
EXTRUDE 


Member Function Documentation

VRS::Font::VRS_SERIALIZABLE_CLASS_ENUM ( FontType   ) 

defines the geometric representation of characters.

static Font* VRS::Font::createFont ( const std::string &  fontFileName,
Font::FontType  fType,
double  resolution = 50.0,
const std::string &  fontName = "" 
) [static]

Constructs a font object for the given font file.

The fontName is for internal use only.

static Font* VRS::Font::searchFont ( const std::string &  fontName,
Font::FontType  fType,
double  resolution = 50.0 
) [static]

Tries to open a font by searching in the system information.

This method will raise a VRS assertion, if the font can not be found.

static std::string VRS::Font::getFontFileNameByFontName ( const std::string &  fontName  )  [static]

Tries to use the system information to find a font file.

This method will return an empty string, if the font could not be found.

static bool VRS::Font::fontAvailable ( const std::string &  fontName  )  [static]

Returns whether a font can be found by using the system information.

static bool VRS::Font::fontSupported ( const std::string &  fontName  )  [static]

Returns whether a font is actually supported by VRS.

void VRS::Font::setFontFileName ( const std::string &  newFileName  ) 

Loads a new font file.

const std::string& VRS::Font::getFontFileName (  )  const

Returns the file name of the currently loaded font.

const std::string& VRS::Font::getFontName (  )  const

Returns the font name, if there was one (searchFont has been used).

void VRS::Font::setFontType ( FontType  newType  ) 

Specifies the type of the geometric representation of font characters.

FontType VRS::Font::getFontType (  )  const

Returns the current geometric type.

void VRS::Font::setResolution ( double  newResolution  ) 

The resolution defines the geometric resolution of characters.

See documentation for the whole class for details

double VRS::Font::getResolution (  )  const

Returns the current resolution.

Glyph* VRS::Font::getGlyph ( char  ch  )  const [inline]

Glyph* VRS::Font::getGlyph ( wchar_t  ch  )  const

Returns an glyph. Internal use only!

double VRS::Font::getAdvance ( wchar_t  from,
wchar_t  to 
) const

Returns the needed advance form one glyph to another. Internal use only!

VRS::Font::VRS_TYPEINFO ( Font  ,
SharedObj   
)

VRS::Font::VRS_SERIALIZABLE ( Font   ) 


The documentation for this class was generated from the following file:

Generated on Thu May 23 06:00:37 2013 by Doxygen 1.5.6
© 2001-2010 Hasso-Plattner-Institut | Impressum | Contact