Commit 0973b3b0 authored by RazrFalcon's avatar RazrFalcon

usvg updated.

parent b35e1d51
......@@ -30,7 +30,7 @@ travis-ci = { repository = "RazrFalcon/resvg" }
[dependencies]
log = "0.4.5"
#usvg = "0.2"
usvg = { git = "https://github.com/RazrFalcon/usvg", rev = "043d974" }
usvg = { git = "https://github.com/RazrFalcon/usvg", rev = "405ad77" }
#usvg = { path = "../usvg" }
# cairo backend
cairo-rs = { version = "0.4.1", features = ["png"], optional = true }
......
......@@ -96,8 +96,9 @@ It also includes alternative libraries.
- `resvg` - rendering backends implementation
- [`usvg`](https://github.com/RazrFalcon/usvg) - an SVG simplification tool
- [`svgdom`](https://github.com/RazrFalcon/svgdom) - a DOM-like SVG tree
- [`roxmltree`](https://github.com/RazrFalcon/roxmltree) - a DOM-like XML tree
- [`xmlparser`](https://github.com/RazrFalcon/xmlparser) - an XML parser
- [`svgtypes`](https://github.com/RazrFalcon/svgtypes) - SVG types parser and writer
- [`xmlparser`](https://github.com/RazrFalcon/xmlparser) - an XML parser
- [`rctree`](https://github.com/RazrFalcon/rctree) - a DOM-like tree
- [`resvg-qt`](https://github.com/RazrFalcon/resvg-qt) - a minimal bindings for [Qt]
......
......@@ -87,7 +87,7 @@ pub fn apply(
// a-stroke-miterlimit-002.svg
cr.set_miter_limit(stroke.miterlimit);
// a-stroke-width-002.svg
cr.set_line_width(stroke.width);
cr.set_line_width(stroke.width.value());
}
None => {
// a-stroke-006.svg
......
......@@ -86,7 +86,7 @@ pub fn apply(
// a-stroke-miterlimit-002.svg
pen.set_miter_limit(stroke.miterlimit);
// a-stroke-width-002.svg
pen.set_width(stroke.width);
pen.set_width(stroke.width.value());
// a-stroke-dasharray-001.svg
// a-stroke-dasharray-002.svg
......
......@@ -24,6 +24,8 @@ pub fn load_sub_svg(
usvg: usvg::Options {
path: None,
dpi: opt.usvg.dpi,
font_family: opt.usvg.font_family.clone(),
font_size: opt.usvg.font_size,
keep_named_groups: false,
},
fit_to: FitTo::Original,
......
......@@ -144,7 +144,7 @@ pub fn path_bbox(
// TODO: find a better way
// It's an approximation, but it's better than nothing.
if let Some(ref stroke) = stroke {
let w = (stroke.width / 2.0) as f32;
let w = (stroke.width.value() / 2.0) as f32;
minx -= w;
miny -= w;
maxx += w;
......
e-svg-002.svg
e-svg-003.svg
a-display-002.svg
a-display-003.svg
a-display-004.svg
a-display-005.svg
a-display-006.svg
a-display-007.svg
e-svg-002.svg
e-svg-003.svg
a-display-002.svg
a-display-003.svg
a-display-004.svg
a-display-005.svg
a-display-006.svg
a-display-007.svg
......@@ -173,6 +173,8 @@ pub fn parse() -> Result<(Args, Options), String> {
usvg: usvg::Options {
path: Some(in_svg.into()),
dpi: dpi as f64,
font_family: "Times New Roman".to_string(),
font_size: 12.0,
keep_named_groups,
},
fit_to,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment