diff options
author | Paul Gilbert | 2018-12-17 21:23:57 -0800 |
---|---|---|
committer | Paul Gilbert | 2018-12-17 21:23:57 -0800 |
commit | 6b7eb94ca06f009770aa464ea906a4466f68c9c5 (patch) | |
tree | 222b86d7fad4cff2694bbd5445268153d12e8892 /engines | |
parent | 83c029b2196920e833f845a68c983f1ce2a67723 (diff) | |
download | scummvm-rg350-6b7eb94ca06f009770aa464ea906a4466f68c9c5.tar.gz scummvm-rg350-6b7eb94ca06f009770aa464ea906a4466f68c9c5.tar.bz2 scummvm-rg350-6b7eb94ca06f009770aa464ea906a4466f68c9c5.zip |
GLK: FROTZ: Remove need for new font style for Runic font
Diffstat (limited to 'engines')
-rw-r--r-- | engines/glk/conf.cpp | 6 | ||||
-rw-r--r-- | engines/glk/frotz/processor_screen.cpp | 2 | ||||
-rw-r--r-- | engines/glk/frotz/screen.cpp | 12 | ||||
-rw-r--r-- | engines/glk/glk_types.h | 3 | ||||
-rw-r--r-- | engines/glk/screen.cpp | 10 | ||||
-rw-r--r-- | engines/glk/screen.h | 4 |
6 files changed, 21 insertions, 16 deletions
diff --git a/engines/glk/conf.cpp b/engines/glk/conf.cpp index 98cd515aa1..8bd9cabc67 100644 --- a/engines/glk/conf.cpp +++ b/engines/glk/conf.cpp @@ -44,8 +44,7 @@ WindowStyle T_STYLES[style_NUMSTYLES] = { { PROPR, { 0xff, 0xff, 0xff }, { 0x00, 0x00, 0x00 }, 0 }, ///< BlockQuote { PROPB, { 0xff, 0xff, 0xff }, { 0x00, 0x60, 0x00 }, 0 }, ///< Input { MONOR, { 0xff, 0xff, 0xff }, { 0x00, 0x00, 0x00 }, 0 }, ///< User1 - { MONOR, { 0xff, 0xff, 0xff }, { 0x00, 0x00, 0x00 }, 0 }, ///< User2 - { RUNIC, { 0xff, 0xff, 0xff }, { 0x00, 0x00, 0x00 }, 0 }, ///< User3 + { MONOR, { 0xff, 0xff, 0xff }, { 0x00, 0x00, 0x00 }, 0 } ///< User2 }; WindowStyle G_STYLES[style_NUMSTYLES] = { @@ -59,8 +58,7 @@ WindowStyle G_STYLES[style_NUMSTYLES] = { { MONOR, { 0xff, 0xff, 0xff }, { 0x60, 0x60, 0x60 }, 0 }, ///< BlockQuote { MONOR, { 0xff, 0xff, 0xff }, { 0x60, 0x60, 0x60 }, 0 }, ///< Input { MONOR, { 0xff, 0xff, 0xff }, { 0x60, 0x60, 0x60 }, 0 }, ///< User1 - { MONOR, { 0xff, 0xff, 0xff }, { 0x60, 0x60, 0x60 }, 0 }, ///< User2 - { MONOR, { 0xff, 0xff, 0xff }, { 0x60, 0x60, 0x60 }, 0 }, ///< User3 + { MONOR, { 0xff, 0xff, 0xff }, { 0x60, 0x60, 0x60 }, 0 } ///< User2 }; Conf *g_conf; diff --git a/engines/glk/frotz/processor_screen.cpp b/engines/glk/frotz/processor_screen.cpp index 97745a0e91..a8ddb81e17 100644 --- a/engines/glk/frotz/processor_screen.cpp +++ b/engines/glk/frotz/processor_screen.cpp @@ -158,7 +158,7 @@ void Processor::screen_char(zchar c) { if (curr_font == GRAPHICS_FONT) { uint32 runic_char = zchar_to_unicode_rune(c); if (runic_char != 0) { - glk_set_style(style_User3); + glk_set_style(style_User2); glk_put_char_uni(runic_char); glk_set_style(style_User1); } else diff --git a/engines/glk/frotz/screen.cpp b/engines/glk/frotz/screen.cpp index 971ea2ffc9..218391ee96 100644 --- a/engines/glk/frotz/screen.cpp +++ b/engines/glk/frotz/screen.cpp @@ -23,6 +23,7 @@ #include "glk/frotz/screen.h" #include "glk/conf.h" #include "common/file.h" +#include "graphics/fonts/ttf.h" #include "image/bmp.h" namespace Glk { @@ -31,11 +32,13 @@ namespace Frotz { FrotzScreen::FrotzScreen() : Glk::Screen() { g_conf->_tStyles[style_User1].font = CUSTOM; g_conf->_gStyles[style_User1].font = CUSTOM; + g_conf->_tStyles[style_User2].font = CUSTOM2; } void FrotzScreen::loadFonts(Common::Archive *archive) { Screen::loadFonts(archive); + // Add character graphics font Image::BitmapDecoder decoder; Common::File f; if (!f.open("infocom_graphics.bmp", *archive)) @@ -44,6 +47,15 @@ void FrotzScreen::loadFonts(Common::Archive *archive) { Common::Point fontSize(_fonts[0]->getMaxCharWidth(), _fonts[0]->getFontHeight()); decoder.loadStream(f); _fonts.push_back(new Frotz::BitmapFont(*decoder.getSurface(), fontSize)); + f.close(); + + // Add Runic font. It provides cleaner versions of the runic characters in the + // character graphics font + if (!f.open("NotoSansRunic-Regular.ttf", *archive)) + error("Could not load font"); + + _fonts.push_back(Graphics::loadTTFFont(f, g_conf->_propSize, Graphics::kTTFSizeModeCharacter)); + f.close(); } /*--------------------------------------------------------------------------*/ diff --git a/engines/glk/glk_types.h b/engines/glk/glk_types.h index 3fdbf1e536..aa573e2e29 100644 --- a/engines/glk/glk_types.h +++ b/engines/glk/glk_types.h @@ -137,8 +137,7 @@ enum Style { style_Input = 8, style_User1 = 9, style_User2 = 10, - style_User3 = 11, - style_NUMSTYLES = 12 + style_NUMSTYLES = 11 }; enum WinType { diff --git a/engines/glk/screen.cpp b/engines/glk/screen.cpp index 7b3878298e..2891db1490 100644 --- a/engines/glk/screen.cpp +++ b/engines/glk/screen.cpp @@ -144,17 +144,13 @@ void Screen::loadFonts(Common::Archive *archive) { _fonts[5] = loadFont(PROPB, archive, propSize, propAspect, FONTB); _fonts[6] = loadFont(PROPI, archive, propSize, propAspect, FONTI); _fonts[7] = loadFont(PROPZ, archive, propSize, propAspect, FONTZ); - - _fonts[8] = loadFont(RUNIC, archive, propSize, propAspect, RUNIC); } -const Graphics::Font *Screen::loadFont(FACES face, Common::Archive *archive, double size, double aspect, int - style) { +const Graphics::Font *Screen::loadFont(FACES face, Common::Archive *archive, double size, double aspect, int style) { Common::File f; - const char *const FILENAMES[9] = { + const char *const FILENAMES[8] = { "GoMono-Regular.ttf", "GoMono-Bold.ttf", "GoMono-Italic.ttf", "GoMono-Bold-Italic.ttf", - "NotoSerif-Regular.ttf", "NotoSerif-Bold.ttf", "NotoSerif-Italic.ttf", "NotoSerif-Bold-Italic.ttf", - "NotoSansRunic-Regular.ttf" + "NotoSerif-Regular.ttf", "NotoSerif-Bold.ttf", "NotoSerif-Italic.ttf", "NotoSerif-Bold-Italic.ttf" }; if (!f.open(FILENAMES[face], *archive)) diff --git a/engines/glk/screen.h b/engines/glk/screen.h index 25beaf105d..f54d965545 100644 --- a/engines/glk/screen.h +++ b/engines/glk/screen.h @@ -31,13 +31,13 @@ namespace Glk { -#define FONTS_TOTAL 9 +#define FONTS_TOTAL 8 enum CaretShape { SMALL_DOT = 0, FAT_DOT = 1, THIN_LINE = 2, FAT_LINE = 3, BLOCK = 4 }; -enum FACES { MONOR, MONOB, MONOI, MONOZ, PROPR, PROPB, PROPI, PROPZ, RUNIC, CUSTOM }; +enum FACES { MONOR, MONOB, MONOI, MONOZ, PROPR, PROPB, PROPI, PROPZ, CUSTOM, CUSTOM2 }; enum TYPES { MONOF, PROPF }; enum STYLES { FONTR, FONTB, FONTI, FONTZ }; |