@@ -90,14 +90,24 @@ func FontSpecToName(fontSpec string) string {
9090 return "Microsoft YaHei"
9191}
9292
93- // containsSymbolChars returns true if text contains characters from the
94- // Geometric Shapes Unicode block (U+25A0–U+25FF) or Dingbats (U+2700–U+27BF)
95- // that are typically missing from CJK fonts like Microsoft YaHei.
96- // These characters need a symbol font (Segoe UI Symbol) for reliable rendering.
93+ // containsSymbolChars returns true if text contains UI-chrome symbol characters
94+ // that CJK fonts (like Microsoft YaHei) cover poorly and that we want to render
95+ // via Segoe UI Symbol for consistent metrics.
96+ //
97+ // Scope is deliberately narrow:
98+ // - Geometric Shapes (U+25A0–U+25FF): UI uses ▶ ▸ ● ◑ ■ etc. These are
99+ // monochrome shapes by nature, so forcing a symbol font is safe.
100+ // - Dingbats (U+2700–U+27BF) whitelist: only ✓ (U+2713) and ✗ (U+2717),
101+ // the menu check/cross marks. The rest of the Dingbats block contains
102+ // emoji base characters (✂ ✈ ✉ ✊✋✌ ✏ ✨ ❄ ❤ …) that should be left
103+ // to the normal emoji font-fallback chain so they can render in color
104+ // and participate in ZWJ sequences (e.g. ❤️🔥).
97105func containsSymbolChars (text string ) bool {
98106 for _ , r := range text {
99- if (r >= 0x25A0 && r <= 0x25FF ) || // Geometric Shapes (▸, ▶, ■, etc.)
100- (r >= 0x2700 && r <= 0x27BF ) { // Dingbats (✓ is U+2713, in this range)
107+ if r >= 0x25A0 && r <= 0x25FF {
108+ return true
109+ }
110+ if r == 0x2713 || r == 0x2717 {
101111 return true
102112 }
103113 }
0 commit comments