# cWin32BitmapFont Class Reference
[Widgets]

A 2D, texture-based, win32-specific implementation of cFont. More...

`#include <CFont.h>`

Inheritance diagram for cWin32BitmapFont:

[legend]

List of all members.

## Public Member Functions
| cWin32BitmapFont ()
| Constructor of cWin32BitmapFont.
virtual | ~cWin32BitmapFont ()
| Destructor of cWin32BitmapFont.
virtual int | renderString (const char *a_str)
virtual void | setFontFace (const char *a_faceName)
| Change the Font face; may require re-initializing the Font.
virtual void | setPointSize (const float &a_pointSize)
| Change the Font size; may require re-initializing the Font.
virtual LOGFONT * | getLogFont ()
virtual int | getCharacterWidth (const unsigned char &a_char)
| Get the width of a particular character.
## Public Attributes
bool | m_solidFont
## Protected Member Functions
int | initialize ()
| Should be called with an active rendering context; returns 0 for success, -1 for error.
int | uninitialize ()
| Clean up.
## Protected Attributes
int | m_bitmap_font_base
| The base openGL display list used for our Font, or -1 if we're uninitialized.
LOGFONT | m_logfont
| Information about the actual win32 Font.
float | m_outlineFontDeviation
| Parameter relevant to outline Fonts only.
float | m_outlineFontExtrusion
| Parameter relevant to outline Fonts only.
bool | m_usePolygonsForOutlineFonts
| Parameter relevant to outline Fonts only.

## Detailed Description

A 2D, texture-based, win32-specific implementation of cFont.

## Constructor & Destructor Documentation

cWin32BitmapFont::cWin32BitmapFont | ( |  | ) |

Constructor of cWin32BitmapFont.

Constructor for cWin32BitmapFont.

cWin32BitmapFont::~cWin32BitmapFont | ( |  | ) | `[virtual]`

Destructor of cWin32BitmapFont.

Destructor for cWin32BitmapFont.

## Member Function Documentation

int cWin32BitmapFont::getCharacterWidth | ( | const unsigned char & | a_char | ) | `[virtual]`

Get the width of a particular character.

Get the width of a particular character

Parameters:

  | a_char | The character (e.g. 'a') to look up. Characters less than 32 ('A') will generate errors.

Returns:
  Returns the width of this character in pixels, or -1 for an error.

Reimplemented from cFont.

virtual LOGFONT* cWin32BitmapFont::getLogFont | ( |  | ) | `[inline, virtual]`

Used to access win32 font information directly; use with care and be aware that the font may need reinitialization if you modify options _after_ the font is used for rendering.

int cWin32BitmapFont::initialize | ( |  | ) | `[protected]`

Should be called with an active rendering context; returns 0 for success, -1 for error.

Initialize the internal font representation

Returns:
  0 for success, -1 for error

int cWin32BitmapFont::renderString | ( | const char * | a_str | ) | `[virtual]`

Renders a string, optionally a string w/embedded printf specifiers.
Returns 0 for success, -1 for error.

Renders an actual string of text, initializing the font if necessary.

Parameters:

  | a_str | The string to render; should not include newlines.

Returns:
  return 0 for success, -1 for error.

Implements cFont.

void cWin32BitmapFont::setFontFace | ( | const char * | a_faceName | ) | `[virtual]`

Change the Font face; may require re-initializing the Font.

Change the font face, possibly marking the font for re-initialization.

Parameters:

  | a_faceName | The new face name.

Reimplemented from cFont.

void cWin32BitmapFont::setPointSize | ( | const float & | a_pointSize | ) | `[virtual]`

Change the Font size; may require re-initializing the Font.

Change the font size, possibly marking the font for re-initialization.

Parameters:

  | a_pointSize | The new font size.

Reimplemented from cFont.

int cWin32BitmapFont::uninitialize | ( |  | ) | `[protected]`

Clean up.

Clean up a win32 bitmapped font

Returns:
  Returns 0 for success, -1 for error.

## Member Data Documentation

bool cWin32BitmapFont::m_solidFont

If you want an outline Font instead of a solid font, set this to false before using the Font for rendering.

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

- D:/CHAI3D/build-2-0-0/2.0.0/win32/src/widgets/CFont.h
- D:/CHAI3D/build-2-0-0/2.0.0/win32/src/widgets/CFont.cpp

CHAI3D 2.0.0 documentation
Please address any questions to support@chai3d.org
(C) 2003-2009 - CHAI 3D
All Rights Reserved.