From 6d530002bcb986f48095a025bcfbfeb6874af30d Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Mon, 13 Aug 2018 19:57:43 +0200 Subject: [PATCH] Add ellipsis character --- resources/g2/font/ellipsis-bold.png | Bin 0 -> 168 bytes resources/g2/font/ellipsis-small.png | Bin 0 -> 164 bytes resources/g2/font/ellipsis-tiny.png | Bin 0 -> 164 bytes resources/g2/sprites.json | 18 ++++++++++++++++++ src/openrct2/drawing/Font.cpp | 3 +++ src/openrct2/localisation/FormatCodes.h | 5 +++++ src/openrct2/sprites.h | 4 +++- 7 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 resources/g2/font/ellipsis-bold.png create mode 100644 resources/g2/font/ellipsis-small.png create mode 100644 resources/g2/font/ellipsis-tiny.png diff --git a/resources/g2/font/ellipsis-bold.png b/resources/g2/font/ellipsis-bold.png new file mode 100644 index 0000000000000000000000000000000000000000..42524b3d51ccf9bc80a37e3366f3684369a00df7 GIT binary patch literal 168 zcmeAS@N?(olHy`uVBq!ia0vp^AT|pVGmtzL<`xH}cmjMvTvK(^I~e}|XXr3C{@?!h zZwyeJu_VYZn8D%MjWiG^$=lt9p@UV{1IXbl@Q5sCVBi)8VMc~ob0mO*>?NMQuI!IE zcm<4D7FTZ21qz9Jx;Tb#Tu;6bapi!4?k0wwTswIN2JI-;AG3PpOMwa)JYD@<);T3K F0RWhsDXIVf literal 0 HcmV?d00001 diff --git a/resources/g2/font/ellipsis-small.png b/resources/g2/font/ellipsis-small.png new file mode 100644 index 0000000000000000000000000000000000000000..2bdf8ccd861b40a17c70d72cb580655a6940bf81 GIT binary patch literal 164 zcmeAS@N?(olHy`uVBq!ia0vp^>_E)I#0(_uSDbwZq<8{+LR?dI(>oac|7YkhHvZrK z_iqePoUtUxFPOpM*^M+1C&}C0g`tC0)&t1lEbxddW?qWJzX3_IIbrL1SQO{WN+!=We~i`ETHGTY${Na!PC{xWt~$(696-c BC!zoV literal 0 HcmV?d00001 diff --git a/resources/g2/font/ellipsis-tiny.png b/resources/g2/font/ellipsis-tiny.png new file mode 100644 index 0000000000000000000000000000000000000000..82e294f9129d968836b37dfbdaefa5390257abe8 GIT binary patch literal 164 zcmeAS@N?(olHy`uVBq!ia0vp^>_E)S#0(^r*8U9xQak}ZA+D*q=^YIJ|1)$L8~<_!@hljQC0!qCAg>jC6&7I;J!Gca%qgD@k*tT_@uLG}_)Usv`= z9J~U?d{Nsoihx3bo-U3d9M_Wrf)Zv}wjaC!RP=}Owk3l=GEkDi)78&qol`;+01t;K A9RL6T literal 0 HcmV?d00001 diff --git a/resources/g2/sprites.json b/resources/g2/sprites.json index 6aa452ace1..adb43ff9f0 100644 --- a/resources/g2/sprites.json +++ b/resources/g2/sprites.json @@ -764,6 +764,12 @@ "palette": "keep", "forceBmp": true }, + { + "path": "font/ellipsis-small.png", + "y_offset": 6, + "palette": "keep", + "forceBmp": true + }, { "path": "font/ae-uc-bold.png", "y_offset": 0, @@ -1089,6 +1095,12 @@ "palette": "keep", "forceBmp": true }, + { + "path": "font/ellipsis-bold.png", + "y_offset": 6, + "palette": "keep", + "forceBmp": true + }, { "path": "font/ae-uc-tiny.png", "y_offset": 0, @@ -1421,5 +1433,11 @@ "y_offset": 0, "palette": "keep", "forceBmp": true + }, + { + "path": "font/ellipsis-tiny.png", + "y_offset": 4, + "palette": "keep", + "forceBmp": true } ] diff --git a/src/openrct2/drawing/Font.cpp b/src/openrct2/drawing/Font.cpp index b89c4d30eb..f60037f076 100644 --- a/src/openrct2/drawing/Font.cpp +++ b/src/openrct2/drawing/Font.cpp @@ -352,6 +352,8 @@ int32_t font_sprite_get_codepoint_offset(int32_t codepoint) case UNICODE_INTERPUNCT: return SPR_G2_INTERPUNCT - SPR_CHAR_START; + case UNICODE_ELLIPSIS: + return SPR_G2_ELLIPSIS - SPR_CHAR_START; // Romanian case UNICODE_A_BREVE_UC: @@ -543,6 +545,7 @@ bool font_supports_string_sprite(const utf8* text) case UNICODE_S_CEDILLA: case UNICODE_INTERPUNCT: + case UNICODE_ELLIPSIS: case UNICODE_A_BREVE_UC: case UNICODE_A_BREVE: diff --git a/src/openrct2/localisation/FormatCodes.h b/src/openrct2/localisation/FormatCodes.h index 1b9d2c6e18..f0689376b1 100644 --- a/src/openrct2/localisation/FormatCodes.h +++ b/src/openrct2/localisation/FormatCodes.h @@ -304,4 +304,9 @@ enum UnicodeCurrency UNICODE_F_WITH_HOOK_UC = 401, }; +enum UnicodePunctuation +{ + UNICODE_ELLIPSIS = 8230, +}; + #endif diff --git a/src/openrct2/sprites.h b/src/openrct2/sprites.h index d3718965be..22fa434e6f 100644 --- a/src/openrct2/sprites.h +++ b/src/openrct2/sprites.h @@ -911,7 +911,9 @@ enum 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_ELLIPSIS = SPR_G2_CHAR_BEGIN + 61, + + SPR_G2_CHAR_END = SPR_G2_ELLIPSIS, SPR_G2_GLYPH_COUNT = (SPR_G2_CHAR_END - SPR_G2_CHAR_BEGIN) + 1, // 0x60000, chosen because it's a round hex number