PixelLightAPI  .
Public Member Functions | Protected Member Functions | Protected Attributes
PLRenderer::FontManager Class Reference

Abstract renderer font manager. More...

#include <FontManager.h>

List of all members.

Public Member Functions

RendererGetRenderer () const
 Returns the owner renderer.
PLRENDERER_API FontGetDefaultFontTexture ()
 Returns the default texture font.
PLRENDERER_API void SetDefaultFontTexture (FontTexture *pFont)
 Sets the default texture font.
PLRENDERER_API FontTextureGetFontTexture (const PLCore::String &sFilename, PLCore::uint32 nSize=12, PLCore::uint32 nResolution=96)
 Returns a texture font.
PLRENDERER_API void ClearFontTexture ()
 Clears all texture fonts.
virtual PLRENDERER_API FontCreateFontTexture (const PLCore::String &sFilename, PLCore::uint32 nSize=12, PLCore::uint32 nResolution=96)
 Creates a texture font.
virtual FontCreateFontTexture (PLCore::File &cFile, PLCore::uint32 nSize=12, PLCore::uint32 nResolution=96)=0
 Creates a texture font.

Protected Member Functions

PLRENDERER_API FontManager (Renderer &cRenderer)
 Constructor.
virtual PLRENDERER_API ~FontManager ()
 Destructor.

Protected Attributes

Rendererm_pRenderer
ResourceHandlerm_pDefaultFontTextureHandler
bool m_bDefaultFontTextureSet
PLCore::Array< FontTexture * > m_lstFontTexture

Detailed Description

Abstract renderer font manager.


Constructor & Destructor Documentation

PLRENDERER_API PLRenderer::FontManager::FontManager ( Renderer cRenderer) [protected]

Constructor.

Parameters:
[in]cRendererOwner renderer
virtual PLRENDERER_API PLRenderer::FontManager::~FontManager ( ) [protected, virtual]

Destructor.


Member Function Documentation

Returns the owner renderer.

Returns:
The owner renderer

Returns the default texture font.

Returns:
The default texture font, a null pointer on error
Remarks:
The default texture font setting is build in and is set to
  • Filename = "Data/Fonts/LinLibertine_Re-2.7.9.9.otf"
  • Size = 15 Resolution = 96 In order to remove the default texture font or to set another default texture font, just set it during the application initialization. The font is internally not initialized until it's first real usage, so, this approach doesn't introduce overhead if you never use the build in default font.

Sets the default texture font.

Parameters:
[in]pFontThe texture font or a null pointer
PLRENDERER_API FontTexture* PLRenderer::FontManager::GetFontTexture ( const PLCore::String sFilename,
PLCore::uint32  nSize = 12,
PLCore::uint32  nResolution = 96 
)

Returns a texture font.

Parameters:
[in]sFilenameThe font filename
[in]nSizeNominal font size in points, for example 12 (72 points per inch)
[in]nResolutionThe horizontal and vertical resolution in DPI, for example 96
Returns:
The texture font, a null pointer on error (do not destroy this instance, it's owned by this manager)
Remarks:
Unlike the "CreateFontTexture()"-methods, this method checks whether or not the requested font is already registered within this manager, if so, this instance will be returned instead of a new one.

Clears all texture fonts.

virtual PLRENDERER_API Font* PLRenderer::FontManager::CreateFontTexture ( const PLCore::String sFilename,
PLCore::uint32  nSize = 12,
PLCore::uint32  nResolution = 96 
) [virtual]

Creates a texture font.

Parameters:
[in]sFilenameThe font filename
[in]nSizeNominal font size in points, for example 12 (72 points per inch)
[in]nResolutionThe horizontal and vertical resolution in DPI, for example 96
Returns:
The created texture font, destroy the instance if you no longer need it
Note:
  • The default implementations opens and reads in the file
virtual Font* PLRenderer::FontManager::CreateFontTexture ( PLCore::File cFile,
PLCore::uint32  nSize = 12,
PLCore::uint32  nResolution = 96 
) [pure virtual]

Creates a texture font.

Parameters:
[in]cFileFile to load from, must be opened and readable
[in]nSizeNominal font size in points, for example 12 (72 points per inch)
[in]nResolutionThe horizontal and vertical resolution in DPI, for example 96
Returns:
The created texture font, destroy the instance if you no longer need it

Member Data Documentation

Owner renderer, always valid!

Default texture font, always valid!

Default font texture already set?

Texture fonts


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


PixelLight PixelLight 0.9.10-R1
Copyright (C) 2002-2011 by The PixelLight Team
Last modified Fri Dec 23 2011 15:51:23
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported