cee::vis::Font Class Reference

A font used for text drawing. More...

Public Member Functions

virtual unsigned int pointSize () const
 Returns the point size of the font. More...
 
Str name () const
 Returns the font name of the font. More...
 
float lineSpacing () const
 Returns the line spacing. More...
 
void setLineSpacing (float factor)
 Sets the line spacing. More...
 
- Public Member Functions inherited from cee::RefCountedObject
void addRef () const
 Increments the reference count for this object. More...
 
void release () const
 Decrements the reference count for this object. More...
 
int refCount () const
 Returns the reference count for this object. More...
 
void setRefCountZero () const
 Sets the ref count to zero, but DOES NOT delete the object. More...
 

Static Public Member Functions

static PtrRef< FontcreateNormalFont ()
 Creates and returns a 8 pt Droid Sans Regular font. More...
 
static PtrRef< FontcreateLargeFont ()
 Creates and returns a 16 pt Droid Sans Regular font. More...
 
static PtrRef< FontcreateTrueTypeFont (const Str &filename, unsigned int pointSize)
 Creates and returns a true type font using the given font file name and point size. More...
 
Inheritance diagram for cee::vis::Font:
cee::RefCountedObject cee::vis::TrueTypeFont

Detailed Description

A font used for text drawing.

Ceetron Desktop Components has two built in fonts that work without any dependencies:

These fonts are built into Ceetron Desktop Components and have no external dependencies.

For true type font support, use cee::vis::TrueTypeFont instead.

Member Function Documentation

PtrRef< Font > cee::vis::Font::createLargeFont ( )
static

Creates and returns a 16 pt Droid Sans Regular font.

This font is built into Ceetron Desktop Components and have no external dependencies.

PtrRef< Font > cee::vis::Font::createNormalFont ( )
static

Creates and returns a 8 pt Droid Sans Regular font.

This font is built into Ceetron Desktop Components and have no external dependencies.

PtrRef< Font > cee::vis::Font::createTrueTypeFont ( const Str filename,
unsigned int  pointSize 
)
static

Creates and returns a true type font using the given font file name and point size.

A valid .ttf file must be provided.

Returns NULL if an error occurred creating the font from the given file (file not found, illegal format etc).

Deprecated:
Use cee::vis::TrueTypeFont(const Str&, unsigned int) instead. (Note: Not available on Apple iOS)
float cee::vis::Font::lineSpacing ( ) const

Returns the line spacing.

Line spacing is measured as a proportion of the font height. Default is 1.75 (175%)

cee::Str cee::vis::Font::name ( ) const

Returns the font name of the font.

unsigned int cee::vis::Font::pointSize ( ) const
virtual

Returns the point size of the font.

Reimplemented in cee::vis::TrueTypeFont.

void cee::vis::Font::setLineSpacing ( float  factor)

Sets the line spacing.

Line spacing is measured as a proportion of the font height. Default is 1.75 (175%)