From 96cf7028b98cd12e2278b37aee43b3d669214abb Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Fri, 14 Apr 2006 02:16:55 +0000 Subject: - implements .bdf font loader based on convbdf (sure could have some clean up) - adds three different font styles to the themes (normal, bold (default one), italic) - implements code for specifing the font files in the theme config ('fontfile_normal','fontfile_bold' and 'fontfile_italic' in the 'extra' section) - changes EditTextWidget to use the normal font (has some minor aligment problems with the caret now, though) - extends the FontManager (new functions: getFontByName, assignFontToName, removeFontName) - adds the font style constans to the builtin constants for the evaluator) svn-id: r21868 --- graphics/fontman.h | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'graphics/fontman.h') diff --git a/graphics/fontman.h b/graphics/fontman.h index ba5939940c..6d214657b9 100644 --- a/graphics/fontman.h +++ b/graphics/fontman.h @@ -26,6 +26,7 @@ #include "common/scummsys.h" #include "common/singleton.h" #include "common/str.h" +#include "common/hashmap.h" #include "graphics/font.h" @@ -46,7 +47,23 @@ public: * @param name the name of the font to be retrieved. * @return a pointer to a font, or 0 if no suitable font was found. */ - //const Font *getFontByName(const Common::String &name) const; + const Font *getFontByName(const Common::String &name) const; + + /** + * Associates a font object with an 'name' + * + * @param name the name of the font + * @param font the font object + * @return true on success, false on failure + */ + bool assignFontToName(const Common::String &name, const Font *font) { _fontMap[name] = font; return true; } + + /** + * Removes binding from name to font + * + * @param name name which should be removed + */ + void removeFontName(const Common::String &name) { _fontMap.erase(name); } /** * Retrieve a font object based on what it is supposed @@ -63,6 +80,8 @@ public: private: friend class Common::Singleton; FontManager(); + + Common::HashMap _fontMap; }; -- cgit v1.2.3