From fdd18dd29bbd28d7006713ff5eca8f196d090365 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Mon, 30 Jul 2018 17:54:02 +0200 Subject: [PATCH] Fix #7830: Add font sprites for Romanian characters --- distribution/changelog.txt | 2 +- resources/g2/font/a-breve-uc-bold.png | Bin 0 -> 187 bytes resources/g2/font/a-breve-uc-small.png | Bin 0 -> 186 bytes resources/g2/font/a-breve-uc-tiny.png | Bin 0 -> 169 bytes resources/g2/font/t-comma-bold.png | Bin 0 -> 183 bytes resources/g2/font/t-comma-small.png | Bin 0 -> 177 bytes resources/g2/font/t-comma-tiny.png | Bin 0 -> 173 bytes resources/g2/font/t-comma-uc-bold.png | Bin 0 -> 177 bytes resources/g2/font/t-comma-uc-small.png | Bin 0 -> 174 bytes resources/g2/font/t-comma-uc-tiny.png | Bin 0 -> 171 bytes resources/g2/sprites.json | 54 ++++++++++++++++++++++++ src/openrct2/drawing/Font.cpp | 23 ++++++++++ src/openrct2/localisation/FormatCodes.h | 10 +++++ src/openrct2/sprites.h | 6 ++- 14 files changed, 93 insertions(+), 2 deletions(-) create mode 100644 resources/g2/font/a-breve-uc-bold.png create mode 100644 resources/g2/font/a-breve-uc-small.png create mode 100644 resources/g2/font/a-breve-uc-tiny.png create mode 100644 resources/g2/font/t-comma-bold.png create mode 100644 resources/g2/font/t-comma-small.png create mode 100644 resources/g2/font/t-comma-tiny.png create mode 100644 resources/g2/font/t-comma-uc-bold.png create mode 100644 resources/g2/font/t-comma-uc-small.png create mode 100644 resources/g2/font/t-comma-uc-tiny.png diff --git a/distribution/changelog.txt b/distribution/changelog.txt index f11e482ba0..5c2efadfd1 100644 --- a/distribution/changelog.txt +++ b/distribution/changelog.txt @@ -4,7 +4,7 @@ - Feature: [#6998] Guests now wait for passing vehicles before crossing railway tracks. - Feature: [#7694] Debug option to visualize paths that the game detects as wide. - Feature: [#7771] Danish translation. -- Feature: [#7797, #7802, #7821] Add sprite font glyphs for Danish, Norwegian, Russian, Turkish and Catalan. +- Feature: [#7797, #7802, #7821, #7830] Add sprite font glyphs for Danish, Norwegian, Russian, Turkish, Catalan and Romanian. - Fix: [#3177] Wrong keys displayed in shortcut menu. - Fix: [#4039] No sprite font glyph for German opening quotation mark. - Fix: [#7533] Screenshot is incorrectly named/file is not generated in CJK language. diff --git a/resources/g2/font/a-breve-uc-bold.png b/resources/g2/font/a-breve-uc-bold.png new file mode 100644 index 0000000000000000000000000000000000000000..ead8f463671a0e6478222a51343f9f9781e55b91 GIT binary patch literal 187 zcmeAS@N?(olHy`uVBq!ia0vp^oIuRQ#0(^*v*+jnDV_kI5ZC|z|93F_|Ig52Z2Z3^ ziq8!w&R7!U7tG-B>_!@hljQC0!qCAg>jC6&7I;J!Gca%qgD@k*tT_@uLG}_)Usv`= z>~ef2;>&MtUk?=0@N{tu;kcgsAnM?O1yaWj9N6C0*l5gjXr9$qhQn6^IOhHP!qCiX a&&;s4k*hOci~2X99tKZWKbLh*2~7YI0yaqi literal 0 HcmV?d00001 diff --git a/resources/g2/font/a-breve-uc-small.png b/resources/g2/font/a-breve-uc-small.png new file mode 100644 index 0000000000000000000000000000000000000000..7d6cb9aac48adaebc7793e31d38517343364d4ca GIT binary patch literal 186 zcmeAS@N?(olHy`uVBq!ia0vp^96-#)#0(_Ato$wvq<8{+LR|m<|KGvz|35>AvGMO>_%)r16)Xgo-$S`Y;1W=H@#M9T6 z{SmtypNZ8Yw%50SLh7C_jv*Y^lOIGKSRi%q!1l&Q<3`6?w!>?l@&q52d}g0MWAV9! b1I!G$73>FsEX_rLS{OWC{an^LB{Ts5e={}5 literal 0 HcmV?d00001 diff --git a/resources/g2/font/a-breve-uc-tiny.png b/resources/g2/font/a-breve-uc-tiny.png new file mode 100644 index 0000000000000000000000000000000000000000..1ffa9dfba47fe11e08e65158c462ed60cf8dd297 GIT binary patch literal 169 zcmeAS@N?(olHy`uVBq!ia0vp^tU%1c#0(^T=HFcbq<8{+LR|m<|KGvz|35>AvGMO>_%)r1c48n{Iv*t(u1=&kHeO=if zvCHw9D1FQ-?g0vkdAc};a9mHmkd!c^s)5nzoDG9&uOvgj1$Im07wkq<8{+LR?dI(>oac|7YkhHvZrK z_iqePoUtUxFPOpM*^M+1C&}C0g`tC0)&t1lEbxddW?I_!@hljQC0!qCAg>jC6&7I;J!Gca%qgD@k*tT_@uLG}_)Usv`= z>~j19vfI_JDgcF~JY5_^IIbr@NJt1sP6)6)uz)Y^jLm_BGYkw8j!bWN7B4Xcs$%eT L^>bP0l+XkK=n*Y3 literal 0 HcmV?d00001 diff --git a/resources/g2/font/t-comma-uc-bold.png b/resources/g2/font/t-comma-uc-bold.png new file mode 100644 index 0000000000000000000000000000000000000000..e3b9538aa2a4e28c96b491b86484c9ad278843d4 GIT binary patch literal 177 zcmeAS@N?(olHy`uVBq!ia0vp^96-#?#0(_uzp88lQak}ZA+D*q=^YIJ|1)$L8~<_!@hljQC0!qCAg>jC6&7I;J!15FVIVMc~ob0mO*>?NMQuI!K4 z<@kA7bQA^u0EOf{T^vI=t|woJI%r@j)1s3tVZklnvAH4f6(d_U8$;t|_Cmie_wE5z OGI+ZBxvX_E)T#0(_Q{j0YIQak}ZA+D*q=^YIJ|1)$L8~<_!@hljQC0!qCAg>jC6&7I;J!15FVIVMc~ob0mO*>?NMQuI!K4 z<@g2kIKFK$0}4rdx;Tb#Tu;6bb-=*1?cgV7=I4whOU@lQaF~H%nh*QAto|&JI~Y7& L{an^LB{Ts5QCBY7 literal 0 HcmV?d00001 diff --git a/resources/g2/font/t-comma-uc-tiny.png b/resources/g2/font/t-comma-uc-tiny.png new file mode 100644 index 0000000000000000000000000000000000000000..73de1fbe33fb39f19c9d44efcd44015dfa2a540f GIT binary patch literal 171 zcmeAS@N?(olHy`uVBq!ia0vp^tU%1c#0(^T=HFcbq<8{+LR?dI(>oac|7YkhHvZrK z_iqePoUtUxFPOpM*^M+1C&}C0g`tC0)&t1lEbxddW?Ibe{dVDg_jh@N{tu;kcfBAt_--RfFSP#>Qs`1`-Ag3>s&cUhIG8QwUVU;OXk; Jvd$@?2>`YyEj<7L literal 0 HcmV?d00001 diff --git a/resources/g2/sprites.json b/resources/g2/sprites.json index fc40afc72e..6aa452ace1 100644 --- a/resources/g2/sprites.json +++ b/resources/g2/sprites.json @@ -746,6 +746,24 @@ "palette": "keep", "forceBmp": true }, + { + "path": "font/a-breve-uc-small.png", + "y_offset": 0, + "palette": "keep", + "forceBmp": true + }, + { + "path": "font/t-comma-uc-small.png", + "y_offset": 0, + "palette": "keep", + "forceBmp": true + }, + { + "path": "font/t-comma-small.png", + "y_offset": 1, + "palette": "keep", + "forceBmp": true + }, { "path": "font/ae-uc-bold.png", "y_offset": 0, @@ -1053,6 +1071,24 @@ "palette": "keep", "forceBmp": true }, + { + "path": "font/a-breve-uc-bold.png", + "y_offset": 0, + "palette": "keep", + "forceBmp": true + }, + { + "path": "font/t-comma-uc-bold.png", + "y_offset": 0, + "palette": "keep", + "forceBmp": true + }, + { + "path": "font/t-comma-bold.png", + "y_offset": 1, + "palette": "keep", + "forceBmp": true + }, { "path": "font/ae-uc-tiny.png", "y_offset": 0, @@ -1367,5 +1403,23 @@ "y_offset": 2, "palette": "keep", "forceBmp": true + }, + { + "path": "font/a-breve-uc-tiny.png", + "y_offset": 0, + "palette": "keep", + "forceBmp": true + }, + { + "path": "font/t-comma-uc-tiny.png", + "y_offset": 0, + "palette": "keep", + "forceBmp": true + }, + { + "path": "font/t-comma-tiny.png", + "y_offset": 0, + "palette": "keep", + "forceBmp": true } ] diff --git a/src/openrct2/drawing/Font.cpp b/src/openrct2/drawing/Font.cpp index aa32206de3..b89c4d30eb 100644 --- a/src/openrct2/drawing/Font.cpp +++ b/src/openrct2/drawing/Font.cpp @@ -353,6 +353,22 @@ int32_t font_sprite_get_codepoint_offset(int32_t codepoint) case UNICODE_INTERPUNCT: return SPR_G2_INTERPUNCT - SPR_CHAR_START; + // Romanian + case UNICODE_A_BREVE_UC: + return SPR_G2_A_BREVE_UPPER - SPR_CHAR_START; + case UNICODE_A_BREVE: + // Render as รข, there is no visual difference on this scale. + return 194; + case UNICODE_S_COMMA_UC: + // Also no visual difference. + return SPR_G2_S_CEDILLA_UPPER - SPR_CHAR_START; + case UNICODE_S_COMMA: + return SPR_G2_S_CEDILLA_LOWER - SPR_CHAR_START; + case UNICODE_T_COMMA_UC: + return SPR_G2_T_COMMA_UPPER - SPR_CHAR_START; + case UNICODE_T_COMMA: + return SPR_G2_T_COMMA_LOWER - SPR_CHAR_START; + // This is to catch capitalised versions of the guilder sign case UNICODE_F_WITH_HOOK_UC: return 'F' - 32; @@ -528,6 +544,13 @@ bool font_supports_string_sprite(const utf8* text) case UNICODE_INTERPUNCT: + case UNICODE_A_BREVE_UC: + case UNICODE_A_BREVE: + case UNICODE_S_COMMA_UC: + case UNICODE_S_COMMA: + case UNICODE_T_COMMA_UC: + case UNICODE_T_COMMA: + supported = true; break; default: diff --git a/src/openrct2/localisation/FormatCodes.h b/src/openrct2/localisation/FormatCodes.h index bd2f997360..1b9d2c6e18 100644 --- a/src/openrct2/localisation/FormatCodes.h +++ b/src/openrct2/localisation/FormatCodes.h @@ -280,6 +280,16 @@ enum UnicodeTurkish UNICODE_S_CEDILLA = 351, }; +enum UnicodeRomanian +{ + UNICODE_A_BREVE_UC = 258, + UNICODE_A_BREVE = 259, + UNICODE_S_COMMA_UC = 536, + UNICODE_S_COMMA = 537, + UNICODE_T_COMMA_UC = 538, + UNICODE_T_COMMA = 539, +}; + enum UnicodeDingbats { UNICODE_DINGBATS_PLUS = 0x2795, diff --git a/src/openrct2/sprites.h b/src/openrct2/sprites.h index c496b15e4d..d3718965be 100644 --- a/src/openrct2/sprites.h +++ b/src/openrct2/sprites.h @@ -907,7 +907,11 @@ enum SPR_G2_INTERPUNCT = SPR_G2_CHAR_BEGIN + 57, - SPR_G2_CHAR_END = SPR_G2_INTERPUNCT, + SPR_G2_A_BREVE_UPPER = SPR_G2_CHAR_BEGIN + 58, + SPR_G2_T_COMMA_UPPER = SPR_G2_CHAR_BEGIN + 59, + SPR_G2_T_COMMA_LOWER = SPR_G2_CHAR_BEGIN + 60, + + SPR_G2_CHAR_END = SPR_G2_T_COMMA_LOWER, SPR_G2_GLYPH_COUNT = (SPR_G2_CHAR_END - SPR_G2_CHAR_BEGIN) + 1, // 0x60000, chosen because it's a round hex number