ScummVM API documentation
Graphics::FontManager Class Reference
Inheritance diagram for Graphics::FontManager:
Common::Singleton< FontManager > Common::NonCopyable

Public Types

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

Public Member Functions

bool setLocalizedFont (const Common::String &name)
 
const FontgetFontByName (const Common::String &name) const
 
bool assignFontToName (const Common::String &name, const Font *font)
 
bool setFont (FontUsage usage, const BdfFont *font)
 
void removeFontName (const Common::String &name)
 
const FontgetFontByUsage (FontUsage usage) const
 

Additional Inherited Members

- Static Public Member Functions inherited from Common::Singleton< FontManager >
static bool hasInstance ()
 
static FontManager & instance ()
 
static void destroy ()
 
- Protected Types inherited from Common::Singleton< FontManager >
typedef FontManager SingletonBaseType
 
- Static Protected Attributes inherited from Common::Singleton< FontManager >
static FontManager * _singleton
 

Member Function Documentation

◆ setLocalizedFont()

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

Sets the localized font name.

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

◆ getFontByName()

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

Retrieve a font object based on its 'name'.

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

◆ assignFontToName()

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
namethe name of the font
fontthe font object
Returns
true on success, false on failure

◆ setFont()

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
fontthe font object
Returns
true on success, false on failure

◆ removeFontName()

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

Removes binding from name to font

Parameters
namename which should be removed

◆ getFontByUsage()

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

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

Parameters
usagea 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.

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