Files
egui/examples/svg_glyph
Emil ErnerfeldtandClaude Fable 5.1 24c6061a58 Allow multiple GlyphRasterizers, with priority over installed fonts (#8545)
`GlyphRasterizer` now has a `FontPriority`:

* `FontPriority::Highest`: asked about every cluster, before any font.
Use it to override how specific glyphs looks
* `FontPriority::Lowest` (default): a fallback, only asked about
clusters no installed font (or `FontProvider`) has. Same as before.

Several rasterizers can be installed; within a tier they are asked in
order, and the first `Some` wins.

```rust
ctx.add_glyph_rasterizer(
    egui::GlyphRasterizer::new(|request| (request.cluster == "…").then(|| my_ellipsis(request)))
        .with_priority(egui::FontPriority::Highest),
);
```

API changes (all unreleased): `Context::set_glyph_rasterizer(Option)` →
`add_glyph_rasterizer` / `set_glyph_rasterizers(Vec)`, same on
`epaint::Fonts`.

Follow-up to:
* https://github.com/emilk/egui/pull/8512

* [x] I have followed the instructions in the PR template

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-10 13:09:13 +02:00
..

Example of how to render text glyphs from SVG files with egui_extras::SvgGlyph.

cargo run -p svg_glyph