OpenCMISS-Zinc C++ API Documentation
Public Types | Public Member Functions | Protected Attributes | List of all members
OpenCMISS::Zinc::Font Class Reference

Font object controlling attributes of rendering text. More...

#include <font.hpp>

Public Types

enum  RenderType {
  RENDER_TYPE_INVALID = CMZN_FONT_RENDER_TYPE_INVALID, RENDER_TYPE_BITMAP = CMZN_FONT_RENDER_TYPE_BITMAP, RENDER_TYPE_PIXMAP = CMZN_FONT_RENDER_TYPE_PIXMAP, RENDER_TYPE_POLYGON = CMZN_FONT_RENDER_TYPE_POLYGON,
  RENDER_TYPE_OUTLINE = CMZN_FONT_RENDER_TYPE_OUTLINE, RENDER_TYPE_EXTRUDE = CMZN_FONT_RENDER_TYPE_EXTRUDE
}
 
enum  TypefaceType { TYPEFACE_TYPE_INVALID = CMZN_FONT_TYPEFACE_TYPE_INVALID, TYPEFACE_TYPE_OPENSANS = CMZN_FONT_TYPEFACE_TYPE_OPENSANS }
 

Public Member Functions

 Font (cmzn_font_id font_id)
 
 Font (const Font &font)
 
Fontoperator= (const Font &font)
 
bool isValid () const
 
cmzn_font_id getId () const
 
char * getName ()
 
int setName (const char *name)
 
bool isBold ()
 
int setBold (bool bold)
 
double getDepth ()
 
int setDepth (double depth)
 
bool isItalic ()
 
int setItalic (bool italic)
 
int getPointSize ()
 
int setPointSize (int size)
 
enum RenderType getRenderType ()
 
int setRenderType (RenderType renderType)
 
TypefaceType getTypefaceType ()
 
int setTypefaceType (TypefaceType typefaceType)
 

Protected Attributes

cmzn_font_id id
 

Detailed Description

Font object controlling attributes of rendering text.

Font object incorporating typeface, size and other attributes for rendering text in graphics.

Member Enumeration Documentation

How a font is rendered in graphics.

Enumerator
RENDER_TYPE_INVALID 

Unspecified render type

RENDER_TYPE_BITMAP 

Font will be rendered using OpenGL bitmap, this is the default render type for font

RENDER_TYPE_PIXMAP 

Font will be rendered using OpenGL pixmap

RENDER_TYPE_POLYGON 

Font will be rendered as 2-D Polygons

RENDER_TYPE_OUTLINE 

Font will be rendered as Polygon but only the outline will be drawn

RENDER_TYPE_EXTRUDE 

Font will be rendered as Polygon with thickness

Enumeration of available font typefaces.

Enumerator
TYPEFACE_TYPE_INVALID 

Unspecified typeface

TYPEFACE_TYPE_OPENSANS 

Font to be rendered with OpenSans typeface

Member Function Documentation

double OpenCMISS::Zinc::Font::getDepth ( )
inline

Get the depth for extrude font type.

Returns
depth of the font.
cmzn_font_id OpenCMISS::Zinc::Font::getId ( ) const
inline

Return the C handle of the Font object.

Returns
C handle of Font if this objects is valid, 0 otherwise.
char* OpenCMISS::Zinc::Font::getName ( )
inline

Return an allocated string containing font name.

Parameters
spectrumhandle to the zinc graphics font.
Returns
allocated string containing font name, otherwise NULL. Up to caller to free using cmzn_deallocate().
int OpenCMISS::Zinc::Font::getPointSize ( )
inline

Get the point size for the font.

Returns
Point size of the font.
enum RenderType OpenCMISS::Zinc::Font::getRenderType ( )
inline

Get the render type of the given font.

Returns
The render type of font, or CMZN_FONT_RENDER_TYPE_INVALID on error.
TypefaceType OpenCMISS::Zinc::Font::getTypefaceType ( )
inline

Get the True Type typeface type of the font.

Returns
The enumerated typeface type, or CMZN_FONT_TYPEFACE_TYPE_INVALID on error.
bool OpenCMISS::Zinc::Font::isBold ( )
inline

Query whether the font is bold.

Returns
Boolean true if font is bold, otherwise false.
bool OpenCMISS::Zinc::Font::isItalic ( )
inline

Query whether the font is italic.

Returns
Boolean true if font is italic, otherwise false.
bool OpenCMISS::Zinc::Font::isValid ( ) const
inline

Check if this is a valid Font object.

Returns
Status True if object is valid, false otherwise.
int OpenCMISS::Zinc::Font::setBold ( bool  bold)
inline

Set whether the font is bold.

Parameters
boldNew state of bold flag, true = bold, false = normal.
Returns
On success OpenCMISS::Zinc::OK, otherwise OpenCMISS::Zinc::ERROR_ARGUMENT.
int OpenCMISS::Zinc::Font::setDepth ( double  depth)
inline

Set the depth for extrude font type.

Parameters
depthdepth of the font to be set.
Returns
status OpenCMISS::Zinc::OK if successfully set depth for font, any other value on failure.
int OpenCMISS::Zinc::Font::setItalic ( bool  italic)
inline

Set whether the font is italic.

Parameters
italicNew state of italic flag, true = italic, false = normal.
Returns
On success OpenCMISS::Zinc::OK, otherwise OpenCMISS::Zinc::ERROR_ARGUMENT.
int OpenCMISS::Zinc::Font::setName ( const char *  name)
inline

Set/change name for <font>.

Parameters
namename to be set to the font
Returns
status OpenCMISS::Zinc::OK if successfully set/change name for font, any other value on failure.
int OpenCMISS::Zinc::Font::setPointSize ( int  size)
inline

Set the point size for font type.

Parameters
sizePoint size of the font to be set, > 0.
Returns
Status OpenCMISS::Zinc::OK on success, otherwise OpenCMISS::Zinc::ERROR_ARGUMENT.
int OpenCMISS::Zinc::Font::setRenderType ( RenderType  renderType)
inline

Set the rendering type of the given font.

Parameters
renderTypethe render type to use for font.
Returns
status OpenCMISS::Zinc::OK if successfully set the font type, any other value on failure.
int OpenCMISS::Zinc::Font::setTypefaceType ( TypefaceType  typefaceType)
inline

Set the True Type typeface type of the font.

Parameters
typefaceTypeThe enumerator of the TrueType typeface to use for font.
Returns
status OpenCMISS::Zinc::OK if successfully set the true type for font, any other value on failure.

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