1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-03 23:30:04 -04:00

Support SVG Text Rendering in egui_extras (#5979)

**Added**
* Create `svg_text` feature flag to support text rendering & loading of
system fonts.

**Changed**
* Updates `resvg` to `0.45`.
* Adds `usvg::Options` field to the `SvgLoader` structure.
* Change function signatures to support passing `usvg::Options` to
downstream `load_svg_bytes_with_size`.

**Additional Info**
* I used this PR as a reference:
https://github.com/emilk/egui/pull/4659. @xNWP can you see if this
adequately resolves your concern from your original PR?
* Closes https://github.com/emilk/egui/issues/5977 (we may want to open
another issue for my other thoughts in this issue)
* Also, I would like to thank @xNWP and their original PR for being a
good reference for this one.
* [x] I have followed the instructions in the PR template
This commit is contained in:
Christopher Cerne
2025-04-14 05:13:17 -04:00
committed by GitHub
parent a8e0c56a8f
commit 0f1d6c2818
4 changed files with 205 additions and 84 deletions

View File

@@ -62,6 +62,9 @@ serde = ["egui/serde", "enum-map/serde", "dep:serde"]
## Support loading svg images.
svg = ["resvg"]
## Support rendering text in svg images.
svg_text = ["svg", "resvg/text", "resvg/system-fonts"]
## Enable better syntax highlighting using [`syntect`](https://docs.rs/syntect).
syntect = ["dep:syntect"]
@@ -101,7 +104,7 @@ syntect = { version = "5", optional = true, default-features = false, features =
] }
# svg feature
resvg = { version = "0.37", optional = true, default-features = false }
resvg = { version = "0.45", optional = true, default-features = false }
# http feature
ehttp = { version = "0.5", optional = true, default-features = false }