mirror of
https://github.com/storytold/egui.git
synced 2026-11-21 01:52:58 +01:00
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
egui_system_font_provider
Load system fonts on demand for characters that the fonts installed in egui lack.
The default egui fonts cover Latin, Greek, and Cyrillic. When egui is asked to render e.g. Japanese, Arabic, or Devanagari, it draws ◻. This crate provides a [SystemFontProvider] that asks the operating system for a font that covers the character, using the same font fallback as native apps (CoreText, DirectWrite, fontconfig, or Android's fonts.xml, via fontique). The font file is memory-mapped and installed as a fallback font in egui.
eframe installs it on native by default (feature system_fonts). Other integrations can add it themselves:
egui_ctx.add_font_provider(std::sync::Arc::new(egui_system_font_provider::SystemFontProvider::new()));
System emoji fonts are skipped for now, since they contain bitmaps or color glyphs that epaint cannot render yet.