Fix emojis in Html by removing broken font loading optimization (#1044)
The font_member_is_needed_for_text() optimization pre-scanned text content to decide whether to skip loading CJK/emoji font members. This was broken in two ways: 1. The hardcoded Unicode ranges in is_emoji_char() were incomplete (e.g., missing U+2B50 ⭐), so emoji glyphs silently failed to render. 2. When members were skipped, font_ids.len() never matched expected_member_count, so is_font_family_complete() never returned true for i18n font families. This caused every draw call to hit the slow path — the opposite of the optimization's intent. Fix: load all font family members unconditionally. The one-time load cost is negligible, and the fast path (is_font_family_complete → early return) now works correctly on subsequent draws. Removed the now-unused helpers: font_member_is_needed_for_text(), is_cjk_fallback_font_path(), is_emoji_fallback_font_path(), resource_basename(), text_has_cjk(), is_cjk_char(), text_has_emoji(), is_emoji_char(), and FontFamily::ensure_fonts_loaded_for_text().
K
Kevin Boos committed
e66d1041cd2ca5495d47e43f38b16ca8ec1a2f59
Parent: 007bf00
Committed by GitHub <noreply@github.com>
on 4/15/2026, 8:59:49 AM
No diff available for this commit.