summaryrefslogtreecommitdiffhomepage
path: root/nGenEx/FontMgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'nGenEx/FontMgr.cpp')
-rw-r--r--nGenEx/FontMgr.cpp58
1 files changed, 58 insertions, 0 deletions
diff --git a/nGenEx/FontMgr.cpp b/nGenEx/FontMgr.cpp
new file mode 100644
index 0000000..e37b2b9
--- /dev/null
+++ b/nGenEx/FontMgr.cpp
@@ -0,0 +1,58 @@
+/* Project nGenEx
+ Destroyer Studios LLC
+ Copyright © 1997-2004. All Rights Reserved.
+
+ SUBSYSTEM: nGenEx.lib
+ FILE: FontMgr.cpp
+ AUTHOR: John DiCamillo
+
+
+ OVERVIEW
+ ========
+ Font Resource Manager class implementation
+*/
+
+#include "MemDebug.h"
+#include "FontMgr.h"
+
+// +--------------------------------------------------------------------+
+
+List<FontItem> FontMgr::fonts;
+
+// +--------------------------------------------------------------------+
+
+void
+FontMgr::Close()
+{
+ fonts.destroy();
+}
+
+// +--------------------------------------------------------------------+
+
+void
+FontMgr::Register(const char* name, Font* font)
+{
+ FontItem* item = new(__FILE__,__LINE__) FontItem;
+
+ if (item) {
+ item->name = name;
+ item->size = 0;
+ item->font = font;
+
+ fonts.append(item);
+ }
+}
+
+// +--------------------------------------------------------------------+
+
+Font*
+FontMgr::Find(const char* name)
+{
+ ListIter<FontItem> item = fonts;
+ while (++item) {
+ if (item->name == name)
+ return item->font;
+ }
+
+ return 0;
+}