summaryrefslogtreecommitdiffstats
path: root/src/render/Font.h
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2020-03-31 07:38:22 +0200
committerSergeanur <s.anureev@yandex.ua>2020-04-05 11:02:51 +0200
commitc0c09f272034d61efa38709d0e3fd1ea79bfd98f (patch)
tree44b425836ad69dd4f870f0f82ad9c896e47cdbf3 /src/render/Font.h
parentFix CFont type uint16 -> wchar (diff)
downloadre3-c0c09f272034d61efa38709d0e3fd1ea79bfd98f.tar
re3-c0c09f272034d61efa38709d0e3fd1ea79bfd98f.tar.gz
re3-c0c09f272034d61efa38709d0e3fd1ea79bfd98f.tar.bz2
re3-c0c09f272034d61efa38709d0e3fd1ea79bfd98f.tar.lz
re3-c0c09f272034d61efa38709d0e3fd1ea79bfd98f.tar.xz
re3-c0c09f272034d61efa38709d0e3fd1ea79bfd98f.tar.zst
re3-c0c09f272034d61efa38709d0e3fd1ea79bfd98f.zip
Diffstat (limited to 'src/render/Font.h')
-rw-r--r--src/render/Font.h47
1 files changed, 28 insertions, 19 deletions
diff --git a/src/render/Font.h b/src/render/Font.h
index 0659dda1..8e7ae16a 100644
--- a/src/render/Font.h
+++ b/src/render/Font.h
@@ -31,6 +31,9 @@ enum {
FONT_BANK,
FONT_PAGER,
FONT_HEADING,
+#ifdef MORE_LANGUAGES
+ FONT_JAPANESE,
+#endif
};
enum {
@@ -43,21 +46,27 @@ enum {
enum
{
FONT_LANGSET_EFIGS,
- FONT_LANGSET_RUSSIAN
+ FONT_LANGSET_RUSSIAN,
+ FONT_LANGSET_JAPANESE
};
#endif
+#define FONTJAP(style) (CFont::LanguageSet == FONT_LANGSET_JAPANESE ? FONT_JAPANESE : style)
+
class CFont
{
#ifdef MORE_LANGUAGES
static int16 Size[2][3][193];
+public:
static uint8 LanguageSet;
+private:
static int32 Slot;
+ static CSprite2d Sprite[4];
#else
static int16 Size[3][193];
+ static CSprite2d* Sprite; //[3]
#endif
static int16 &NewLine;
- static CSprite2d *Sprite; //[3]
public:
static CFontDetails& Details;
@@ -68,17 +77,25 @@ public:
static void PrintString(float x, float y, wchar *s);
static int GetNumberLines(float xstart, float ystart, wchar *s);
static void GetTextRect(CRect *rect, float xstart, float ystart, wchar *s);
+#ifdef MORE_LANGUAGES
+ static bool PrintString(float x, float y, wchar *start, wchar* &end, float spwidth, float japX);
+#else
static void PrintString(float x, float y, wchar *start, wchar *end, float spwidth);
+#endif
static float GetCharacterWidth(wchar c);
static float GetCharacterSize(wchar c);
static float GetStringWidth(wchar *s, bool spaces = false);
- static wchar *GetNextSpace(wchar *s);
- static wchar *ParseToken(wchar *s, wchar*);
+ static uint16 *GetNextSpace(wchar *s);
+#ifdef MORE_LANGUAGES
+ static uint16 *ParseToken(wchar *s, wchar*, bool japShit = false);
+#else
+ static uint16 *ParseToken(wchar *s, wchar*);
+#endif
static void DrawFonts(void);
- static wchar character_code(uint8 c);
+ static uint16 character_code(uint8 c);
static CFontDetails GetDetails() { return Details; }
- static void SetScale(float x, float y) { Details.scaleX = x; Details.scaleY = y; }
+ static void SetScale(float x, float y);
static void SetSlantRefPoint(float x, float y) { Details.slantRefX = x; Details.slantRefY = y; }
static void SetSlant(float s) { Details.slant = s; }
static void SetJustifyOn(void) {
@@ -137,19 +154,11 @@ 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(CRGBA col);
+ static void SetColor(CRGBA col);
+ static void SetDropColor(CRGBA col);
- // TODO: really just CRGBA but that isn't passed correctly
- static void SetBackgroundColor(const CRGBA &col) { Details.backgroundColor = col; }
- static void SetColor(const CRGBA &col) {
- Details.color = col;
- if(Details.alphaFade < 255.0f)
- Details.color.a *= Details.alphaFade/255.0f;
- }
- static void SetDropColor(const CRGBA &col) {
- Details.dropColor = col;
- if(Details.alphaFade < 255.0f)
- Details.dropColor.a *= Details.alphaFade/255.0f;
- }
-
+#ifdef MORE_LANGUAGES
static void ReloadFonts(uint8 set);
+#endif
};