How an iOS Update Broke Chinese Text in War Robots (And How We Fixed It)
In September 2024, War Robots support received a surge of complaints from Chinese iOS players: after updating to iOS 18, in-game text was displaying incorrectly for some users. The issue manifested differently across devices: some players noticed missing characters, while others reported wrong or unfamiliar glyph styles. To make matters worse, we were unable to reproduce the bug on our local test…
In September 2024, Chinese players of the game War Robots experienced display issues after updating to iOS 18. The problem varied across devices, with some users seeing missing characters and others encountering unfamiliar glyph styles. Senior Developer Sergey Madekin explained that the root cause lay in War Robots relying directly on system fonts, which caused inconsistent rendering when falling back to built-in system fonts on iOS 18.
To address the issue, Madekin proposed bundling a full Chinese font into the game build and configuring it as a fallback. However, this approach significantly increased the build size, from around 10 MB to an additional 37 MB. To optimize the font, he turned to pyftsubset, a command-line utility from Python's fontTools package that creates slimmed-down font files containing only specified glyph sets.
Madekin initially used a frequency list of common Chinese characters, but gaps persisted, particularly in localized in-game names. After compiling a list of every unique character found in the game's text resources, he was able to reduce the font size from 10 MB to around 900 KB by keeping only this set. The final build size increase was just 1.24 MB.
While the optimized font resolved most issues, a few edge cases remained, such as unlocalized strings with rare characters and missing characters in custom usernames. Madekin created a supplementary list to handle these cases, and whenever a new missing character was reported, it was simply appended to the list and the font regenerated.
To streamline the process for future releases, Madekin developed a custom Unity Editor tool that automates the entire font generation process. The tool connects to the test server hosting localization files, downloads the latest text resources, extracts unique characters, and excludes glyphs already present in the primary game font. It then verifies character availability in the source Chinese TTF file and outputs the optimized font into the build.
A technical challenge arose when handling surrogate pairs in C# strings, as rare Chinese characters are represented by two char units—a surrogate pair. Madekin implemented a GetTextScalars method to correctly identify and store each full Unicode scalar as an individual string inside a HashSet, preventing the loss of shared high surrogate units during deduplication.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.