From 760f274d815289ca2e103308bdd0d362a32877c3 Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Mon, 11 Jun 2018 22:20:51 +0200 Subject: [PATCH 1/2] Fix #7616: Use unicode dingbats for +/- buttons in CJK languages. --- src/openrct2/drawing/Font.cpp | 3 +++ src/openrct2/localisation/FormatCodes.cpp | 2 ++ src/openrct2/localisation/FormatCodes.h | 6 ++++++ 3 files changed, 11 insertions(+) diff --git a/src/openrct2/drawing/Font.cpp b/src/openrct2/drawing/Font.cpp index d745b7985a..28eb2ef5f5 100644 --- a/src/openrct2/drawing/Font.cpp +++ b/src/openrct2/drawing/Font.cpp @@ -112,6 +112,9 @@ sint32 font_sprite_get_codepoint_offset(sint32 codepoint) case UNICODE_Z_DOT: return RCT2_Z_DOT - 32; case UNICODE_Z_ACUTE: return RCT2_Z_ACUTE - 32; + case UNICODE_DINGBATS_PLUS: return 11; + case UNICODE_DINGBATS_MINUS: return 13; + default: if (codepoint < 32 || codepoint >= 256) codepoint = '?'; return codepoint - 32; diff --git a/src/openrct2/localisation/FormatCodes.cpp b/src/openrct2/localisation/FormatCodes.cpp index 217dc80ddb..1f2b314c26 100644 --- a/src/openrct2/localisation/FormatCodes.cpp +++ b/src/openrct2/localisation/FormatCodes.cpp @@ -137,6 +137,8 @@ bool utf8_should_use_sprite_for_codepoint(sint32 codepoint) case FORMAT_LEFT: case FORMAT_OPENQUOTES: case FORMAT_ENDQUOTES: + case UNICODE_DINGBATS_PLUS: + case UNICODE_DINGBATS_MINUS: return true; default: return false; diff --git a/src/openrct2/localisation/FormatCodes.h b/src/openrct2/localisation/FormatCodes.h index 4789c86dda..9aced38d85 100644 --- a/src/openrct2/localisation/FormatCodes.h +++ b/src/openrct2/localisation/FormatCodes.h @@ -181,4 +181,10 @@ enum UnicodePolish UNICODE_Z_ACUTE = 378, }; +enum UnicodeDingbats +{ + UNICODE_DINGBATS_PLUS = 0x2795, + UNICODE_DINGBATS_MINUS = 0x2796, +}; + #endif From 2cb094762076dddeedc0dc48a3b7dc86ee9d0945 Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Mon, 11 Jun 2018 22:34:01 +0200 Subject: [PATCH 2/2] =?UTF-8?q?Fix=20#7535:=20Render=20=E1=BA=9E=20ligatur?= =?UTF-8?q?e=20in=20sprite=20font.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/openrct2/drawing/Font.cpp | 3 +++ src/openrct2/localisation/FormatCodes.h | 5 +++++ 2 files changed, 8 insertions(+) diff --git a/src/openrct2/drawing/Font.cpp b/src/openrct2/drawing/Font.cpp index 28eb2ef5f5..1cc2d7bab7 100644 --- a/src/openrct2/drawing/Font.cpp +++ b/src/openrct2/drawing/Font.cpp @@ -112,6 +112,9 @@ sint32 font_sprite_get_codepoint_offset(sint32 codepoint) case UNICODE_Z_DOT: return RCT2_Z_DOT - 32; case UNICODE_Z_ACUTE: return RCT2_Z_ACUTE - 32; + // Render capital sharp-S (ẞ) with lowercase sprite (ß) + case UNICODE_CAPITAL_SHARP_S: return 223 - 32; + case UNICODE_DINGBATS_PLUS: return 11; case UNICODE_DINGBATS_MINUS: return 13; diff --git a/src/openrct2/localisation/FormatCodes.h b/src/openrct2/localisation/FormatCodes.h index 9aced38d85..1feb76f29c 100644 --- a/src/openrct2/localisation/FormatCodes.h +++ b/src/openrct2/localisation/FormatCodes.h @@ -181,6 +181,11 @@ enum UnicodePolish UNICODE_Z_ACUTE = 378, }; +enum UnicodeGerman +{ + UNICODE_CAPITAL_SHARP_S = 0x1E9E, +}; + enum UnicodeDingbats { UNICODE_DINGBATS_PLUS = 0x2795,