Skip to content

OpenJO: fix Traditional Chinese rendering and runtime language switching - #1346

Open
hsz0566 wants to merge 1 commit into
JACoders:masterfrom
hsz0566:fix/openjo-traditional-chinese
Open

OpenJO: fix Traditional Chinese rendering and runtime language switching#1346
hsz0566 wants to merge 1 commit into
JACoders:masterfrom
hsz0566:fix/openjo-traditional-chinese

Conversation

@hsz0566

@hsz0566 hsz0566 commented Jul 26, 2026

Copy link
Copy Markdown

Fixes #1196

OpenJO submission draft

Suggested recipient: OpenJK maintainers / JACoders
Suggested subject: [PATCH] OpenJO: use sp_language for JK2 Asian character decoding

Hello OpenJK maintainers,

I would like to submit a fix for the OpenJO Traditional Chinese rendering issue
reported in:

#1196

OpenJO correctly uses the numeric sp_language cvar to select Jedi Outcast
STRIP entries. For example, sp_language 5 selects TEXT_LANGUAGE6.
The renderer also has a JK2-specific language enum mapping, but the JK2 branch
of AnyLanguage_ReadCharFromString() still calls the JKA
Language_IsKorean/Taiwanese/Japanese() helpers from
stringed_ingame.h. Those helpers inspect se_language, which normally
remains english in OpenJO.

As a result, valid Big5 text is loaded from the STRIP files but each two-byte
Chinese character is interpreted as two Western characters. This produces the
garbled menu and subtitle output shown in issue #1196.

The attached patch:

  1. Makes the JK2 character decoder use GetLanguageEnum(), which is backed by
    sp_language.
  2. Makes the JK2 enum mapping return Western for unsupported or unset values,
    avoiding stale Asian state after a language change.
  3. Makes the JK2 UI call JK2SP_CheckForLanguageUpdates() after an in-game
    sp_language change, keeping STRIP reloads synchronized with renderer
    decoding.

Validation performed:

  • Reproduced the issue with the official OpenJO Windows x86_64 build from
    OpenJK commit 1a6a6434.
  • Confirmed sp_language 5 selected TEXT_LANGUAGE6.
  • Confirmed all four Taiwanese font pages,
    fonts/tai_16_1024_0 through _3, loaded with valid shader handles.
  • Validated 2,238 supplied Traditional Chinese STRIP entries as Big5 with zero
    invalid entries.
  • Built and linked the patched OpenJO renderer successfully.
  • Built the equivalent revised JKXR Android application successfully.
  • The first Quest 3 test confirmed correct Traditional Chinese rendering and
    exposed the separate live-switching issue addressed by item 3 above.
  • git diff --check and forward/reverse git apply --check pass.
  • The changes are contained inside the JK2-specific path and do not alter the
    Jedi Academy language path.

One limitation: final visual testing of the locally rebuilt Windows DLL was
blocked by this machine's Windows Application Control policy
(0xc0e90002) because the generated DLL is unsigned. No security setting was
disabled. The unpatched official build and the diagnostic build were both
tested against the same game data. The revised live-switch behavior still
needs a final runtime regression test.

The source patch is attached as:

0001-openjo-use-sp-language-for-jk2-asian-fonts.patch

Thank you for reviewing this fix.

Best regards,
Song / hsz0566

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Traditional Chinese language support issue of OpenJO (Jedi Outcast)

1 participant