Skip to content

Fix #11375: Russian is blocked on Android/iOS and unreadable on Desktop - #11427

Open
tCynik wants to merge 4 commits into
Card-Forge:masterfrom
tCynik:fix-11375-ru-cjk-font-autoselect
Open

Fix #11375: Russian is blocked on Android/iOS and unreadable on Desktop#11427
tCynik wants to merge 4 commits into
Card-Forge:masterfrom
tCynik:fix-11375-ru-cjk-font-autoselect

Conversation

@tCynik

@tCynik tCynik commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

#11375 merged Russian support, but it doesn't actually work:

  • Android/iOS: switching to Russian is blocked by a "please download CJK font" prompt with
    nothing to download - the required font (Roboto-Bold) isn't in the downloadable list, even
    though it already ships with the app.
  • Desktop: the switch succeeds, but nearly all UI text (menus/buttons/labels) renders as
    tofu - the desktop skin's base font has no Cyrillic glyphs, and Russian never wired up the
    font-fallback check that Chinese/Japanese/Korean already use for this exact situation.

Two independent commits, one per platform - see commit messages for full root-cause detail.

Fix

  • FSkinFont / SettingsPage (mobile): resolve the required font from the app's own bundled
    assets instead of only the downloaded-fonts cache, and auto-apply it instead of blocking.
  • LangRussian (desktop): add canDisplayCheck() so the existing font-fallback mechanism
    (already used by zh/ja/ko) fires for Russian too.

Test plan

  • Builds clean (Android + Desktop via Maven).
  • Android 17 (API 37), clean-room install: Russian applies immediately, no font prompt.
  • Windows desktop: confirmed broken before commit 2 (tofu outside card text), fixed after,
    including in a live match.
  • Not verified on iOS (no device/build environment available).

Note: this contribution was substantially coded with the assistance of Claude Code (Anthropic).

tcynik added 2 commits July 27, 2026 18:21
…rompt with no downloadable font

LangRussian.getFontFile() returns "Roboto-Bold" so the mobile UI (forge-gui-mobile,
shared by Android and iOS) routes ru-RU through the same "needs an external font"
pathway used for real CJK languages (zh/ja/ko). But Roboto-Bold isn't in
font-list.txt, so Settings -> Files -> "Download CJK Fonts" never offers it, and
Settings -> Language blocks the switch to Russian with "Please download CJK font"
with no way to actually get it - Card-Forge#11375 as merged is unusable for any user who
just installs the app and picks Russian from the language list.

Roboto-Bold.ttf is not actually missing: it already ships in COMMON_FONTS_DIR
(res/fonts, part of the downloaded assets package) and desktop's CardRenderer
already loads it straight from there for card-text rendering. FSkinFont's font
resolution just never looked there - only at FONTS_DIR, the device cache
directory populated by the CJK-font downloader.

- FSkinFont: add resolveCjkFontFile(), falling back to COMMON_FONTS_DIR when a
  required font isn't in the downloaded-fonts cache; getAllCJKFonts() lists
  bundled fonts too.
- SettingsPage: when a locale's required font resolves to a bundled file,
  auto-apply it instead of blocking the language switch. Languages whose font
  genuinely requires a download (zh/ja/ko) are unaffected - resolveCjkFontFile
  finds nothing bundled for those, so the existing download prompt still applies.
… (missing Cyrillic glyphs)

font1.ttf, the desktop skin's base UI font (forge-gui-desktop's SkinFont, applied via
FLabel/FButton/etc. to nearly all menu/button/label text), has no Cyrillic glyphs at all
(confirmed via Font.canDisplay()). GuiUtils.newFont() already has a fallback for exactly
this: it renders a per-Lang probe character with the candidate font, and swaps to the
system's default Swing font if it can't be displayed - LangChinese/LangJapanese/LangKorean
all override Lang.canDisplayCheck() with a representative character to make sure this
fires for their scripts. LangRussian never overrode it, so it inherited the base
implementation returning ' ', which font1.ttf trivially displays - the fallback check
always passed, and desktop kept using a font with no Cyrillic support for all its labels.

Card text was unaffected (CardPanel/CardRenderer load Roboto-Bold directly, which does
have Cyrillic), so the practical symptom was every other window: only the Latin bits of
the UI legible, everything actually in Russian appearing as boxes/tofu.

Fix: add canDisplayCheck() to LangRussian returning a Cyrillic character, same pattern as
the existing CJK Lang subclasses.
@Hanmac
Hanmac requested a review from tool4ever July 27, 2026 14:34
Comment thread forge-gui-mobile/src/forge/assets/FSkinFont.java Outdated
Hanmac
Hanmac previously approved these changes Jul 29, 2026
@Hanmac

Hanmac commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

@tool4ever what do you think?

Comment thread forge-core/src/main/java/forge/util/lang/LangRussian.java Outdated
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.

3 participants