diff options
author | Eugene Sandulenko | 2006-05-26 01:05:19 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2006-05-26 01:05:19 +0000 |
commit | 7f8b79d5d0c98e5321c435293fdda8ebb9166cde (patch) | |
tree | 0fd5285be1f1236c7e304c5cd7c45d5251816b84 | |
parent | 9828eb7a0b9fc96f919cbd2966ace4faf5f4515b (diff) | |
download | scummvm-rg350-7f8b79d5d0c98e5321c435293fdda8ebb9166cde.tar.gz scummvm-rg350-7f8b79d5d0c98e5321c435293fdda8ebb9166cde.tar.bz2 scummvm-rg350-7f8b79d5d0c98e5321c435293fdda8ebb9166cde.zip |
Use Courier 12pt (free one) for 2x and 3x console. Looks much more useable now.
svn-id: r22644
-rw-r--r-- | gui/ThemeNew.cpp | 71 | ||||
-rw-r--r-- | gui/console.cpp | 9 | ||||
-rw-r--r-- | gui/eval.cpp | 4 | ||||
-rw-r--r-- | gui/theme.h | 6 | ||||
-rw-r--r-- | gui/themes/modern.ini | 2 | ||||
-rw-r--r-- | gui/themes/modern.zip | bin | 35019 -> 41087 bytes |
6 files changed, 44 insertions, 48 deletions
diff --git a/gui/ThemeNew.cpp b/gui/ThemeNew.cpp index 9aeaf99dc4..01d1557ae1 100644 --- a/gui/ThemeNew.cpp +++ b/gui/ThemeNew.cpp @@ -1357,59 +1357,38 @@ void ThemeNew::setupColors() { #define FONT_NAME_NORMAL "newgui_normal" #define FONT_NAME_BOLD "newgui_bold" #define FONT_NAME_ITALIC "newgui_italic" +#define FONT_NAME_FIXED_NORMAL "newgui_fixed_normal" +#define FONT_NAME_FIXED_BOLD "newgui_fixed_bold" +#define FONT_NAME_FIXED_ITALIC "newgui_fixed_italic" -void ThemeNew::setupFonts() { - if (_screen.w >= 400 && _screen.h >= 300) { - if (_configFile.hasKey("fontfile_bold", "extra")) { - _fonts[kFontStyleBold] = FontMan.getFontByName(FONT_NAME_BOLD); - - if (!_fonts[kFontStyleBold]) { - Common::String temp; - _configFile.getKey("fontfile_bold", "extra", temp); +void ThemeNew::setupFont(String key, String name, kFontStyle style) { + if (_configFile.hasKey(key, "extra")) { + _fonts[style] = FontMan.getFontByName(name); - _fonts[kFontStyleBold] = loadFont(temp.c_str()); - if (!_fonts[kFontStyleBold]) - error("Couldn't load bold font '%s'", temp.c_str()); + if (!_fonts[style]) { + Common::String temp; + _configFile.getKey(key, "extra", temp); - FontMan.assignFontToName(FONT_NAME_BOLD, _fonts[kFontStyleBold]); - } - } else { - _fonts[kFontStyleBold] = FontMan.getFontByUsage(Graphics::FontManager::kBigGUIFont); - } + _fonts[style] = loadFont(temp.c_str()); + if (!_fonts[style]) + error("Couldn't load %s font '%s'", key.c_str(), temp.c_str()); - if (_configFile.hasKey("fontfile_normal", "extra")) { - _fonts[kFontStyleNormal] = FontMan.getFontByName(FONT_NAME_NORMAL); - - if (!_fonts[kFontStyleNormal]) { - Common::String temp; - _configFile.getKey("fontfile_normal", "extra", temp); - - _fonts[kFontStyleNormal] = loadFont(temp.c_str()); - if (!_fonts[kFontStyleNormal]) - error("Couldn't load normal font '%s'", temp.c_str()); - - FontMan.assignFontToName(FONT_NAME_NORMAL, _fonts[kFontStyleNormal]); - } - } else { - _fonts[kFontStyleNormal] = FontMan.getFontByUsage(Graphics::FontManager::kBigGUIFont); + FontMan.assignFontToName(name, _fonts[style]); } + } else { + _fonts[style] = FontMan.getFontByUsage(Graphics::FontManager::kBigGUIFont); + } +} - if (_configFile.hasKey("fontfile_italic", "extra")) { - _fonts[kFontStyleItalic] = FontMan.getFontByName(FONT_NAME_ITALIC); - - if (!_fonts[kFontStyleItalic]) { - Common::String temp; - _configFile.getKey("fontfile_italic", "extra", temp); - - _fonts[kFontStyleNormal] = loadFont(temp.c_str()); - if (!_fonts[kFontStyleItalic]) - error("Couldn't load italic font '%s'", temp.c_str()); +void ThemeNew::setupFonts() { + if (_screen.w >= 400 && _screen.h >= 300) { + setupFont("fontfile_bold", FONT_NAME_BOLD, kFontStyleBold); + setupFont("fontfile_normal", FONT_NAME_NORMAL, kFontStyleNormal); + setupFont("fontfile_italic", FONT_NAME_ITALIC, kFontStyleItalic); - FontMan.assignFontToName(FONT_NAME_ITALIC, _fonts[kFontStyleItalic]); - } - } else { - _fonts[kFontStyleItalic] = FontMan.getFontByUsage(Graphics::FontManager::kBigGUIFont); - } + setupFont("fontfile_fixed_bold", FONT_NAME_FIXED_BOLD, kFontStyleFixedBold); + setupFont("fontfile_fixed_normal", FONT_NAME_FIXED_NORMAL, kFontStyleFixedNormal); + setupFont("fontfile_fixed_italic", FONT_NAME_FIXED_ITALIC, kFontStyleFixedItalic); } else { _fonts[kFontStyleBold] = FontMan.getFontByUsage(Graphics::FontManager::kGUIFont); _fonts[kFontStyleNormal] = FontMan.getFontByUsage(Graphics::FontManager::kGUIFont); diff --git a/gui/console.cpp b/gui/console.cpp index 66ef2b8e6f..419ea59c14 100644 --- a/gui/console.cpp +++ b/gui/console.cpp @@ -22,6 +22,7 @@ #include "common/stdafx.h" #include "gui/console.h" #include "gui/ScrollBarWidget.h" +#include "gui/eval.h" #include "base/engine.h" #include "base/version.h" @@ -88,8 +89,12 @@ ConsoleDialog::ConsoleDialog(float widthPercent, float heightPercent) void ConsoleDialog::init() { const int screenW = g_system->getOverlayWidth(); const int screenH = g_system->getOverlayHeight(); - - _font = FontMan.getFontByUsage(Graphics::FontManager::kConsoleFont); + int f = g_gui.evaluator()->getVar("Console.font"); + + if (f == EVAL_UNDEF_VAR) + _font = FontMan.getFontByUsage(Graphics::FontManager::kConsoleFont); + else + _font = g_gui.theme()->getFont((Theme::kFontStyle)f); // Calculate the real width/height (rounded to char/line multiples) _w = (uint16)(_widthPercent * screenW); diff --git a/gui/eval.cpp b/gui/eval.cpp index 61f5307355..1fa178811a 100644 --- a/gui/eval.cpp +++ b/gui/eval.cpp @@ -254,6 +254,10 @@ static const BuiltinConsts builtinConsts[] = { {"kFontStyleNormal", Theme::kFontStyleNormal}, {"kFontStyleItalic", Theme::kFontStyleItalic}, + {"kFontStyleFixedBold", Theme::kFontStyleFixedBold}, + {"kFontStyleFixedNormal", Theme::kFontStyleFixedNormal}, + {"kFontStyleFixedItalic", Theme::kFontStyleFixedItalic}, + {"false", 0}, {"true", 1}, {NULL, 0} diff --git a/gui/theme.h b/gui/theme.h index 3873a9263b..fa3373589c 100644 --- a/gui/theme.h +++ b/gui/theme.h @@ -99,6 +99,9 @@ public: kFontStyleBold = 0, // standard font kFontStyleNormal = 1, kFontStyleItalic = 2, + kFontStyleFixedNormal = 3, + kFontStyleFixedBold = 4, + kFontStyleFixedItalic = 5, kFontStyleMax }; @@ -378,6 +381,9 @@ private: Common::String genCacheFilename(const char *filename); const Graphics::Font *_fonts[kFontStyleMax]; +private: + void setupFont(String key, String name, kFontStyle style); + public: enum kImageHandles { kDialogBkgdCorner = 0, diff --git a/gui/themes/modern.ini b/gui/themes/modern.ini index be600ccc83..dae955cf11 100644 --- a/gui/themes/modern.ini +++ b/gui/themes/modern.ini @@ -159,6 +159,7 @@ shadow_bottom_height=4 inactive_dialog_shading=dim shading_dim_percent=20 fontfile_normal=helvr12-l1.bdf +fontfile_fixed_normal=courr12-l1.bdf cursor_hotspot_x=0 cursor_hotspot_y=0 cursor_targetScale=3 @@ -200,6 +201,7 @@ PopUpWidget.leftPadding=7 PopUpWidget.rightPadding=7 EditTextWidget.leftPadding=7 EditTextWidget.rightPadding=7 +Console.font=kFontStyleFixedNormal ###### chooser opHeight=insetH diff --git a/gui/themes/modern.zip b/gui/themes/modern.zip Binary files differindex cba7d77d68..628dbc545e 100644 --- a/gui/themes/modern.zip +++ b/gui/themes/modern.zip |