Skip to content

Commit 5581d1d

Browse files
Update support for latest resvg stylesheet (#69)
* Bump log from 0.4.21 to 0.4.27 Bumps [log](https://github.com/rust-lang/log) from 0.4.21 to 0.4.27. - [Release notes](https://github.com/rust-lang/log/releases) - [Changelog](https://github.com/rust-lang/log/blob/master/CHANGELOG.md) - [Commits](rust-lang/log@0.4.21...0.4.27) --- updated-dependencies: - dependency-name: log dependency-version: 0.4.27 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> * Update support for latest resvg stylesheet --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
1 parent b12ba43 commit 5581d1d

File tree

3 files changed

+82
-27
lines changed

3 files changed

+82
-27
lines changed

Cargo.lock

Lines changed: 77 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ crate-type = ["cdylib"]
1212
[dependencies]
1313
log = "0.4.27"
1414
pyo3 = "0.25.0"
15-
resvg = { version = "0.42.0", features = ["raster-images", "text"] }
15+
resvg = { version = "0.45.1", features = ["raster-images", "text"] }
1616
svgtypes = "0.15.3"
1717

1818

src/rust/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ fn resvg_magic(mut options: Opts, svg_string: String) -> Result<Vec<u8>, String>
212212
height= None,
213213
zoom = None,
214214
dpi = 0,
215+
style_sheet =String::new(),
215216
resources_dir = None,
216217
languages = vec![],
217218
font_size = 16,
@@ -241,7 +242,8 @@ fn svg_to_bytes(
241242
height: Option<u32>,
242243
zoom: Option<u32>,
243244
dpi: Option<u32>,
244-
245+
// Style Sheet
246+
style_sheet: Option<String>,
245247
// Resource Directory
246248
resources_dir: Option<String>,
247249
// Fonts
@@ -363,6 +365,7 @@ fn svg_to_bytes(
363365
shape_rendering: _shape_rendering,
364366
text_rendering: _text_rendering,
365367
image_rendering: _image_rendering,
368+
style_sheet: Some(style_sheet.unwrap_or_default()),
366369
default_size,
367370
image_href_resolver: resvg::usvg::ImageHrefResolver::default(),
368371
fontdb: Arc::new(fontdb),

0 commit comments

Comments
 (0)