Vaca::Font Class Reference

#include <Font.h>

Inheritance diagram for Vaca::Font:

Vaca::SmartPtr< T >

List of all members.

Detailed Description

A smart pointer to a font that can be used in Graphics or Widget to draw text.

This is a SmartPtr, so if you copy instances of fonts they will be referencing to the same place. You can't clone fonts because you can't modify them.

Win32: This is a HFONT(W32) wrapper.
See also:
Graphics::setFont, Graphics::drawString

Public Member Functions

 Font ()
 Constructs the default font.
 Font (const Font &font)
 Makes a reference to the specified font.
 Font (const Font &font, FontStyle style)
 Makes a copy of the font changing it's style.
 Font (String familyName, int size, FontStyle style=FontStyle::Regular)
 Font (HFONT hfont)
 Wrapper constructor for HFONT.
 Font (LPLOGFONT lplf)
virtual ~Font ()
int getPointSize () const
 Returns the size of the font in points.
FontStyle getStyle () const
Fontoperator= (const Font &font)
 Makes a copy of font.
HFONT getHandle () const
bool getLogFont (LPLOGFONT lplf) const

Private Member Functions

void assign (LPLOGFONT lplf)


class Application

Constructor & Destructor Documentation

Font::Font (  ) 

Constructs the default font.

Font::Font ( const Font font  ) 

Makes a reference to the specified font.

Font::Font ( const Font font,
FontStyle  style 

Makes a copy of the font changing it's style.

Font::Font ( String  familyName,
int  size,
FontStyle  style = FontStyle::Regular 

Font::Font ( HFONT  hfont  )  [explicit]

Wrapper constructor for HFONT.

Font::Font ( LPLOGFONT  lplf  ) 

Font::~Font (  )  [virtual]

Member Function Documentation

int Font::getPointSize (  )  const

Returns the size of the font in points.

-1 if there is an error getting the point size.

FontStyle Font::getStyle (  )  const

Font & Font::operator= ( const Font font  ) 

Makes a copy of font.

You can safely delete the font after this method.

HFONT Font::getHandle (  )  const

bool Font::getLogFont ( LPLOGFONT  lplf  )  const

void Font::assign ( LPLOGFONT  lplf  )  [private]

Friends And Related Function Documentation

friend class Application [friend]