aboutsummaryrefslogtreecommitdiff
path: root/graphics/fontman.h
diff options
context:
space:
mode:
authorJohannes Schickel2006-04-14 02:16:55 +0000
committerJohannes Schickel2006-04-14 02:16:55 +0000
commit96cf7028b98cd12e2278b37aee43b3d669214abb (patch)
treec9ea75045b671229d8ac4e2656d8475ac5909471 /graphics/fontman.h
parent1470dadb1de3250dfceeaa246604ca0f26889bbf (diff)
downloadscummvm-rg350-96cf7028b98cd12e2278b37aee43b3d669214abb.tar.gz
scummvm-rg350-96cf7028b98cd12e2278b37aee43b3d669214abb.tar.bz2
scummvm-rg350-96cf7028b98cd12e2278b37aee43b3d669214abb.zip
- 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
Diffstat (limited to 'graphics/fontman.h')
-rw-r--r--graphics/fontman.h21
1 files changed, 20 insertions, 1 deletions
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<SingletonBaseType>;
FontManager();
+
+ Common::HashMap<Common::String, const Font *> _fontMap;
};