From 3ddea4952d2aec5ef61d0ae8762266edb9ceb02e Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 13 Nov 2011 01:43:41 +0100 Subject: COMMON: Some minor formatting fixes in translation code. Done by running astyle over the files. --- common/translation.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'common/translation.h') diff --git a/common/translation.h b/common/translation.h index 9e5245702e..71cf2b0981 100644 --- a/common/translation.h +++ b/common/translation.h @@ -173,13 +173,13 @@ private: * then if needed using the Themepath. If found it opens the given File * to read the translations.dat file. */ - bool openTranslationsFile(File&); + bool openTranslationsFile(File &); /** * Find the translations.dat file in the given directory node. * If found it opens the given File to read the translations.dat file. */ - bool openTranslationsFile(const FSNode &node, File&, int depth = -1); + bool openTranslationsFile(const FSNode &node, File &, int depth = -1); /** * Load the list of languages from the translations.dat file -- cgit v1.2.3 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. --- common/translation.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'common/translation.h') diff --git a/common/translation.h b/common/translation.h index 71cf2b0981..77e2fdfc07 100644 --- a/common/translation.h +++ b/common/translation.h @@ -153,6 +153,21 @@ public: */ String getCurrentCharset() const; + /** + * Returns a pointer to the current charset mapping. This mapping is a + * codepage encoding -> unicode mapping and always 256 entries long. + * + * The MSB of the individual mapped (i.e. unicode) character states + * whether the character is required for this charset. If it is set, the + * character needs to be present in order to have the text displayed. + * This is used in the font loading code to detect whether the font is + * able of supporting this language. + * + * The return value might be 0 in case it's a default ASCII/ISO-8859-1 + * map. + */ + const uint32 *getCharsetMapping() const { return _charmap; } + /** * Returns currently selected translation language */ @@ -200,11 +215,15 @@ private: StringArray _langs; StringArray _langNames; + StringArray _charmaps; StringArray _messageIds; Array _currentTranslationMessages; String _currentCharset; int _currentLang; + + uint32 _charmapStart; + uint32 *_charmap; }; } // End of namespace Common -- cgit v1.2.3