[Scummvm-git-logs] scummvm master -> 6b7eb94ca06f009770aa464ea906a4466f68c9c5
dreammaster
paulfgilbert at gmail.com
Tue Dec 18 06:24:06 CET 2018
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
6b7eb94ca0 GLK: FROTZ: Remove need for new font style for Runic font
Commit: 6b7eb94ca06f009770aa464ea906a4466f68c9c5
https://github.com/scummvm/scummvm/commit/6b7eb94ca06f009770aa464ea906a4466f68c9c5
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2018-12-17T21:23:57-08:00
Commit Message:
GLK: FROTZ: Remove need for new font style for Runic font
Changed paths:
engines/glk/conf.cpp
engines/glk/frotz/processor_screen.cpp
engines/glk/frotz/screen.cpp
engines/glk/glk_types.h
engines/glk/screen.cpp
engines/glk/screen.h
diff --git a/engines/glk/conf.cpp b/engines/glk/conf.cpp
index 98cd515..8bd9cab 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 97745a0..a8ddb81 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 971ea2f..218391e 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 3fdbf1e..aa573e2 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 7b38782..2891db1 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 25beaf1..f54d965 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 };
More information about the Scummvm-git-logs
mailing list