summaryrefslogtreecommitdiffstats
path: root/src/render/Font.h
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2020-04-26 22:49:24 +0200
committerSergeanur <s.anureev@yandex.ua>2020-04-27 21:41:09 +0200
commitfe353a7cc9831a09026842106bd3ff0fdb3242b4 (patch)
tree61e573e5fb4d80ba65f7a5e82cb08a280e3b863b /src/render/Font.h
parentMerge branch 'master' into MoreLanguages (diff)
downloadre3-fe353a7cc9831a09026842106bd3ff0fdb3242b4.tar
re3-fe353a7cc9831a09026842106bd3ff0fdb3242b4.tar.gz
re3-fe353a7cc9831a09026842106bd3ff0fdb3242b4.tar.bz2
re3-fe353a7cc9831a09026842106bd3ff0fdb3242b4.tar.lz
re3-fe353a7cc9831a09026842106bd3ff0fdb3242b4.tar.xz
re3-fe353a7cc9831a09026842106bd3ff0fdb3242b4.tar.zst
re3-fe353a7cc9831a09026842106bd3ff0fdb3242b4.zip
Diffstat (limited to 'src/render/Font.h')
-rw-r--r--src/render/Font.h23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/render/Font.h b/src/render/Font.h
index 73e9522a..9b4e7132 100644
--- a/src/render/Font.h
+++ b/src/render/Font.h
@@ -49,25 +49,23 @@ enum
FONT_LANGSET_EFIGS,
FONT_LANGSET_RUSSIAN,
FONT_LANGSET_POLISH,
- FONT_LANGSET_JAPANESE
+ FONT_LANGSET_JAPANESE,
LANGSET_MAX
};
-#endif
-#define FONTJAP(style) (CFont::LanguageSet == FONT_LANGSET_JAPANESE ? FONT_JAPANESE : style)
+#define FONT_LOCALE(style) (CFont::IsJapanese() ? FONT_JAPANESE : style)
+#else
+#define FONT_LOCALE(style) (style)
+#endif
class CFont
{
#ifdef MORE_LANGUAGES
static int16 Size[LANGSET_MAX][MAX_FONTS][193];
-public:
static uint8 LanguageSet;
-private:
static int32 Slot;
- static CSprite2d Sprite[4];
#else
static int16 Size[MAX_FONTS][193];
- static CSprite2d* Sprite; //[3]
#endif
static int16 NewLine;
static CSprite2d Sprite[MAX_FONTS];
@@ -89,6 +87,9 @@ public:
static float GetCharacterWidth(wchar c);
static float GetCharacterSize(wchar c);
static float GetStringWidth(wchar *s, bool spaces = false);
+#ifdef MORE_LANGUAGES
+ static float GetStringWidth_Jap(wchar* s);
+#endif
static uint16 *GetNextSpace(wchar *s);
#ifdef MORE_LANGUAGES
static uint16 *ParseToken(wchar *s, wchar*, bool japShit = false);
@@ -158,16 +159,16 @@ public:
static void SetRightJustifyWrap(float wrap) { Details.rightJustifyWrap = wrap; }
static void SetAlphaFade(float fade) { Details.alphaFade = fade; }
static void SetDropShadowPosition(int16 pos) { Details.dropShadowPosition = pos; }
- static void SetBackgroundColor(const CRGBA &col);
- static void SetColor(const CRGBA &col);
- static void SetDropColor(const CRGBA &col);
+ static void SetBackgroundColor(CRGBA col);
+ static void SetColor(CRGBA col);
+ static void SetDropColor(CRGBA col);
#ifdef MORE_LANGUAGES
static void ReloadFonts(uint8 set);
// japanese stuff
static bool IsAnsiCharacter(wchar* s);
- static bool IsJapanesePunctuation(wchar* a1);
+ static bool IsJapanesePunctuation(wchar* str);
static bool IsJapanese() { return LanguageSet == FONT_LANGSET_JAPANESE; }
static bool IsJapaneseFont() { return IsJapanese() && (Details.style == FONT_JAPANESE || Details.style == FONT_PAGER); }
#endif