aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarisa-Chan2014-03-09 23:18:05 +0700
committerMarisa-Chan2014-03-09 23:18:05 +0700
commitea6e151047641563f588b6578aea80141f51bbd0 (patch)
treec75597cdf203c76b7c052739b555f05c9ce0fcb1
parent74fe47748e11cc58aee46e986d6670636c027e32 (diff)
downloadscummvm-rg350-ea6e151047641563f588b6578aea80141f51bbd0.tar.gz
scummvm-rg350-ea6e151047641563f588b6578aea80141f51bbd0.tar.bz2
scummvm-rg350-ea6e151047641563f588b6578aea80141f51bbd0.zip
ZVISION: Add support for sharp(monochrome) font loading
-rw-r--r--engines/zvision/text.cpp7
-rw-r--r--engines/zvision/text.h1
-rw-r--r--engines/zvision/truetype_font.cpp8
-rw-r--r--engines/zvision/truetype_font.h3
4 files changed, 15 insertions, 4 deletions
diff --git a/engines/zvision/text.cpp b/engines/zvision/text.cpp
index 575ca03d10..e96bf4b32c 100644
--- a/engines/zvision/text.cpp
+++ b/engines/zvision/text.cpp
@@ -58,6 +58,7 @@ cTxtStyle::cTxtStyle() {
strikeout = false;
underline = false;
statebox = 0;
+ sharp = false;
}
txtReturn cTxtStyle::parseStyle(const Common::String &strin, int16 ln) {
@@ -263,6 +264,9 @@ void cTxtStyle::setFontStyle(sTTFont &font) {
if (strikeout)
temp_stl |= sTTFont::STTF_STRIKEOUT;
+ if (sharp)
+ temp_stl |= sTTFont::STTF_SHARP;
+
font.setStyle(temp_stl);
}
@@ -281,6 +285,9 @@ void cTxtStyle::setFont(sTTFont &font) {
if (strikeout)
temp_stl |= sTTFont::STTF_STRIKEOUT;
+ if (sharp)
+ temp_stl |= sTTFont::STTF_SHARP;
+
font.loadFont(fontname, size, temp_stl);
}
diff --git a/engines/zvision/text.h b/engines/zvision/text.h
index 40244f7f0c..6937832335 100644
--- a/engines/zvision/text.h
+++ b/engines/zvision/text.h
@@ -74,6 +74,7 @@ public:
bool strikeout;
bool skipcolor;
int32 statebox;
+ bool sharp;
// char image ??
};
diff --git a/engines/zvision/truetype_font.cpp b/engines/zvision/truetype_font.cpp
index 5e1bc7a81d..e3eea403b6 100644
--- a/engines/zvision/truetype_font.cpp
+++ b/engines/zvision/truetype_font.cpp
@@ -189,6 +189,8 @@ bool sTTFont::loadFont(const Common::String &fontName, int32 point) {
newFontName = "arial.ttf";
}
+ bool sharp = (_style & STTF_SHARP) == STTF_SHARP;
+
Common::File *file = _engine->getSearchManager()->openFile(newFontName);
if (!file) {
@@ -210,7 +212,7 @@ bool sTTFont::loadFont(const Common::String &fontName, int32 point) {
if (themeArchive->hasFile("FreeSans.ttf")) {
Common::SeekableReadStream *stream = nullptr;
stream = themeArchive->createReadStreamForMember("FreeSans.ttf");
- Graphics::Font *_newFont = Graphics::loadTTFFont(*stream, point, 60); // 66 dpi for 640 x 480 on 14" display
+ Graphics::Font *_newFont = Graphics::loadTTFFont(*stream, point, 60, sharp); // 66 dpi for 640 x 480 on 14" display
if (_newFont) {
if (!_font)
delete _font;
@@ -223,7 +225,7 @@ bool sTTFont::loadFont(const Common::String &fontName, int32 point) {
themeArchive = nullptr;
}
} else {
- Graphics::Font *_newFont = Graphics::loadTTFFont(*file, point, 60); // 66 dpi for 640 x 480 on 14" display
+ Graphics::Font *_newFont = Graphics::loadTTFFont(*file, point, 60, sharp); // 66 dpi for 640 x 480 on 14" display
if (_newFont) {
if (!_font)
delete _font;
@@ -241,7 +243,7 @@ bool sTTFont::loadFont(const Common::String &fontName, int32 point) {
}
void sTTFont::setStyle(uint newStyle) {
- if ((_style & (STTF_BOLD | STTF_ITALIC)) != (newStyle & (STTF_BOLD | STTF_ITALIC))) {
+ if ((_style & (STTF_BOLD | STTF_ITALIC | STTF_SHARP)) != (newStyle & (STTF_BOLD | STTF_ITALIC | STTF_SHARP))) {
_style = newStyle;
loadFont(_fntName, _lineHeight);
} else {
diff --git a/engines/zvision/truetype_font.h b/engines/zvision/truetype_font.h
index 0462f35aff..497ac763c1 100644
--- a/engines/zvision/truetype_font.h
+++ b/engines/zvision/truetype_font.h
@@ -86,7 +86,8 @@ public:
STTF_BOLD = 1,
STTF_ITALIC = 2,
STTF_UNDERLINE = 4,
- STTF_STRIKEOUT = 8
+ STTF_STRIKEOUT = 8,
+ STTF_SHARP = 16
};
private: