Skip to content

Fix: Correct Persian text shaping in CEGUI (#4302) #4338

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Client/mods/deathmatch/logic/lua/CLuaFunctionDefs.Util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ int CLuaFunctionDefs::GetKeyboardLayout(lua_State* luaVM)
case 0: // Left to right (English)
readingLayout = "ltr";
break;
case 1: // Right to left (Arabic, Hebrew)
case 1: // Right to left (Arabic, Hebrew, and Persian)
readingLayout = "rtl";
break;
case 2: // Vertical top to bottom with columns to the left and also left to right (Japanese)
Expand Down
2 changes: 1 addition & 1 deletion utils/localization/build_locale_nsi.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
"yo" : "Yoruba",
}

rtl_locales = [ "ar", "he" ]
rtl_locales = [ "ar", "he", "fa"]


def escape_nsis(msgstr: str) -> str:
Expand Down
134 changes: 132 additions & 2 deletions vendor/cegui-0.4.0-custom/include/CEGUIStringBidi.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ typedef struct{

/* Kept near the actual table, for verification. */
#define SHAPE_FIRST 0x621
#define SHAPE_LAST 0x64A
#define SHAPE_LAST 0x6CC
/* very bad Memory alignment for 32-bit machines
* could split it to 2 arrays or promote type to 2 bytes type
*/
Expand Down Expand Up @@ -208,7 +208,137 @@ const shape_node shapetypes[] = {
/* 647 */ {SD, 0xFEE9},
/* 648 */ {SR, 0xFEED},
/* 649 */ {SR, 0xFEEF}, /* SD */
/* 64A */ {SD, 0xFEF1}
/* 64A */ {SD, 0xFEF1},
/* 64B */ {SU, 0x0},
/* 64C */ {SU, 0x0},
/* 64D */ {SU, 0x0},
/* 64E */ {SU, 0x0},
/* 64F */ {SU, 0x0},
/* 650 */ {SU, 0x0},
/* 651 */ {SU, 0x0},
/* 652 */ {SU, 0x0},
/* 653 */ {SU, 0x0},
/* 654 */ {SU, 0x0},
/* 655 */ {SU, 0x0},
/* 656 */ {SU, 0x0},
/* 657 */ {SU, 0x0},
/* 658 */ {SU, 0x0},
/* 659 */ {SU, 0x0},
/* 65A */ {SU, 0x0},
/* 65B */ {SU, 0x0},
/* 65C */ {SU, 0x0},
/* 65D */ {SU, 0x0},
/* 65E */ {SU, 0x0},
/* 65F */ {SU, 0x0},
/* 660 */ {SU, 0x0},
/* 661 */ {SU, 0x0},
/* 662 */ {SU, 0x0},
/* 663 */ {SU, 0x0},
/* 664 */ {SU, 0x0},
/* 665 */ {SU, 0x0},
/* 666 */ {SU, 0x0},
/* 667 */ {SU, 0x0},
/* 668 */ {SU, 0x0},
/* 669 */ {SU, 0x0},
/* 66A */ {SU, 0x0},
/* 66B */ {SU, 0x0},
/* 66C */ {SU, 0x0},
/* 66D */ {SU, 0x0},
/* 66E */ {SU, 0x0},
/* 66F */ {SU, 0x0},
/* 670 */ {SU, 0x0},
/* 671 */ {SU, 0x0},
/* 672 */ {SU, 0x0},
/* 673 */ {SU, 0x0},
/* 674 */ {SU, 0x0},
/* 675 */ {SU, 0x0},
/* 676 */ {SU, 0x0},
/* 677 */ {SU, 0x0},
/* 678 */ {SU, 0x0},
/* 679 */ {SU, 0x0},
/* 67A */ {SU, 0x0},
/* 67B */ {SU, 0x0},
/* 67C */ {SU, 0x0},
/* 67D */ {SU, 0x0},
/* 67E */ {SD, 0xFB56},
/* 67F */ {SU, 0x0},
/* 680 */ {SU, 0x0},
/* 681 */ {SU, 0x0},
/* 682 */ {SU, 0x0},
/* 683 */ {SU, 0x0},
/* 684 */ {SU, 0x0},
/* 685 */ {SU, 0x0},
/* 686 */ {SD, 0xFB7A},
/* 687 */ {SU, 0x0},
/* 688 */ {SU, 0x0},
/* 689 */ {SU, 0x0},
/* 68A */ {SU, 0x0},
/* 68B */ {SU, 0x0},
/* 68C */ {SU, 0x0},
/* 68D */ {SU, 0x0},
/* 68E */ {SU, 0x0},
/* 68F */ {SU, 0x0},
/* 690 */ {SU, 0x0},
/* 691 */ {SU, 0x0},
/* 692 */ {SU, 0x0},
/* 693 */ {SU, 0x0},
/* 694 */ {SU, 0x0},
/* 695 */ {SU, 0x0},
/* 696 */ {SU, 0x0},
/* 697 */ {SU, 0x0},
/* 698 */ {SR, 0xFB8A},
/* 699 */ {SU, 0x0},
/* 69A */ {SU, 0x0},
/* 69B */ {SU, 0x0},
/* 69C */ {SU, 0x0},
/* 69D */ {SU, 0x0},
/* 69E */ {SU, 0x0},
/* 69F */ {SU, 0x0},
/* 6A0 */ {SU, 0x0},
/* 6A1 */ {SU, 0x0},
/* 6A2 */ {SU, 0x0},
/* 6A3 */ {SU, 0x0},
/* 6A4 */ {SU, 0x0},
/* 6A5 */ {SU, 0x0},
/* 6A6 */ {SU, 0x0},
/* 6A7 */ {SU, 0x0},
/* 6A8 */ {SU, 0x0},
/* 6A9 */ {SD, 0xFB8E},
/* 6AA */ {SU, 0x0},
/* 6AB */ {SU, 0x0},
/* 6AC */ {SU, 0x0},
/* 6AD */ {SU, 0x0},
/* 6AE */ {SU, 0x0},
/* 6AF */ {SD, 0xFB92},
/* 6B0 */ {SU, 0x0},
/* 6B1 */ {SU, 0x0},
/* 6B2 */ {SU, 0x0},
/* 6B3 */ {SU, 0x0},
/* 6B4 */ {SU, 0x0},
/* 6B5 */ {SU, 0x0},
/* 6B6 */ {SU, 0x0},
/* 6B7 */ {SU, 0x0},
/* 6B8 */ {SU, 0x0},
/* 6B9 */ {SU, 0x0},
/* 6BA */ {SU, 0x0},
/* 6BB */ {SU, 0x0},
/* 6BC */ {SU, 0x0},
/* 6BD */ {SU, 0x0},
/* 6BE */ {SU, 0x0},
/* 6BF */ {SU, 0x0},
/* 6C0 */ {SD, 0xFBA4},
/* 6C1 */ {SU, 0x0},
/* 6C2 */ {SU, 0x0},
/* 6C3 */ {SU, 0x0},
/* 6C4 */ {SU, 0x0},
/* 6C5 */ {SU, 0x0},
/* 6C6 */ {SU, 0x0},
/* 6C7 */ {SU, 0x0},
/* 6C8 */ {SU, 0x0},
/* 6C9 */ {SU, 0x0},
/* 6CA */ {SU, 0x0},
/* 6CB */ {SU, 0x0},
/* 6CC */ {SD, 0xFBFC}
};

/*
Expand Down