Visualization Library v1.0.3

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

VL     Star     Watch     Fork     Issue

[Download] [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:
vl::Object

List of all members.

Public Member Functions

 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.
FontacquireFont (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:

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, NULL, 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, NULL, and releaseAllFonts().


Member Function Documentation

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().

Definition at line 82 of file FontManager.hpp.

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


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

Visualization Library v1.0.3 Reference Documentation
Copyright Michele Bosi. All rights reserved.
Updated on Tue Feb 7 2017 00:55:10.
Permission is granted to use this page to write and publish articles regarding Visualization Library.