From f63df3bf7b95ddd9eaa4f55c4f21f53f3bd00f68 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Mon, 9 Jan 2012 03:33:59 +0100 Subject: GRAPHICS/GUI: Implement charset mapping for TTF fonts. The charsets used by the translations now need to have a "$(name).cp" file, which contains an charset index => unicode mapping. Otherwise create_translations will fail. --- gui/ThemeEngine.cpp | 8 +------- gui/themes/translations.dat | Bin 285893 -> 287971 bytes 2 files changed, 1 insertion(+), 7 deletions(-) (limited to 'gui') diff --git a/gui/ThemeEngine.cpp b/gui/ThemeEngine.cpp index 46a0eda0c5..3cfa5550ed 100644 --- a/gui/ThemeEngine.cpp +++ b/gui/ThemeEngine.cpp @@ -1399,12 +1399,6 @@ DrawData ThemeEngine::parseDrawDataId(const Common::String &name) const { const Graphics::Font *ThemeEngine::loadScalableFont(const Common::String &filename, const Common::String &charset, const int pointsize, Common::String &name) { #ifdef USE_FREETYPE2 - // We only support ISO-8859-1 for TTF right now. - if (!charset.empty() - && !charset.equalsIgnoreCase("iso-8859-1") - && !charset.equalsIgnoreCase("ascii")) - return 0; - name = Common::String::format("%s-%s@%d", filename.c_str(), charset.c_str(), pointsize); // Try already loaded fonts. @@ -1418,7 +1412,7 @@ const Graphics::Font *ThemeEngine::loadScalableFont(const Common::String &filena for (Common::ArchiveMemberList::const_iterator i = members.begin(), end = members.end(); i != end; ++i) { Common::SeekableReadStream *stream = (*i)->createReadStream(); if (stream) { - font = Graphics::loadTTFFont(*stream, pointsize, false); + font = Graphics::loadTTFFont(*stream, pointsize, false, TransMan.getCharsetMapping()); delete stream; if (font) diff --git a/gui/themes/translations.dat b/gui/themes/translations.dat index 447b7b97dd..4fab3f6f6a 100644 Binary files a/gui/themes/translations.dat and b/gui/themes/translations.dat differ -- cgit v1.2.3