feat: Add SkiaFontRegistrar to fix CJK/icon-font garbling on Android#8
Merged
Merged
Conversation
…on-font garbling on Android) Agent-Logs-Url: https://github.com/TheEightBot/KumikoUI/sessions/aae0dae4-a66d-4053-9c89-362b4641aeed Co-authored-by: michaelstonis <120685+michaelstonis@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix garbled Japanese text in DataGridColumn.Header on Android
feat: Add SkiaFontRegistrar to fix CJK/icon-font garbling on Android
May 5, 2026
…ellRenderer Update the property reference to SelectionTextColor to ensure the correct style is applied when a cell is selected.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On Android,
SKFontManager.Defaultdoes not expose CJK or icon-font typefaces.SkiaDrawingContextwas falling through toSKTypeface.FromFamilyName()which silently returned the default Latin typeface, rendering Japanese headers as garbled boxes (see screenshot above).Core fix —
KumikoUI.SkiaSharpNew
SkiaFontRegistrarstatic class — a thread-safe registry that bypasses the system font manager entirely for named families:RegisterTypeface(family, typeface)RegisterTypefaceFromStream(family, stream)Clear()TryGetTypeface/IsRegistered/ClearSkiaDrawingContextchanges:GetOrCreateTypeface()checksSkiaFontRegistrarfirst beforeSKTypeface.FromFamilyName()Dispose()skips registered typefaces (externally owned — must not be disposed per-frame)Sample app
NotoSansJP-Regular.ttfandMaterialIcons-Regular.ttfadded toResources/Raw/MauiProgram.csregisters both at startup via a safe blocking load (pre-message-loop)CustomFontsPage) demonstrates Japanese column headers and a Material Icons icon-font cell rendererUsage
Icon fonts work identically — set
GridFont.Familyto the registered name and use Unicode code-point strings as cell values.