diff --git a/HellionChat/CjkFallbackRange.cs b/HellionChat/CjkFallbackRange.cs new file mode 100644 index 0000000..55de13f --- /dev/null +++ b/HellionChat/CjkFallbackRange.cs @@ -0,0 +1,31 @@ +namespace HellionChat; + +// Reduced CJK fallback coverage for the v1.5.3 NotoSansCjk fallback merge (B1). +// Before B1 the fallback merged over the full `Ranges` array (Default + endonyms), +// duplicating the Latin/Default work already done by the global/Japanese fonts. +// This is the trimmed remainder the fallback is actually the sole source for: +// - Hangul Syllables (AC00-D7A3): no other merged font ships Korean glyphs. +// - The full CJK Unified Ideographs (Han) block: at UseHellionFont=true the global +// font is Inter-Light (no CJK), so the fallback is the SOLE Han source. The JpRange +// overlap is harmless (MergeMode: the Japanese font wins for shared kanji). +// Deliberately excluded: ONLY the ASCII/Latin Default block (0x20-0xFF), which the +// global font already owns -- that doubled Latin merge is the B1 waste being removed. +// Kept as plain start/end pairs so it is unit-testable without the unsafe ImGui +// glyph-range builder (mirrors FontSizeResolver's split-for-test rationale). +internal static class CjkFallbackRange +{ + // Hangul Syllables block + the FULL CJK Unified Ideographs (Han) block. The full + // Han window is REQUIRED, not optional: at UseHellionFont=true the global font is + // Inter-Light (no CJK), so this fallback is the SOLE source for Han + Hangul. The + // overlap with JpRange (kanji the Japanese font also ships) is harmless under ImGui + // MergeMode -- the earlier-merged Japanese font wins for shared codepoints, the + // fallback only fills holes (简 0x7B80, 中 0x4E2D, 国 0x56FD). The dedup win is + // NOT re-merging the ASCII/Latin Default block, which the global font already owns. + internal static readonly ushort[] Pairs = + [ + 0xAC00, + 0xD7A3, // Hangul Syllables + 0x4E00, + 0x9FFF, // CJK Unified Ideographs (full Han) -- sole source at UseHellionFont + ]; +}