# Visualization Library

A lightweight C++ OpenGL middleware for 2D/3D graphics

[Home] [Tutorials] [All Classes] [Grouped Classes]

Public Member Functions | Protected Attributes

# vl::FontManager Class Reference

The FontManager class keeps a map associating a font path, size and smoothing flag to a Font object. More...

`#include <FontManager.hpp>`

Inheritance diagram for vl::FontManager:

List of all members.

## Public Member Functions

virtual const char * | className ()
| Returns the name of the class.
| FontManager (void *free_type_library=NULL)
| Constructor: uses the given FT_Library handle otherwise will initialize and use its own FT_Library.
| ~FontManager ()
| Destructor: releases all fonts and disposes the FT_Library if not NULL.
Font * | acquireFont (const String &font, int size, bool smooth=false)
| Creates or returns an already created Font.
const std::vector< ref< Font > > & | fonts () const
| Returns the list of Fonts created till now.
void | releaseFont (Font *font)
| Releases a given Font and its associated resources and memory.
void | releaseAllFonts ()
| Releases all Fonts and associated resources and memory.
const void * | freeTypeLibrary () const
| Returns the FT_Library handle.
void * | freeTypeLibrary ()
| Returns the FT_Library handle.
void * | setFreeTypeLibrary (void *ftlib)
| Sets the FT_Library to the given one and returns the former one.

## Protected Attributes

std::vector< ref< Font > > | mFonts
void * | mFreeTypeLibrary

## Detailed Description

The FontManager class keeps a map associating a font path, size and smoothing flag to a Font object.

See also:
  - Font
  - Text
  - Actor
  - VectorGraphics

Definition at line 45 of file FontManager.hpp.

## Constructor & Destructor Documentation

FontManager::FontManager | ( | void * | free_type_library = `NULL` ) |

Constructor: uses the given FT_Library handle otherwise will initialize and use its own FT_Library.

Definition at line 42 of file FontManager.cpp.

References vl::Log::error(), mFreeTypeLibrary, and VL_TRAP.

FontManager::~FontManager | ( | ) |

Destructor: releases all fonts and disposes the FT_Library if not NULL.

If you don't want the FontManager to dispose the associated FT_Library then call setFreeTypeLibrary(NULL) before the FontManager is destroyed.

Definition at line 58 of file FontManager.cpp.

References mFreeTypeLibrary, and releaseAllFonts().

## Member Function Documentation

virtual const char* vl::FontManager::className | ( | ) | `[inline, virtual]`

Returns the name of the class.

Reimplemented from vl::Object.

Definition at line 48 of file FontManager.hpp.

Font * FontManager::acquireFont | ( | const String & | font,
|  | int | size,
|  | bool | smooth = `false`
| ) |  |

Creates or returns an already created Font.

Definition at line 68 of file FontManager.cpp.

References fonts(), vl::ref< T >::get(), and mFonts.

Referenced by vl::VectorGraphics::setFont(), and vl::VolumePlot::VolumePlot().

const std::vector< ref<Font> >& vl::FontManager::fonts | ( | ) | const`[inline]`

Returns the list of Fonts created till now.

Definition at line 62 of file FontManager.hpp.

Referenced by acquireFont().

void FontManager::releaseFont | ( | Font * | font ) |

Releases a given Font and its associated resources and memory.

Definition at line 87 of file FontManager.cpp.

References mFonts.

void FontManager::releaseAllFonts | ( | ) |

Releases all Fonts and associated resources and memory.

Definition at line 94 of file FontManager.cpp.

References mFonts.

Referenced by ~FontManager().

const void* vl::FontManager::freeTypeLibrary | ( | ) | const`[inline]`

Returns the FT_Library handle.

Definition at line 71 of file FontManager.hpp.

void* vl::FontManager::freeTypeLibrary | ( | ) | `[inline]`

Returns the FT_Library handle.

Definition at line 74 of file FontManager.hpp.

void* vl::FontManager::setFreeTypeLibrary | ( | void * | ftlib ) | `[inline]`

Sets the FT_Library to the given one and returns the former one.

It is the user responsibility to dispose the returned one (if non-NULL).

Definition at line 78 of file FontManager.hpp.

## Member Data Documentation

std::vector< ref<Font> > vl::FontManager::mFonts`[protected]`

Definition at line 81 of file FontManager.hpp.

Referenced by acquireFont(), releaseAllFonts(), and releaseFont().

void* vl::FontManager::mFreeTypeLibrary`[protected]`

Definition at line 82 of file FontManager.hpp.

Referenced by FontManager(), and ~FontManager().

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

- D:/VL/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vlGraphics/FontManager.hpp
- D:/VL/BuildSystem/VL_DISTRO/Visualization_Library_SDK/src/vlGraphics/FontManager.cpp

Visualization Library v2011.05.1142 Reference Documentation
Copyright 2005-2011 Michele Bosi. All rights reserved.
Updated on Thu May 26 2011 22:51:40.
Permission is granted to use this page to write and publish articles regarding Visualization Library.