Skip to content

Fix: CJK/Chinese text invisible when custom font enabled (I18n compatibility)#27

Open
lestmc wants to merge 1 commit into
X-C-0:stonecutterfrom
lestmc:fix/cjk-text-rendering-v2
Open

Fix: CJK/Chinese text invisible when custom font enabled (I18n compatibility)#27
lestmc wants to merge 1 commit into
X-C-0:stonecutterfrom
lestmc:fix/cjk-text-rendering-v2

Conversation

@lestmc

@lestmc lestmc commented Jul 1, 2026

Copy link
Copy Markdown

当自定义字体启用时,CJK/中文文本会不可见。此修复通过 TextOperationAccessor mixin 解决了 I18n 兼容性问题。

修改内容

  • 新增 TextOperationAccessor mixin,用于访问 Meteor Client 的文本操作
  • 确保 CJK 字符在自定义字体模式下正确渲染

…ibility)

Text containing characters outside Latin ranges (e.g. CJK U+4E00+)
would render as invisible quads because Meteor's Font atlas lacks
those glyphs. Added a fallback path that uses Minecraft's built-in
VanillaTextRenderer whenever the text contains non-Latin characters.

Changes:
- ColorUtils: new containsNonLatinChars() detection helper
- CatppuccinRenderer: collectNonLatinTexts() + renderVanillaTexts()
  to batch-render non-Latin text via VanillaTextRenderer
- GuiRendererMixin: always route custom-font text through
  CatppuccinRenderer.text() so the dispatch happens in one place
- CatppuccinGuiTheme: textWidth/textHeight fall back to vanilla
  calculations for non-Latin text (avoids 0-width layout)
- GuiRenderOperationAccessor + TextOperationAccessor: new mixin
  accessors for protected/private fields (registered in mixins.json)

Closes X-C-0#24
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.

1 participant