[Scummvm-cvs-logs] SF.net SVN: scummvm: [22644] scummvm/trunk/gui
sev at users.sourceforge.net
sev at users.sourceforge.net
Thu May 25 18:06:06 CEST 2006
Revision: 22644
Author: sev
Date: 2006-05-25 18:05:19 -0700 (Thu, 25 May 2006)
ViewCVS: http://svn.sourceforge.net/scummvm/?rev=22644&view=rev
Log Message:
-----------
Use Courier 12pt (free one) for 2x and 3x console. Looks much more useable now.
Modified Paths:
--------------
scummvm/trunk/gui/ThemeNew.cpp
scummvm/trunk/gui/console.cpp
scummvm/trunk/gui/eval.cpp
scummvm/trunk/gui/theme.h
scummvm/trunk/gui/themes/modern.ini
scummvm/trunk/gui/themes/modern.zip
Modified: scummvm/trunk/gui/ThemeNew.cpp
===================================================================
--- scummvm/trunk/gui/ThemeNew.cpp 2006-05-26 00:17:55 UTC (rev 22643)
+++ scummvm/trunk/gui/ThemeNew.cpp 2006-05-26 01:05:19 UTC (rev 22644)
@@ -1357,59 +1357,38 @@
#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);
+void ThemeNew::setupFont(String key, String name, kFontStyle style) {
+ if (_configFile.hasKey(key, "extra")) {
+ _fonts[style] = FontMan.getFontByName(name);
- if (!_fonts[kFontStyleBold]) {
- Common::String temp;
- _configFile.getKey("fontfile_bold", "extra", temp);
+ if (!_fonts[style]) {
+ Common::String temp;
+ _configFile.getKey(key, "extra", temp);
- _fonts[kFontStyleBold] = loadFont(temp.c_str());
- if (!_fonts[kFontStyleBold])
- error("Couldn't load bold font '%s'", temp.c_str());
+ _fonts[style] = loadFont(temp.c_str());
+ if (!_fonts[style])
+ error("Couldn't load %s font '%s'", key.c_str(), temp.c_str());
- FontMan.assignFontToName(FONT_NAME_BOLD, _fonts[kFontStyleBold]);
- }
- } else {
- _fonts[kFontStyleBold] = FontMan.getFontByUsage(Graphics::FontManager::kBigGUIFont);
+ FontMan.assignFontToName(name, _fonts[style]);
}
+ } else {
+ _fonts[style] = FontMan.getFontByUsage(Graphics::FontManager::kBigGUIFont);
+ }
+}
- if (_configFile.hasKey("fontfile_normal", "extra")) {
- _fonts[kFontStyleNormal] = FontMan.getFontByName(FONT_NAME_NORMAL);
+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);
- 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);
- }
-
- 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());
-
- 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);
Modified: scummvm/trunk/gui/console.cpp
===================================================================
--- scummvm/trunk/gui/console.cpp 2006-05-26 00:17:55 UTC (rev 22643)
+++ scummvm/trunk/gui/console.cpp 2006-05-26 01:05:19 UTC (rev 22644)
@@ -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,9 +89,13 @@
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);
_h = (uint16)((_heightPercent * screenH - 2) / kConsoleLineHeight);
Modified: scummvm/trunk/gui/eval.cpp
===================================================================
--- scummvm/trunk/gui/eval.cpp 2006-05-26 00:17:55 UTC (rev 22643)
+++ scummvm/trunk/gui/eval.cpp 2006-05-26 01:05:19 UTC (rev 22644)
@@ -254,6 +254,10 @@
{"kFontStyleNormal", Theme::kFontStyleNormal},
{"kFontStyleItalic", Theme::kFontStyleItalic},
+ {"kFontStyleFixedBold", Theme::kFontStyleFixedBold},
+ {"kFontStyleFixedNormal", Theme::kFontStyleFixedNormal},
+ {"kFontStyleFixedItalic", Theme::kFontStyleFixedItalic},
+
{"false", 0},
{"true", 1},
{NULL, 0}
Modified: scummvm/trunk/gui/theme.h
===================================================================
--- scummvm/trunk/gui/theme.h 2006-05-26 00:17:55 UTC (rev 22643)
+++ scummvm/trunk/gui/theme.h 2006-05-26 01:05:19 UTC (rev 22644)
@@ -99,6 +99,9 @@
kFontStyleBold = 0, // standard font
kFontStyleNormal = 1,
kFontStyleItalic = 2,
+ kFontStyleFixedNormal = 3,
+ kFontStyleFixedBold = 4,
+ kFontStyleFixedItalic = 5,
kFontStyleMax
};
@@ -378,6 +381,9 @@
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,
Modified: scummvm/trunk/gui/themes/modern.ini
===================================================================
--- scummvm/trunk/gui/themes/modern.ini 2006-05-26 00:17:55 UTC (rev 22643)
+++ scummvm/trunk/gui/themes/modern.ini 2006-05-26 01:05:19 UTC (rev 22644)
@@ -159,6 +159,7 @@
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.rightPadding=7
EditTextWidget.leftPadding=7
EditTextWidget.rightPadding=7
+Console.font=kFontStyleFixedNormal
###### chooser
opHeight=insetH
Modified: scummvm/trunk/gui/themes/modern.zip
===================================================================
(Binary files differ)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list