From eee824c0ac91bee672971e2cbffb5fcf1af7dbfa Mon Sep 17 00:00:00 2001 From: Lucas Meurer Date: Thu, 15 Oct 2026 17:24:04 +0200 Subject: [PATCH] Rename `egui_system_fonts` to `egui_system_font_provider` (#8724) The name egui_system_fonts is already taken on crates.io. The new name matches the crate's `SystemFontProvider` type. Co-authored-by: Claude Opus 5.5 (1M context) --- .github/workflows/labels.yml | 2 +- Cargo.lock | 4 +-- Cargo.toml | 4 +-- crates/eframe/Cargo.toml | 4 +-- crates/eframe/src/native/epi_integration.rs | 2 +- .../CHANGELOG.md | 4 +-- .../Cargo.toml | 6 ++-- crates/egui_system_font_provider/README.md | 16 +++++++++++ .../src/lib.rs | 4 +-- crates/egui_system_fonts/README.md | 16 ----------- crates/epaint/Cargo.toml | 2 +- scripts/generate_changelog.py | 2 +- scripts/publish_crates.sh | 28 +++++++++---------- 13 files changed, 47 insertions(+), 47 deletions(-) rename crates/{egui_system_fonts => egui_system_font_provider}/CHANGELOG.md (64%) rename crates/{egui_system_fonts => egui_system_font_provider}/Cargo.toml (92%) create mode 100644 crates/egui_system_font_provider/README.md rename crates/{egui_system_fonts => egui_system_font_provider}/src/lib.rs (99%) delete mode 100644 crates/egui_system_fonts/README.md diff --git a/.github/workflows/labels.yml b/.github/workflows/labels.yml index 14d2ad2c..c9e3e64c 100644 --- a/.github/workflows/labels.yml +++ b/.github/workflows/labels.yml @@ -30,4 +30,4 @@ jobs: with: mode: minimum count: 1 - labels: "CI, dependencies, docs and examples, ecolor, eframe, egui_extras, egui_glow, egui_inspection, egui_kittest, egui_system_fonts, egui-wgpu, egui-winit, egui, emath, epaint, epaint_default_fonts, exclude from changelog, typo" + labels: "CI, dependencies, docs and examples, ecolor, eframe, egui_extras, egui_glow, egui_inspection, egui_kittest, egui_system_font_provider, egui-wgpu, egui-winit, egui, emath, epaint, epaint_default_fonts, exclude from changelog, typo" diff --git a/Cargo.lock b/Cargo.lock index 9aacca3f..614fe1c6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1278,7 +1278,7 @@ dependencies = [ "egui-winit", "egui_glow", "egui_inspection", - "egui_system_fonts", + "egui_system_font_provider", "glow", "glutin", "glutin-winit", @@ -1491,7 +1491,7 @@ dependencies = [ ] [[package]] -name = "egui_system_fonts" +name = "egui_system_font_provider" version = "0.36.2" dependencies = [ "egui", diff --git a/Cargo.toml b/Cargo.toml index a1cd33ec..38ee8601 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ members = [ "crates/egui_glow", "crates/egui_inspection", "crates/egui_kittest", - "crates/egui_system_fonts", + "crates/egui_system_font_provider", "crates/egui-wgpu", "crates/egui-winit", "crates/egui", @@ -69,7 +69,7 @@ egui_demo_lib = { version = "0.36.2", path = "crates/egui_demo_lib", default-fea egui_glow = { version = "0.36.2", path = "crates/egui_glow", default-features = false } egui_inspection = { version = "0.36.2", path = "crates/egui_inspection", default-features = false } egui_kittest = { version = "0.36.2", path = "crates/egui_kittest", default-features = false } -egui_system_fonts = { version = "0.36.2", path = "crates/egui_system_fonts", default-features = false } +egui_system_font_provider = { version = "0.36.2", path = "crates/egui_system_font_provider", default-features = false } eframe = { version = "0.36.2", path = "crates/eframe", default-features = false } accesskit = "0.25.0" diff --git a/crates/eframe/Cargo.toml b/crates/eframe/Cargo.toml index b843839d..d3a86ce2 100644 --- a/crates/eframe/Cargo.toml +++ b/crates/eframe/Cargo.toml @@ -85,7 +85,7 @@ wayland = [ ## Load system fonts on demand for characters that the installed fonts lack (native only). ## ## Turn it off at runtime with [`NativeOptions::system_font_fallback`]. -system_fonts = ["dep:egui_system_fonts"] +system_fonts = ["dep:egui_system_font_provider"] ## Enable screen reader support (requires `ctx.options_mut(|o| o.screen_reader = true);`) on web. ## @@ -171,7 +171,7 @@ image = { workspace = true, features = ["png"] } # Needed for app icon winit = { workspace = true, default-features = false, features = ["rwh_06"] } # optional native: -egui_system_fonts = { workspace = true, optional = true } +egui_system_font_provider = { workspace = true, optional = true } egui-wgpu = { workspace = true, optional = true, features = [ "winit", "capture", diff --git a/crates/eframe/src/native/epi_integration.rs b/crates/eframe/src/native/epi_integration.rs index 8fe16cd0..951c3726 100644 --- a/crates/eframe/src/native/epi_integration.rs +++ b/crates/eframe/src/native/epi_integration.rs @@ -259,7 +259,7 @@ impl EpiIntegration { if native_options.system_font_fallback { egui_ctx.add_font_provider(cfg_select! { - feature = "system_fonts" => Arc::new(egui_system_fonts::SystemFontProvider::new()), + feature = "system_fonts" => Arc::new(egui_system_font_provider::SystemFontProvider::new()), _ => Arc::new(MissingSystemFontsWarning::default()), }); } diff --git a/crates/egui_system_fonts/CHANGELOG.md b/crates/egui_system_font_provider/CHANGELOG.md similarity index 64% rename from crates/egui_system_fonts/CHANGELOG.md rename to crates/egui_system_font_provider/CHANGELOG.md index 064e8034..f1492b94 100644 --- a/crates/egui_system_fonts/CHANGELOG.md +++ b/crates/egui_system_font_provider/CHANGELOG.md @@ -1,5 +1,5 @@ -# Changelog for egui_system_fonts -All notable changes to the `egui_system_fonts` crate will be noted in this file. +# Changelog for egui_system_font_provider +All notable changes to the `egui_system_font_provider` crate will be noted in this file. This file is updated upon each release. diff --git a/crates/egui_system_fonts/Cargo.toml b/crates/egui_system_font_provider/Cargo.toml similarity index 92% rename from crates/egui_system_fonts/Cargo.toml rename to crates/egui_system_font_provider/Cargo.toml index c1dc9b75..af37c92f 100644 --- a/crates/egui_system_fonts/Cargo.toml +++ b/crates/egui_system_font_provider/Cargo.toml @@ -1,14 +1,14 @@ [package] -name = "egui_system_fonts" +name = "egui_system_font_provider" version.workspace = true authors = ["Emil Ernerfeldt "] description = "Load system fonts on demand for characters the egui fonts lack" edition.workspace = true rust-version.workspace = true -homepage = "https://github.com/emilk/egui/tree/main/crates/egui_system_fonts" +homepage = "https://github.com/emilk/egui/tree/main/crates/egui_system_font_provider" license.workspace = true readme = "README.md" -repository = "https://github.com/emilk/egui/tree/main/crates/egui_system_fonts" +repository = "https://github.com/emilk/egui/tree/main/crates/egui_system_font_provider" categories = ["gui"] keywords = ["egui", "gui", "fonts", "text"] include = ["../../LICENSE-APACHE", "../../LICENSE-MIT", "**/*.rs", "Cargo.toml"] diff --git a/crates/egui_system_font_provider/README.md b/crates/egui_system_font_provider/README.md new file mode 100644 index 00000000..017d10fd --- /dev/null +++ b/crates/egui_system_font_provider/README.md @@ -0,0 +1,16 @@ +# egui_system_font_provider + +[![Latest version](https://img.shields.io/crates/v/egui_system_font_provider.svg)](https://crates.io/crates/egui_system_font_provider) +[![Documentation](https://docs.rs/egui_system_font_provider/badge.svg)](https://docs.rs/egui_system_font_provider) + +Load system fonts on demand for characters that the fonts installed in [egui](https://github.com/emilk/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`](https://crates.io/crates/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: + +```rust +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. diff --git a/crates/egui_system_fonts/src/lib.rs b/crates/egui_system_font_provider/src/lib.rs similarity index 99% rename from crates/egui_system_fonts/src/lib.rs rename to crates/egui_system_font_provider/src/lib.rs index 54325a4b..8f3ae417 100644 --- a/crates/egui_system_fonts/src/lib.rs +++ b/crates/egui_system_font_provider/src/lib.rs @@ -6,7 +6,7 @@ //! //! ```no_run //! # let egui_ctx = egui::Context::default(); -//! egui_ctx.add_font_provider(std::sync::Arc::new(egui_system_fonts::SystemFontProvider::new())); +//! egui_ctx.add_font_provider(std::sync::Arc::new(egui_system_font_provider::SystemFontProvider::new())); //! ``` use epaint::{ @@ -55,7 +55,7 @@ impl SystemFontProvider { pub fn new() -> Self { Self { fonts: Mutex::new(Promise::spawn_thread( - "egui_system_fonts", + "egui_system_font_provider", load_system_fonts, )), locale: sys_locale::get_locale().and_then(|locale| parse_locale(&locale)), diff --git a/crates/egui_system_fonts/README.md b/crates/egui_system_fonts/README.md deleted file mode 100644 index 00b34c58..00000000 --- a/crates/egui_system_fonts/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# egui_system_fonts - -[![Latest version](https://img.shields.io/crates/v/egui_system_fonts.svg)](https://crates.io/crates/egui_system_fonts) -[![Documentation](https://docs.rs/egui_system_fonts/badge.svg)](https://docs.rs/egui_system_fonts) - -Load system fonts on demand for characters that the fonts installed in [egui](https://github.com/emilk/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 `◻`. `egui_system_fonts` 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`](https://crates.io/crates/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: - -```rust -egui_ctx.add_font_provider(std::sync::Arc::new(egui_system_fonts::SystemFontProvider::new())); -``` - -System emoji fonts are skipped for now, since they contain bitmaps or color glyphs that epaint cannot render yet. diff --git a/crates/epaint/Cargo.toml b/crates/epaint/Cargo.toml index b480cc21..9b367e05 100644 --- a/crates/epaint/Cargo.toml +++ b/crates/epaint/Cargo.toml @@ -37,7 +37,7 @@ color-hex = ["ecolor/color-hex"] ## Support bitmap (`sbix`, `CBDT`) and `COLR` glyphs, i.e. color emoji fonts like Apple Color Emoji and Segoe UI Emoji. ## -## Adds a PNG decoder to the binary, so it is off by default. `eframe` enables it on native via `egui_system_fonts`. +## Adds a PNG decoder to the binary, so it is off by default. `eframe` enables it on native via `egui_system_font_provider`. color_fonts = ["vello_cpu/png", "vello_cpu/text"] ## If set, epaint will use `include_bytes!` to bundle some fonts. diff --git a/scripts/generate_changelog.py b/scripts/generate_changelog.py index fd1a037e..77a74174 100755 --- a/scripts/generate_changelog.py +++ b/scripts/generate_changelog.py @@ -257,7 +257,7 @@ def main() -> None: "egui_glow", "egui_inspection", "egui_kittest", - "egui_system_fonts", + "egui_system_font_provider", "egui-wgpu", "egui-winit", "egui", diff --git a/scripts/publish_crates.sh b/scripts/publish_crates.sh index 09b1c5fb..cc762746 100755 --- a/scripts/publish_crates.sh +++ b/scripts/publish_crates.sh @@ -1,16 +1,16 @@ #!/usr/bin/env bash -(cd crates/emath && cargo publish --quiet) && echo "✅ emath" -(cd crates/ecolor && cargo publish --quiet) && echo "✅ ecolor" -(cd crates/epaint_default_fonts && cargo publish --quiet) && echo "✅ epaint_default_fonts" -(cd crates/epaint && cargo publish --quiet) && echo "✅ epaint" -(cd crates/egui && cargo publish --quiet) && echo "✅ egui" -(cd crates/egui-winit && cargo publish --quiet) && echo "✅ egui-winit" -(cd crates/egui_glow && cargo publish --quiet) && echo "✅ egui_glow" -(cd crates/egui-wgpu && cargo publish --quiet) && echo "✅ egui-wgpu" -(cd crates/egui_system_fonts && cargo publish --quiet) && echo "✅ egui_system_fonts" -(cd crates/egui_inspection && cargo publish --quiet) && echo "✅ eframe" -(cd crates/eframe && cargo publish --quiet) && echo "✅ eframe" -(cd crates/egui_extras && cargo publish --quiet) && echo "✅ egui_extras" -(cd crates/egui_kittest && cargo publish --quiet) && echo "✅ egui_kittest" -(cd crates/egui_demo_lib && cargo publish --quiet) && echo "✅ egui_demo_lib" +(cd crates/emath && cargo publish --quiet) && echo "✅ emath" +(cd crates/ecolor && cargo publish --quiet) && echo "✅ ecolor" +(cd crates/epaint_default_fonts && cargo publish --quiet) && echo "✅ epaint_default_fonts" +(cd crates/epaint && cargo publish --quiet) && echo "✅ epaint" +(cd crates/egui && cargo publish --quiet) && echo "✅ egui" +(cd crates/egui-winit && cargo publish --quiet) && echo "✅ egui-winit" +(cd crates/egui_glow && cargo publish --quiet) && echo "✅ egui_glow" +(cd crates/egui-wgpu && cargo publish --quiet) && echo "✅ egui-wgpu" +(cd crates/egui_system_font_provider && cargo publish --quiet) && echo "✅ egui_system_font_provider" +(cd crates/egui_inspection && cargo publish --quiet) && echo "✅ eframe" +(cd crates/eframe && cargo publish --quiet) && echo "✅ eframe" +(cd crates/egui_extras && cargo publish --quiet) && echo "✅ egui_extras" +(cd crates/egui_kittest && cargo publish --quiet) && echo "✅ egui_kittest" +(cd crates/egui_demo_lib && cargo publish --quiet) && echo "✅ egui_demo_lib"