ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

#include <fontman.h>

Inheritance diagram for Graphics::FontManager:
Collaboration diagram for Graphics::FontManager:

List of all members.

Public Types

enum  FontUsage { kLocalizedFont = 0, kConsoleFont = 1, kGUIFont = 2, kBigGUIFont = 3 }

Public Member Functions

bool setLocalizedFont (const Common::String &name)
 Sets the localized font name.
const FontgetFontByName (const Common::String &name) const
 Retrieve a font object based on its 'name'.
bool assignFontToName (const Common::String &name, const Font *font)
 Associates a font object with an 'name'.
bool setFont (FontUsage usage, const BdfFont *font)
 Associates a BDF font object with an 'usage'.
void removeFontName (const Common::String &name)
 Removes binding from name to font.
const FontgetFontByUsage (FontUsage usage) const
 Retrieve a font object based on what it is supposed to be used for.
Common::String genLocalizedFontFilename (const Common::String &filename) const
 Get the localized font for the current TranslationManager charset from the non localized font name.

Private Member Functions

 FontManager ()
 ~FontManager ()

Private Attributes

Common::HashMap
< Common::String, const Font * > 
_fontMap
Common::Array< const Font * > _ownedFonts
Common::String _localizedFontName

Friends

class Common::Singleton< SingletonBaseType >

Detailed Description

Definition at line 38 of file fontman.h.


Member Enumeration Documentation

Enumerator:
kLocalizedFont 
kConsoleFont 
kGUIFont 
kBigGUIFont 

Definition at line 40 of file fontman.h.


Constructor & Destructor Documentation

Graphics::FontManager::FontManager (  )  [private]

Definition at line 39 of file fontman.cpp.

Graphics::FontManager::~FontManager (  )  [private]

Definition at line 50 of file fontman.cpp.


Member Function Documentation

bool Graphics::FontManager::assignFontToName ( const Common::String name,
const Font font 
)

Associates a font object with an 'name'.

The FontManager takes ownership of the provided font object and will delete it when necesssary.

Parameters:
name the name of the font
font the font object
Returns:
true on success, false on failure

Definition at line 97 of file fontman.cpp.

Common::String Graphics::FontManager::genLocalizedFontFilename ( const Common::String filename  )  const

Get the localized font for the current TranslationManager charset from the non localized font name.

Parameters:
filename the non-localized font file name.
Returns:
The localized font file name.

Definition at line 195 of file fontman.cpp.

const Font * Graphics::FontManager::getFontByName ( const Common::String name  )  const

Retrieve a font object based on its 'name'.

Parameters:
name the name of the font to be retrieved.
Returns:
a pointer to a font, or 0 if no suitable font was found.

Definition at line 164 of file fontman.cpp.

const Font * Graphics::FontManager::getFontByUsage ( FontUsage  usage  )  const

Retrieve a font object based on what it is supposed to be used for.

Parameters:
usage a FontUsage enum value indicating what the font will be used for.
Returns:
a pointer to a font, or 0 if no suitable font was found.

Definition at line 176 of file fontman.cpp.

void Graphics::FontManager::removeFontName ( const Common::String name  ) 

Removes binding from name to font.

Parameters:
name name which should be removed

Definition at line 126 of file fontman.cpp.

bool Graphics::FontManager::setFont ( FontUsage  usage,
const BdfFont font 
)

Associates a BDF font object with an 'usage'.

This is useful for platforms with a screen DPI much larger than a regular desktop workstation.

Parameters:
font the font object
Returns:
true on success, false on failure

Definition at line 106 of file fontman.cpp.

bool Graphics::FontManager::setLocalizedFont ( const Common::String name  ) 

Sets the localized font name.

Parameters:
name the name of the localized font.
Returns:
true when the font was present, false otherwise.

Definition at line 83 of file fontman.cpp.


Friends And Related Function Documentation

friend class Common::Singleton< SingletonBaseType > [friend]

Definition at line 111 of file fontman.h.


Member Data Documentation

Definition at line 115 of file fontman.h.

Definition at line 116 of file fontman.h.


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


Generated on Sat Mar 16 2019 05:05:47 for ResidualVM by doxygen 1.7.1
curved edge   curved edge