Skip to content

Commit 463d090

Browse files
tzwerbotder
authored andcommitted
Fix Persian text shaping in CEGUI (PR #4338, Fixes #4302)
1 parent edfdecb commit 463d090

File tree

3 files changed

+134
-4
lines changed

3 files changed

+134
-4
lines changed

Client/mods/deathmatch/logic/lua/CLuaFunctionDefs.Util.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ int CLuaFunctionDefs::GetKeyboardLayout(lua_State* luaVM)
238238
case 0: // Left to right (English)
239239
readingLayout = "ltr";
240240
break;
241-
case 1: // Right to left (Arabic, Hebrew)
241+
case 1: // Right to left (Arabic, Hebrew, and Persian)
242242
readingLayout = "rtl";
243243
break;
244244
case 2: // Vertical top to bottom with columns to the left and also left to right (Japanese)

utils/localization/build_locale_nsi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@
9595
"yo" : "Yoruba",
9696
}
9797

98-
rtl_locales = [ "ar", "he" ]
98+
rtl_locales = [ "ar", "he", "fa"]
9999

100100

101101
def escape_nsis(msgstr: str) -> str:

vendor/cegui-0.4.0-custom/include/CEGUIStringBidi.h

Lines changed: 132 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ typedef struct{
161161

162162
/* Kept near the actual table, for verification. */
163163
#define SHAPE_FIRST 0x621
164-
#define SHAPE_LAST 0x64A
164+
#define SHAPE_LAST 0x6CC
165165
/* very bad Memory alignment for 32-bit machines
166166
* could split it to 2 arrays or promote type to 2 bytes type
167167
*/
@@ -208,7 +208,137 @@ const shape_node shapetypes[] = {
208208
/* 647 */ {SD, 0xFEE9},
209209
/* 648 */ {SR, 0xFEED},
210210
/* 649 */ {SR, 0xFEEF}, /* SD */
211-
/* 64A */ {SD, 0xFEF1}
211+
/* 64A */ {SD, 0xFEF1},
212+
/* 64B */ {SU, 0x0},
213+
/* 64C */ {SU, 0x0},
214+
/* 64D */ {SU, 0x0},
215+
/* 64E */ {SU, 0x0},
216+
/* 64F */ {SU, 0x0},
217+
/* 650 */ {SU, 0x0},
218+
/* 651 */ {SU, 0x0},
219+
/* 652 */ {SU, 0x0},
220+
/* 653 */ {SU, 0x0},
221+
/* 654 */ {SU, 0x0},
222+
/* 655 */ {SU, 0x0},
223+
/* 656 */ {SU, 0x0},
224+
/* 657 */ {SU, 0x0},
225+
/* 658 */ {SU, 0x0},
226+
/* 659 */ {SU, 0x0},
227+
/* 65A */ {SU, 0x0},
228+
/* 65B */ {SU, 0x0},
229+
/* 65C */ {SU, 0x0},
230+
/* 65D */ {SU, 0x0},
231+
/* 65E */ {SU, 0x0},
232+
/* 65F */ {SU, 0x0},
233+
/* 660 */ {SU, 0x0},
234+
/* 661 */ {SU, 0x0},
235+
/* 662 */ {SU, 0x0},
236+
/* 663 */ {SU, 0x0},
237+
/* 664 */ {SU, 0x0},
238+
/* 665 */ {SU, 0x0},
239+
/* 666 */ {SU, 0x0},
240+
/* 667 */ {SU, 0x0},
241+
/* 668 */ {SU, 0x0},
242+
/* 669 */ {SU, 0x0},
243+
/* 66A */ {SU, 0x0},
244+
/* 66B */ {SU, 0x0},
245+
/* 66C */ {SU, 0x0},
246+
/* 66D */ {SU, 0x0},
247+
/* 66E */ {SU, 0x0},
248+
/* 66F */ {SU, 0x0},
249+
/* 670 */ {SU, 0x0},
250+
/* 671 */ {SU, 0x0},
251+
/* 672 */ {SU, 0x0},
252+
/* 673 */ {SU, 0x0},
253+
/* 674 */ {SU, 0x0},
254+
/* 675 */ {SU, 0x0},
255+
/* 676 */ {SU, 0x0},
256+
/* 677 */ {SU, 0x0},
257+
/* 678 */ {SU, 0x0},
258+
/* 679 */ {SU, 0x0},
259+
/* 67A */ {SU, 0x0},
260+
/* 67B */ {SU, 0x0},
261+
/* 67C */ {SU, 0x0},
262+
/* 67D */ {SU, 0x0},
263+
/* 67E */ {SD, 0xFB56},
264+
/* 67F */ {SU, 0x0},
265+
/* 680 */ {SU, 0x0},
266+
/* 681 */ {SU, 0x0},
267+
/* 682 */ {SU, 0x0},
268+
/* 683 */ {SU, 0x0},
269+
/* 684 */ {SU, 0x0},
270+
/* 685 */ {SU, 0x0},
271+
/* 686 */ {SD, 0xFB7A},
272+
/* 687 */ {SU, 0x0},
273+
/* 688 */ {SU, 0x0},
274+
/* 689 */ {SU, 0x0},
275+
/* 68A */ {SU, 0x0},
276+
/* 68B */ {SU, 0x0},
277+
/* 68C */ {SU, 0x0},
278+
/* 68D */ {SU, 0x0},
279+
/* 68E */ {SU, 0x0},
280+
/* 68F */ {SU, 0x0},
281+
/* 690 */ {SU, 0x0},
282+
/* 691 */ {SU, 0x0},
283+
/* 692 */ {SU, 0x0},
284+
/* 693 */ {SU, 0x0},
285+
/* 694 */ {SU, 0x0},
286+
/* 695 */ {SU, 0x0},
287+
/* 696 */ {SU, 0x0},
288+
/* 697 */ {SU, 0x0},
289+
/* 698 */ {SR, 0xFB8A},
290+
/* 699 */ {SU, 0x0},
291+
/* 69A */ {SU, 0x0},
292+
/* 69B */ {SU, 0x0},
293+
/* 69C */ {SU, 0x0},
294+
/* 69D */ {SU, 0x0},
295+
/* 69E */ {SU, 0x0},
296+
/* 69F */ {SU, 0x0},
297+
/* 6A0 */ {SU, 0x0},
298+
/* 6A1 */ {SU, 0x0},
299+
/* 6A2 */ {SU, 0x0},
300+
/* 6A3 */ {SU, 0x0},
301+
/* 6A4 */ {SU, 0x0},
302+
/* 6A5 */ {SU, 0x0},
303+
/* 6A6 */ {SU, 0x0},
304+
/* 6A7 */ {SU, 0x0},
305+
/* 6A8 */ {SU, 0x0},
306+
/* 6A9 */ {SD, 0xFB8E},
307+
/* 6AA */ {SU, 0x0},
308+
/* 6AB */ {SU, 0x0},
309+
/* 6AC */ {SU, 0x0},
310+
/* 6AD */ {SU, 0x0},
311+
/* 6AE */ {SU, 0x0},
312+
/* 6AF */ {SD, 0xFB92},
313+
/* 6B0 */ {SU, 0x0},
314+
/* 6B1 */ {SU, 0x0},
315+
/* 6B2 */ {SU, 0x0},
316+
/* 6B3 */ {SU, 0x0},
317+
/* 6B4 */ {SU, 0x0},
318+
/* 6B5 */ {SU, 0x0},
319+
/* 6B6 */ {SU, 0x0},
320+
/* 6B7 */ {SU, 0x0},
321+
/* 6B8 */ {SU, 0x0},
322+
/* 6B9 */ {SU, 0x0},
323+
/* 6BA */ {SU, 0x0},
324+
/* 6BB */ {SU, 0x0},
325+
/* 6BC */ {SU, 0x0},
326+
/* 6BD */ {SU, 0x0},
327+
/* 6BE */ {SU, 0x0},
328+
/* 6BF */ {SU, 0x0},
329+
/* 6C0 */ {SD, 0xFBA4},
330+
/* 6C1 */ {SU, 0x0},
331+
/* 6C2 */ {SU, 0x0},
332+
/* 6C3 */ {SU, 0x0},
333+
/* 6C4 */ {SU, 0x0},
334+
/* 6C5 */ {SU, 0x0},
335+
/* 6C6 */ {SU, 0x0},
336+
/* 6C7 */ {SU, 0x0},
337+
/* 6C8 */ {SU, 0x0},
338+
/* 6C9 */ {SU, 0x0},
339+
/* 6CA */ {SU, 0x0},
340+
/* 6CB */ {SU, 0x0},
341+
/* 6CC */ {SD, 0xFBFC}
212342
};
213343

214344
/*

0 commit comments

Comments
 (0)