From e6472eec0013b2e9458266de12fc92ff9e70e423 Mon Sep 17 00:00:00 2001 From: Michael Steenbeek Date: Tue, 24 Jul 2018 13:54:19 +0200 Subject: [PATCH] Add Turkish sprite font glyphs --- resources/g2/font/g-breve-bold.png | Bin 0 -> 176 bytes resources/g2/font/g-breve-small.png | Bin 0 -> 176 bytes resources/g2/font/g-breve-tiny.png | Bin 0 -> 180 bytes resources/g2/font/g-breve-uc-bold.png | Bin 0 -> 196 bytes resources/g2/font/g-breve-uc-small.png | Bin 0 -> 187 bytes resources/g2/font/g-breve-uc-tiny.png | Bin 0 -> 174 bytes resources/g2/font/i-with-dot-uc-bold.png | Bin 0 -> 164 bytes resources/g2/font/i-with-dot-uc-small.png | Bin 0 -> 164 bytes resources/g2/font/i-with-dot-uc-tiny.png | Bin 0 -> 164 bytes resources/g2/font/i-without-dot-bold.png | Bin 0 -> 161 bytes resources/g2/font/i-without-dot-small.png | Bin 0 -> 161 bytes resources/g2/font/i-without-dot-tiny.png | Bin 0 -> 161 bytes resources/g2/font/s-cedilla-bold.png | Bin 0 -> 185 bytes resources/g2/font/s-cedilla-small.png | Bin 0 -> 181 bytes resources/g2/font/s-cedilla-tiny.png | Bin 0 -> 176 bytes resources/g2/font/s-cedilla-uc-bold.png | Bin 0 -> 187 bytes resources/g2/font/s-cedilla-uc-small.png | Bin 0 -> 188 bytes resources/g2/font/s-cedilla-uc-tiny.png | Bin 0 -> 173 bytes resources/g2/sprites.json | 108 ++++++++++++++++++++++ src/openrct2/drawing/Font.cpp | 21 +++++ src/openrct2/localisation/FormatCodes.h | 10 ++ src/openrct2/sprites.h | 9 +- 22 files changed, 147 insertions(+), 1 deletion(-) create mode 100644 resources/g2/font/g-breve-bold.png create mode 100644 resources/g2/font/g-breve-small.png create mode 100644 resources/g2/font/g-breve-tiny.png create mode 100644 resources/g2/font/g-breve-uc-bold.png create mode 100644 resources/g2/font/g-breve-uc-small.png create mode 100644 resources/g2/font/g-breve-uc-tiny.png create mode 100644 resources/g2/font/i-with-dot-uc-bold.png create mode 100644 resources/g2/font/i-with-dot-uc-small.png create mode 100644 resources/g2/font/i-with-dot-uc-tiny.png create mode 100644 resources/g2/font/i-without-dot-bold.png create mode 100644 resources/g2/font/i-without-dot-small.png create mode 100644 resources/g2/font/i-without-dot-tiny.png create mode 100644 resources/g2/font/s-cedilla-bold.png create mode 100644 resources/g2/font/s-cedilla-small.png create mode 100644 resources/g2/font/s-cedilla-tiny.png create mode 100644 resources/g2/font/s-cedilla-uc-bold.png create mode 100644 resources/g2/font/s-cedilla-uc-small.png create mode 100644 resources/g2/font/s-cedilla-uc-tiny.png diff --git a/resources/g2/font/g-breve-bold.png b/resources/g2/font/g-breve-bold.png new file mode 100644 index 0000000000000000000000000000000000000000..bee63f5345186f70c30a448388b6714369c49769 GIT binary patch literal 176 zcmeAS@N?(olHy`uVBq!ia0vp^>_E)J#0(@a|MqVNaRPioTzTaLIvD={XXr3C{?D^7 zBn&9dSQ6wH%;50sMjD8d1>}ba4#fxSsqV>c9f2!wibc4_>$;u|Z*iPQn9w28OBII5Kno8m`MhS?`L%B~*0#|>1- N;OXk;vd$@?2>@z-EeZet literal 0 HcmV?d00001 diff --git a/resources/g2/font/g-breve-tiny.png b/resources/g2/font/g-breve-tiny.png new file mode 100644 index 0000000000000000000000000000000000000000..ef6bca05f77ac418ce21422185eff75c48951494 GIT binary patch literal 180 zcmeAS@N?(olHy`uVBq!ia0vp^tU%1k#0(_c5A*Q?DV_kI5LXUwfewcM{~0=rjsMU6 z5~KhWXDkWw3ubV5b|VeMN%D4gVd!9$^#F1>3p^r=85p>QL70(Y)*K0-AbW|YuPgf_ zb_s4y>F4TtAd?k6T^vI=t|wneN|;gAaImY<@hijOGt3G>pBWC9u(3(AF+`=a&17qA R=m9Eb@O1TaS?83{1OUmsEIxmEF#P||&|z%+e~PTK z8&I6FB*-tA!Qt7BG!Q4r+uensgH_f8$l)yTh%9Dc;1&j9Muu5)B!GhKC7!;n?2p(b zxS5SLYV&G=LWZ6$jv*Y^lM|v29ylO*?f}EG!x9o9&e9Ug>~s@mth;)^AUBKg@Rg;k h4jY*hOwZIyFfbSKh^wje)&Mm#c)I$ztaD0e0sue7F;xHn literal 0 HcmV?d00001 diff --git a/resources/g2/font/g-breve-uc-small.png b/resources/g2/font/g-breve-uc-small.png new file mode 100644 index 0000000000000000000000000000000000000000..5baa42d680bedf574dba7af24653ac988300b345 GIT binary patch literal 187 zcmeAS@N?(olHy`uVBq!ia0vp^96-#?#0(_uzp88lQak}ZA+A8WgW>;wh7M!n|DN{N zbAf!uk|4ie28U-i(mGR&GI0Tg5}@$_|Nf5a}q zEzdOnim?<>NW;^`F@)oK@`I=Y3#1M+C@D)kvrnI~xhXNu;&9J%o~&XC3vP)S{0t0J XcX9R`TE{5^^)Pt4`njxgN@xNA_9iYM literal 0 HcmV?d00001 diff --git a/resources/g2/font/g-breve-uc-tiny.png b/resources/g2/font/g-breve-uc-tiny.png new file mode 100644 index 0000000000000000000000000000000000000000..623092cdb5f2b435706853746d51fafdf07b9195 GIT binary patch literal 174 zcmeAS@N?(olHy`uVBq!ia0vp^tU%1k#0(_c5A*Q?DV_kI5LZEYfewcM{~0=rjsG7} z(tZsTXDkWw3ubV5b|VeMN%D4gVd!9$^#F1>3p^r=85p>QL70(Y)*K0-AbW|YuPgf_ zb_s4KW5cv~8=#Q1r;B3<$Mxh3NeMHm8W^3b literal 0 HcmV?d00001 diff --git a/resources/g2/font/i-with-dot-uc-bold.png b/resources/g2/font/i-with-dot-uc-bold.png new file mode 100644 index 0000000000000000000000000000000000000000..220fbe009a05f0e32a2e9961ba5e9eec59055fa8 GIT binary patch literal 164 zcmeAS@N?(olHy`uVBq!ia0vp^EI`c7#0(@=Pad%VQak}ZA+GFR0v!zh|1)$L8~@jP zCo~Z#&R7!U7tG-B>_!@hljQC0!qCAg>jC6&7I;J!15FVIVMc~ob0mO*>?NMQuI!K4 zCAbX?T;-#_1BC=VT^vI=t|wnem~oEb(1{Cd3}y>hU03TkT>(lmc)I$ztaD0e0sv5b BC#L`a literal 0 HcmV?d00001 diff --git a/resources/g2/font/i-with-dot-uc-small.png b/resources/g2/font/i-with-dot-uc-small.png new file mode 100644 index 0000000000000000000000000000000000000000..9262c3c9bef3e8252949de2f6a1100221f777d09 GIT binary patch literal 164 zcmeAS@N?(olHy`uVBq!ia0vp^%s|Y|1R{@%-gg92JOMr-u1Ycj9Sr~fGjtdm|FH=O_DAdz z+={$@>rB4^g#^C310@+eUHx3vIVCg!06gv} A00000 literal 0 HcmV?d00001 diff --git a/resources/g2/font/i-with-dot-uc-tiny.png b/resources/g2/font/i-with-dot-uc-tiny.png new file mode 100644 index 0000000000000000000000000000000000000000..394e0dc0a2ade4863a24cef0cd1d61bc4b58b397 GIT binary patch literal 164 zcmeAS@N?(olHy`uVBq!ia0vp^%s|Y+1R@<9*S-f*JOMr-uEsI~9Sr~fGjtdm|6h5E zqZcU7SQ6wH%;50sMjD8dmdKI;Vst0BL?E ASO5S3 literal 0 HcmV?d00001 diff --git a/resources/g2/font/i-without-dot-bold.png b/resources/g2/font/i-without-dot-bold.png new file mode 100644 index 0000000000000000000000000000000000000000..e76174aeed8f4d11e59910194c7e32112d7cb982 GIT binary patch literal 161 zcmeAS@N?(olHy`uVBq!ia0vp^EI`b`#0(@C$8MVjq<8{+LR^7#2gCpW3?0VC|2^%k z=K}eRB|(0{3=Yq3q=7g|-tI089jvk*Kn`btM`SSr1Gg{;GcwGYBLNg-FY)wsWq-sj x!C@lz|FKRgP>9dd#W95Adh&&Y8GS6d402zX-?!g!)&$Bhc)I$ztaD0e0szGRCWin3 literal 0 HcmV?d00001 diff --git a/resources/g2/font/i-without-dot-small.png b/resources/g2/font/i-without-dot-small.png new file mode 100644 index 0000000000000000000000000000000000000000..a96fc162ec26ab67ee97fe8a1747e7d3822012e0 GIT binary patch literal 161 zcmeAS@N?(olHy`uVBq!ia0vp^%s|Y+1R@<9*S-f*JOMr-u0Xnj;s1Yz4rAm0p7z#r zfqcf2AirP+hi5m^K%69RcNc~ZR#^`qhqJ&VvY3H^TNs2H8D`Cq01C2~c>21sKVp~Q wFp=)>yzvSs#OLYa7{YNqIUr$1GYc<+d;;^&tNYfe0%aIHUHx3vIVCg!0KzdQ9{>OV literal 0 HcmV?d00001 diff --git a/resources/g2/font/i-without-dot-tiny.png b/resources/g2/font/i-without-dot-tiny.png new file mode 100644 index 0000000000000000000000000000000000000000..6a559798855f2a602eaa11526b6b7f6b38fa1f75 GIT binary patch literal 161 zcmeAS@N?(olHy`uVBq!ia0vp^%s|Y_1S0>+?=u8aJOMr-t_-pQ9Sr~fGjtdm|L6W} zyb~zSSQ6wH%;50sMjD8d`N+B$ogH literal 0 HcmV?d00001 diff --git a/resources/g2/font/s-cedilla-bold.png b/resources/g2/font/s-cedilla-bold.png new file mode 100644 index 0000000000000000000000000000000000000000..c041b2b1d09c8fbd5dd6d1ec16066546b5443d60 GIT binary patch literal 185 zcmeAS@N?(olHy`uVBq!ia0vp^>_E)L#0(@^7p<8Gq<8{+LR=X_1UeZ0|7YkhHvYft zo5*FLIAckWUoeBivm0q3PLj8~3quF1tOt<8S>O>_%)r1c48n{Iv*t(u1=&kHeO=if zu}g3po61G}-3=5{^K@|x;kcgsAnL#Zslx`j%*|O$&0#!;uSl?6=I5El%Cm}H;)f(d Y{yBDo1IN}a1nOY$boFyt=akR{0CXWRVgLXD literal 0 HcmV?d00001 diff --git a/resources/g2/font/s-cedilla-small.png b/resources/g2/font/s-cedilla-small.png new file mode 100644 index 0000000000000000000000000000000000000000..a3e039c00e8e056c581716e047c9774701d0e948 GIT binary patch literal 181 zcmeAS@N?(olHy`uVBq!ia0vp^Y(UJ##0(@~B^+M>q<8{+LR?v71v(i1|7YkhHvZ4? zmE#ytoUtUxFPOpM*^M+1C&}C0g`tC0)&t1lEbxddW?gTe~DWM4ftnDsq literal 0 HcmV?d00001 diff --git a/resources/g2/font/s-cedilla-tiny.png b/resources/g2/font/s-cedilla-tiny.png new file mode 100644 index 0000000000000000000000000000000000000000..87506ba6725778012a143ae0470a4bb2ab9368f8 GIT binary patch literal 176 zcmeAS@N?(olHy`uVBq!ia0vp^tU%1p#0(_&p3JWWQak}ZA+8oO0v!zh|1)$L8~?u% zv8EX)&R7!U7tG-B>_!@hljQC0!qCAg>jC6&7I;J!Gca%qgD@k*tT_@uLG}_)Usv`= z>=Il?YEAaffpQG8o-U3d9M_W{Bqapc9x&)_bo|V4xP*u`p00i_>zopr010g`z5oCK literal 0 HcmV?d00001 diff --git a/resources/g2/font/s-cedilla-uc-small.png b/resources/g2/font/s-cedilla-uc-small.png new file mode 100644 index 0000000000000000000000000000000000000000..fe23aa3ffe0255e42a996d8a43079a74e02539eb GIT binary patch literal 188 zcmeAS@N?(olHy`uVBq!ia0vp^Y(UJz#0(^DELHY`H~~H(u2RMV9Sr~fGjtdm|F<-o z^c5)1SQ6wH%;50sMjD8dbP0l+XkKPeCj< literal 0 HcmV?d00001 diff --git a/resources/g2/sprites.json b/resources/g2/sprites.json index 3d3716fb20..10ee4f98e7 100644 --- a/resources/g2/sprites.json +++ b/resources/g2/sprites.json @@ -704,6 +704,42 @@ "palette": "keep", "forceBmp": true }, + { + "path": "font/g-breve-uc-small.png", + "y_offset": -1, + "palette": "keep", + "forceBmp": true + }, + { + "path": "font/i-with-dot-uc-small.png", + "y_offset": -1, + "palette": "keep", + "forceBmp": true + }, + { + "path": "font/s-cedilla-uc-small.png", + "y_offset": 0, + "palette": "keep", + "forceBmp": true + }, + { + "path": "font/g-breve-small.png", + "y_offset": 0, + "palette": "keep", + "forceBmp": true + }, + { + "path": "font/i-without-dot-small.png", + "y_offset": 2, + "palette": "keep", + "forceBmp": true + }, + { + "path": "font/s-cedilla-small.png", + "y_offset": 2, + "palette": "keep", + "forceBmp": true + }, { "path": "font/ae-uc-bold.png", "y_offset": 0, @@ -969,6 +1005,42 @@ "palette": "keep", "forceBmp": true }, + { + "path": "font/g-breve-uc-bold.png", + "y_offset": -1, + "palette": "keep", + "forceBmp": true + }, + { + "path": "font/i-with-dot-uc-bold.png", + "y_offset": -1, + "palette": "keep", + "forceBmp": true + }, + { + "path": "font/s-cedilla-uc-bold.png", + "y_offset": 0, + "palette": "keep", + "forceBmp": true + }, + { + "path": "font/g-breve-bold.png", + "y_offset": 0, + "palette": "keep", + "forceBmp": true + }, + { + "path": "font/i-without-dot-bold.png", + "y_offset": 2, + "palette": "keep", + "forceBmp": true + }, + { + "path": "font/s-cedilla-bold.png", + "y_offset": 2, + "palette": "keep", + "forceBmp": true + }, { "path": "font/ae-uc-tiny.png", "y_offset": 0, @@ -1241,5 +1313,41 @@ "y_offset": 1, "palette": "keep", "forceBmp": true + }, + { + "path": "font/g-breve-uc-tiny.png", + "y_offset": -1, + "palette": "keep", + "forceBmp": true + }, + { + "path": "font/i-with-dot-uc-tiny.png", + "y_offset": -1, + "palette": "keep", + "forceBmp": true + }, + { + "path": "font/s-cedilla-uc-tiny.png", + "y_offset": 0, + "palette": "keep", + "forceBmp": true + }, + { + "path": "font/g-breve-tiny.png", + "y_offset": 0, + "palette": "keep", + "forceBmp": true + }, + { + "path": "font/i-without-dot-tiny.png", + "y_offset": 2, + "palette": "keep", + "forceBmp": true + }, + { + "path": "font/s-cedilla-tiny.png", + "y_offset": 1, + "palette": "keep", + "forceBmp": true } ] diff --git a/src/openrct2/drawing/Font.cpp b/src/openrct2/drawing/Font.cpp index e69801d036..5ca1c9aa6f 100644 --- a/src/openrct2/drawing/Font.cpp +++ b/src/openrct2/drawing/Font.cpp @@ -336,6 +336,20 @@ int32_t font_sprite_get_codepoint_offset(int32_t codepoint) case UNICODE_GUILDER_SIGN: return SPR_G2_GUILDER_SIGN - SPR_CHAR_START; + // Turkish + case UNICODE_G_BREVE_UC: + return SPR_G2_G_BREVE_UPPER - SPR_CHAR_START; + case UNICODE_I_WITH_DOT_UC: + return SPR_G2_I_WITH_DOT_UPPER - SPR_CHAR_START; + case UNICODE_S_CEDILLA_UC: + return SPR_G2_S_CEDILLA_UPPER - SPR_CHAR_START; + case UNICODE_G_BREVE: + return SPR_G2_G_BREVE_LOWER - SPR_CHAR_START; + case UNICODE_I_WITHOUT_DOT: + return SPR_G2_I_WITHOUT_DOT_LOWER - SPR_CHAR_START; + case UNICODE_S_CEDILLA: + return SPR_G2_S_CEDILLA_LOWER - SPR_CHAR_START; + // This is to catch capitalised versions of the guilder sign case UNICODE_F_WITH_HOOK_UC: return 'F' - 32; @@ -502,6 +516,13 @@ bool font_supports_string_sprite(const utf8* text) case UNICODE_GUILDER_SIGN: + case UNICODE_G_BREVE_UC: + case UNICODE_I_WITH_DOT_UC: + case UNICODE_S_CEDILLA_UC: + case UNICODE_G_BREVE: + case UNICODE_I_WITHOUT_DOT: + case UNICODE_S_CEDILLA: + supported = true; break; default: diff --git a/src/openrct2/localisation/FormatCodes.h b/src/openrct2/localisation/FormatCodes.h index d419a97a72..91208cd2a4 100644 --- a/src/openrct2/localisation/FormatCodes.h +++ b/src/openrct2/localisation/FormatCodes.h @@ -265,6 +265,16 @@ enum UnicodeCyrillic }; +enum UnicodeTurkish +{ + UNICODE_G_BREVE_UC = 286, + UNICODE_G_BREVE = 287, + UNICODE_I_WITH_DOT_UC = 304, + UNICODE_I_WITHOUT_DOT = 305, + UNICODE_S_CEDILLA_UC = 350, + UNICODE_S_CEDILLA = 351, +}; + enum UnicodeDingbats { UNICODE_DINGBATS_PLUS = 0x2795, diff --git a/src/openrct2/sprites.h b/src/openrct2/sprites.h index 2f51675d13..b894f7b911 100644 --- a/src/openrct2/sprites.h +++ b/src/openrct2/sprites.h @@ -898,7 +898,14 @@ enum SPR_G2_GUILDER_SIGN = SPR_G2_CHAR_BEGIN + 50, - SPR_G2_CHAR_END = SPR_G2_GUILDER_SIGN, + SPR_G2_G_BREVE_UPPER = SPR_G2_CHAR_BEGIN + 51, + SPR_G2_I_WITH_DOT_UPPER = SPR_G2_CHAR_BEGIN + 52, + SPR_G2_S_CEDILLA_UPPER = SPR_G2_CHAR_BEGIN + 53, + SPR_G2_G_BREVE_LOWER = SPR_G2_CHAR_BEGIN + 54, + SPR_G2_I_WITHOUT_DOT_LOWER = SPR_G2_CHAR_BEGIN + 55, + SPR_G2_S_CEDILLA_LOWER = SPR_G2_CHAR_BEGIN + 56, + + SPR_G2_CHAR_END = SPR_G2_S_CEDILLA_LOWER, SPR_G2_GLYPH_COUNT = (SPR_G2_CHAR_END - SPR_G2_CHAR_BEGIN) + 1, // 0x60000, chosen because it's a round hex number