neoLegacy/Minecraft.Client/Common
Revela d7822ac81e Enable multi-language font rendering and Unicode text input
Goal:
Allow players to type and display text in any language supported by
Unicode, including Chinese, Japanese, Korean, Thai, Arabic, Korean, Hindi, and more. This
covers all text surfaces: chat editor, chat messages, signs (in-world
and editor), world name/seed, server address/port fields, and all
Iggy Flash UI text fields.

Multi-language support:
Two complementary rendering systems were added to handle Unicode text
across the entire client:

1. Iggy UI (Flash-based text fields): A new UIUnicodeBitmapFont class
   serves Java Minecraft's glyph page PNGs (glyph_00.png-glyph_FF.png)
   through Iggy's bitmap font provider API. Registered as the global
   fallback font with metrics matching the Mojangles bitmap font for
   correct baseline alignment. When the primary bitmap font lacks a
   glyph, it returns IGGY_GLYPH_INVALID and Iggy seamlessly falls back
   to the unicode bitmap font.

2. Legacy C++ Font renderer (chat editor, in-world signs): Revived the
   commented-out unicode glyph page system in Font.cpp. Characters not
   in the bitmap font texture are rendered from glyph page PNGs loaded
   on demand, with proper texture switching mid-string.

3. ChatScreen input: Removed the restrictive acceptableLetters filter
   so all printable Unicode characters are accepted in chat.

Languages now supported for text input and rendering:
- Japanese (Hiragana, Katakana, Kanji)
- Chinese (Simplified and Traditional)
- Korean (Hangul)
- Thai
- Arabic
- Hindi (Devanagari)
- Russian (Cyrillic) - already worked via bitmap font
- Greek - already worked via bitmap font
- Polish, Czech, Turkish (Extended Latin) - already worked via bitmap font
- Armenian, Georgian, and other scripts covered by glyph pages

Security fixes:
- Fixed memset under-initialization of Font::charWidths (zeroed 460
  bytes instead of 460*sizeof(int)=1840 bytes, leaving entries 115+
  uninitialized) - pre-existing bug
- Added bounds checks to all UIUnicodeBitmapFont callbacks to reject
  glyph IDs outside [0, 65535], preventing OOB array access
- Added bounds check in Font::width() section-sign fallback path to
  prevent OOB read on charWidths[] with high codepoints
- Blocked Unicode bidirectional override characters (U+202A-202E,
  U+2066-2069) in chat input to prevent message spoofing

Memory leak fix:
- Fixed SignTileEntity::load allocating wchar_t[256] with new[] on
  every sign load without freeing. Replaced with stack allocation.

Debug logging:
- Added [SIGN] prefixed logging for sign save/update operations
- Added [CHAT] prefixed logging for chat send/receive operations

Files changed:
- UIUnicodeBitmapFont.h/.cpp (new) - Iggy bitmap font for glyph pages
- UIBitmapFont.cpp - Return IGGY_GLYPH_INVALID for unknown chars
- UIFontData.h/.cpp - Added hasGlyph() method
- UIController.h/.cpp - Load and register unicode bitmap fallback font
- UITTFFont.h/.cpp - Added registerAsDefaultFonts parameter
- Font.h/.cpp - Revived unicode glyph page rendering system
- ChatScreen.cpp - Accept all Unicode input, block bidi overrides
- Gui.cpp - Chat display debug logging
- ClientConnection.cpp - Sign update debug logging
- SignTileEntity.cpp - Sign save logging, memory leak fix
2026-03-16 23:08:05 -05:00
..
Audio Fix quiet in-game audio after engine update #897 (#1171) 2026-03-12 01:43:12 -05:00
Colours Modernize project codebase (#906) 2026-03-08 18:08:36 -05:00
DLC Modernize project codebase (#906) 2026-03-08 18:08:36 -05:00
DummyTexturePack/res Initial commit 2026-03-01 12:16:08 +08:00
GameRules Fixed DLC map loading / saving, missing chunks (#1114) 2026-03-10 22:04:19 -05:00
Leaderboards Modernize project codebase (#906) 2026-03-08 18:08:36 -05:00
Media Merge upstream/main into main 2026-03-15 23:38:41 -05:00
Network Dedicated Server Software - Minecraft.Server.exe (#498) 2026-03-15 02:32:50 -05:00
res feat: TU19 (Dec 2014) Features & Content (#155) 2026-03-03 03:04:10 +08:00
Telemetry Modernize project codebase (#906) 2026-03-08 18:08:36 -05:00
Trial Initial commit 2026-03-01 12:16:08 +08:00
Tutorial Modernize project codebase (#906) 2026-03-08 18:08:36 -05:00
UI Enable multi-language font rendering and Unicode text input 2026-03-16 23:08:05 -05:00
XUI Fix Gui.cpp merge and enhance hardcore mode visuals 2026-03-13 11:11:21 -05:00
zlib Modernize project codebase (#906) 2026-03-08 18:08:36 -05:00
App_Defines.h detailed summary of every changed file: 2026-03-13 06:56:46 -05:00
App_enums.h Add F2 screenshot functionality and image writing support 2026-03-15 03:47:31 -05:00
App_structs.h Save FOV value to settings (#670) 2026-03-06 16:38:16 -06:00
BuildVer.h Always show version overlay, add more info 2026-03-09 03:25:05 -05:00
C4JMemoryPool.h Initial commit 2026-03-01 12:16:08 +08:00
C4JMemoryPoolAllocator.h Initial commit 2026-03-01 12:16:08 +08:00
CommonMedia.sln Initial commit 2026-03-01 12:16:08 +08:00
CommonMedia.vcxproj Initial commit 2026-03-01 12:16:08 +08:00
CommonMedia.vcxproj.filters Initial commit 2026-03-01 12:16:08 +08:00
Console_Awards_enum.h Initial commit 2026-03-01 12:16:08 +08:00
Console_Debug_enum.h feat: TU19 (Dec 2014) Features & Content (#155) 2026-03-03 03:04:10 +08:00
Console_Utils.cpp Dedicated Server Software - Minecraft.Server.exe (#498) 2026-03-15 02:32:50 -05:00
ConsoleGameMode.cpp Optimize Path for Tutorial.h in ConsoleGameMode.cpp 2026-03-01 15:05:24 -07:00
ConsoleGameMode.h Optimize TutorialMode.h Filepath in ConsoleGameMode.h 2026-03-01 15:06:42 -07:00
Consoles_App.cpp Merge upstream/main into main 2026-03-15 03:54:37 -05:00
Consoles_App.h detailed summary of every changed file: 2026-03-13 06:56:46 -05:00
Minecraft_Macros.h Initial commit 2026-03-01 12:16:08 +08:00
PostProcesser.h Fix split-screen UI wrong positioning on window resize (#989) 2026-03-08 22:16:58 -05:00
Potion_Macros.h feat: TU19 (Dec 2014) Features & Content (#155) 2026-03-03 03:04:10 +08:00
xuiscene_base.h Initial commit 2026-03-01 12:16:08 +08:00