Embed SVG assets and rasterise with resvg
The packaged binary panicked on startup ("svg load: Unrecognized image file
format"): asset SVGs were referenced by their build-time CARGO_MANIFEST_DIR
path (absent on an installed system, so read_to_string returned empty bytes),
and gdk::Texture::from_bytes can no longer decode SVG since librsvg dropped its
gdk-pixbuf loader.
- include_str! the SVGs into the binary (no runtime asset files)
- rasterise via resvg/tiny-skia into a gdk::MemoryTexture (no system loader)
This commit is contained in:
parent
ec24ed6371
commit
b098178058
4 changed files with 317 additions and 28 deletions
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "breadbar"
|
||||
version = "0.1.2"
|
||||
version = "0.1.5"
|
||||
edition = "2021"
|
||||
description = "Minimal status bar and notification daemon for Hyprland on Wayland"
|
||||
license = "MIT"
|
||||
|
|
@ -20,6 +20,9 @@ zbus = { version = "5", default-features = false, features = ["tokio"] }
|
|||
tokio = { version = "1", features = ["rt-multi-thread", "macros", "time", "process", "signal", "sync"] }
|
||||
serde = { version = "1", features = ["derive"] }
|
||||
serde_json = "1"
|
||||
# Pure-Rust SVG rasteriser (default features off → no text/font deps; the icons
|
||||
# are vector-only). Needed because librsvg dropped its gdk-pixbuf SVG loader.
|
||||
resvg = { version = "0.44", default-features = false }
|
||||
|
||||
[profile.release]
|
||||
lto = "thin"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue