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!ia0y~yVBln6VBlh6W?*2D&Yq*oz`(#0;1lBd|Ns9EhX4N= zI*g6~w?y%|F)%PNmIV0)GdMiEkp|)s02T=zPERZ^O;K25_#zteNL-VY@G911V kz%lRN7lvkDduE2Uja;1pThzZXFfcH9y85}Sb4q9e01*NO>_%)r1c48n{Iv*t)J zFfg!}c>21sKVp~TGqHNa_WBkB1B1G!i(?4K_2dUp2Np;jJg~j7(YVpEmhJGGr#!)j kC7;=+&scme;Q%v3ZUy^+AWL%*1_lNOPgg&ebxsLQ0Dm(z#{d8T 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!ia0y~yU|?lnVBlb4W?*3OnSXZ$0|Nt3fKQ0)|Ns9x82O>_%)r1c48n{Iv*t)J zFfg!}c>21sKVp~TGg11ORouhCz#!)7;uyklJ^4aX!i=g0MyGQ&464173;`F|EsbBW SH!(0UFnGH9xvX8)K++{ae!&b5&u*lFI7!~_E({&4vK|Z!44efXk;M!Q+`=Ht$S`Y;1Oo#D zdx@v7EBhmMIer0&<35V(85kJkJY5_^IIbrLBqYo@c)(z8VOV literal 0 HcmV?d00001 diff --git a/resources/g2/font/t-comma-tiny.png b/resources/g2/font/t-comma-tiny.png new file mode 100644 index 0000000000000000000000000000000000000000..f74c26bc6ebbc4fe5257b8f6ae02799382c550ec GIT binary patch literal 173 zcmeAS@N?(olHy`uVBq!ia0y~yU|?lnU|?rrW?*30dosV4fq{W1z$e5tRX4qZ;s1Yz z4rAm0?SKEqFfcGMmIV0)GdMiEkp|)}%W!f`$MK|(@6azcRZfdzbNXKW56oMB*)aAbPB Uvv`Rq0|Nttr>mdKI;Vst0O%1dF#rGn 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!ia0y~yVBlb2VBltAW?*2j|EjW$fq{W1z$e5tRX4qZ;s1Yz z4rAm0?SKEqFfcGMmIV0)GdMiEkp|)mdKI;Vst0JbMBJpcdz 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