aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/director/director.cpp25
-rw-r--r--engines/director/director.h3
-rw-r--r--engines/director/score.cpp2
3 files changed, 27 insertions, 3 deletions
diff --git a/engines/director/director.cpp b/engines/director/director.cpp
index 83708e0028..4eb7d55c52 100644
--- a/engines/director/director.cpp
+++ b/engines/director/director.cpp
@@ -24,6 +24,9 @@
#include "common/debug-channels.h"
#include "common/error.h"
+#include "common/macresman.h"
+#include "graphics/fonts/macfont.h"
+
#include "graphics/macgui/macwindowmanager.h"
#include "director/director.h"
@@ -116,6 +119,8 @@ Common::Error DirectorEngine::run() {
_mainArchive = nullptr;
_currentScore = nullptr;
+ testFonts();
+
_lingo->runTests();
return Common::kNoError;
@@ -125,7 +130,7 @@ Common::Error DirectorEngine::run() {
//_mainArchive = new RIFFArchive();
//_mainArchive->openFile("bookshelf_example.mmm");
- //testFont();
+ //testFontScaling();
if (getPlatform() == Common::kPlatformWindows)
_sharedCastFile = "SHARDCST.MMM";
@@ -190,4 +195,22 @@ void DirectorEngine::setPalette(byte *palette, uint16 count) {
_currentPaletteLength = count;
}
+void DirectorEngine::testFonts() {
+ Common::String fontName("San Francisco");
+
+ Common::MacResManager *fontFile = new Common::MacResManager();
+ if (!fontFile->open(fontName))
+ error("Could not open %s as a resource fork", fontName.c_str());
+
+ Common::MacResIDArray fonds = fontFile->getResIDArray(MKTAG('F','O','N','D'));
+ if (fonds.size() > 0) {
+ for (Common::Array<uint16>::iterator iterator = fonds.begin(); iterator != fonds.end(); ++iterator) {
+ Common::SeekableReadStream *stream = fontFile->getResource(MKTAG('F', 'O', 'N', 'D'), *iterator);
+
+ Graphics::MacFont font;
+ font.loadFOND(*stream);
+ }
+ }
+}
+
} // End of namespace Director
diff --git a/engines/director/director.h b/engines/director/director.h
index a2cc1fa9db..8d5f6b5211 100644
--- a/engines/director/director.h
+++ b/engines/director/director.h
@@ -142,7 +142,8 @@ private:
Common::String _sharedCastFile;
private:
- void testFont();
+ void testFontScaling();
+ void testFonts();
};
extern DirectorEngine *g_director;
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index d8c21d6637..18cfd534c7 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -91,7 +91,7 @@ static byte defaultPalette[768] = {
204, 51, 255, 204, 102, 255, 204, 153, 255, 204, 204, 255, 204, 255, 255, 255,
0, 255, 255, 51, 255, 255, 102, 255, 255, 153, 255, 255, 204, 255, 255, 255 };
-void DirectorEngine::testFont() {
+void DirectorEngine::testFontScaling() {
int x = 10;
int y = 10;
int w = 640;