chore(deps): update rust crate usvg to 0.45.0 #203
No reviewers
Labels
No labels
ci
crate/dtmm
crate/dtmt
crate/sdk
crate/serde_sjson
kind
bug
kind
documentation
kind
enhancement
kind
feature
kind
question
kind
upstream
part/bundle
part/filetype
stage
actionable
stage
design
stage
proposal
status/duplicate
status/good first issue
status/help wanted
status/invalid
status
need-replicate
status/wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
bitsquid_dt/dtmt!203
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "renovate/usvg-0.x"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This PR contains the following updates:
0.25.0->0.45.0Release Notes
linebender/resvg (usvg)
v0.45.0Compare Source
This is the first release under the stewardship of [Linebender][], who is now responsible for maintenance of this crate.
Many thanks to Yevhenii Reizner for the years of hard work that he has poured into this and other crates.
Please note that the license of this project changed from
MPL-2.0toApache-2.0 OR MIT.See resvg#838 for more information.
This release has an MSRV of 1.65 for
usvgand 1.67.1 forresvgand the C API.Added
background-colorattribute.image-renderingattributes.!importantCSS flag.resvg_options_set_stylesheet.Thanks to [@michabay05][].
hsl()andhsla().Changed
Apache-2.0 OR MIT.See resvg#838 for more information.
Thanks to [@Shnatsel][].
fontdbandrustybuzzhave been updated.markersbut no actual markers.Fixed
usereferencessymbol.v0.44.0Compare Source
Added
Thanks to @LaurenzV.
resvg_get_object_bboxcargo-cmetadata.Thanks to @lu-zero.
Fromforfontdbandusvgfont types.Thanks to @dhardy.
Changed
resvg_get_image_bboxreturns a layer and not object bounding box now.Use
resvg_get_object_bboxto preserve the old behavior.Fixed
SorTsegments afterA.viewBoxflattening.v0.43.0Compare Source
Added
Thanks to @notjosh.
Changed
zune-jpeginstead ofjpeg-decoder.Thanks to @mattfbacon.
Fixed
Thanks to @LaurenzV.
Thanks to @LaurenzV.
v0.42.0Compare Source
Added
resvgcan render color fonts now, aka Emojis.In TrueType terms,
COLRv0,COLRv1(mostly),sbix,CBDTandSVGtables are supported.Thanks to @LaurenzV.
usvg::FontResolvernow.Thanks to @LaurenzV.
usvg::Options::font_resolver. Similar tousvg::Options::image_href_resolverwe already had.usvg::Options::fontdburl("#id").imageelement viewbox flattening.Instead of having
usvg::Image::view_boxthat the caller should handle themselves,we instead replace it with
transformand optionalclip-path.This greatly simplifies
imagerendering.usvg::Image::sizeSimilar to
imageabove, but affects the rootsvgelement instead.patternviewbox flattening.Similar to
imageabove, but for patterns.Thanks to @LaurenzV.
Changed
usvg::fontdb::Databaseshould be set inusvg::Optionsand not passedto the parser separately now.
usvg::Optionsandusvg::ImageHrefResolverhave a lifetime now.usvg::Visibilityenum with justbool.usvg::Path::visibility()is replaced withusvg::Path::is_visible()usvg::Image::visibility()is replaced withusvg::Image::is_visible()usvg::TextSpan::visibility()is replaced withusvg::TextSpan::is_visible()feImagecontent as a link to an element.In SVG,
feImagecan contain a link to an element or a base64 image data, just likeimage.From now, the inlined base64 data will always be represented by a link to an actual
imageelement. will be parsed as This simplifiesfeImagerendering, since we don't have to handle both cases now.--list-fontsresvg argument can be used without providing an SVG file now.Can simply call
resvg --list-fontsnow.--list-fontsresvg argument includes generic font family names as well now.Thanks to @ahaoboy.
Removed
usvg::ViewBox,usvg::AspectRatio,usvg::Aligntypes. Nol longer used.usvg::filter::Image::aspect. No longer needed.usvg::filter::Image::rendering_mode. No longer needed.usvg::filter::Image::data. Useusvg::filter::Image::rootinstead.usvg::Tree::view_box. No longer needed.usvg::Image::view_box. No longer needed.usvg::Image::pattern. No longer needed.usvg::utils::align_pos. No longer needed.usvg::Visibility. No longer needed.resvg_get_image_viewbox. Useresvg_get_image_sizeinstead.Fixed
context-fillhandling.Thanks to @LaurenzV.
v0.41.0Compare Source
Added
context-fillandcontext-strokesupport.Thanks to @LaurenzV.
usvg::Text::layouted(), which returns a list of glyph IDs.It can be used to manually draw glyphs, unlike with
usvg::Text::flattened(), which returnsjust vector paths.
Thanks to @LaurenzV.
Fixed
textelement uses multiple fonts and one of them produces ligatures.useresolving.svgresolving.Node::abs_transformdocumentation. The current element's transform is included.v0.40.0Compare Source
Added
usvg::TreeisSend + Synccompatible now.usvg::WriteOptions::preserve_textto control howusvggenerates an SVG.usvg::Image::abs_bounding_boxChanged
usvgare immutable now. Meaning thatusvg::Treecannot be modifiedafter creation anymore.
usvgare private now. Use getters instead.usvg::Treeparsing methods require thefontdbargument now.defschildren like gradients, patterns, clipPaths, masks and filters are guaranteeto have a unique, non-empty ID.
defschildren like gradients, patterns, clipPaths, masks and filters are guaranteeto have
userSpaceOnUseunits now. NoobjectBoundingBoxunits anymore.usvg::Maskis allowed to have no children now.textbuild feature isn't enabled.usvg::Tree::clip_paths,usvg::Tree::masks,usvg::Tree::filtersreturnsa pre-collected slice of unique nodes now.
It's no longer a closure and you do not have to deduplicate nodes by yourself.
usvg::filter::Primitive::x,y,widthandheightmethods were replacedwith
usvg::filter::Primitive::rect.usvg::Tree::paint_serversintousvg::Tree::linear_gradients,usvg::Tree::radial_gradients,usvg::Tree::patterns.All three returns pre-collected slices now.
usvg::Pathno longer can have an invalid bbox. Paths with an invalid bbox will berejected during parsing.
usvgmethods that return bounding boxes return non-optionalRectnow.No
NonZeroRectas well.usvg::Text::flattenedreturns&Groupand notOption<&Group>now.usvg::ImageHrefDataResolverFnandusvg::ImageHrefStringResolverFnrequire
fontdb::Databaseargument.Arcand notRc<RefCell>now.resvg::render_nodenow includes filters bounding box. Meaning that a node with a blur filterno longer be clipped.
usvg::utils::view_box_to_transformwithusvg::ViewBox::to_transform.usvg::XmlOptionsintousvg::WriteOptionsand embedxmlwriter::Options.Removed
usvg::Tree::postprocess()andusvg::PostProcessingSteps. No longer needed.usvg::ClipPath::units(),usvg::Mask::units(),usvg::Mask::content_units(),usvg::Filter::units(),usvg::Filter::content_units(),usvg::LinearGradient::units(),usvg::RadialGradient::units(),usvg::Pattern::units(),usvg::Pattern::content_units()and
usvg::Paint::units(). They are alwaysuserSpaceOnUsenow.usvg::Units. No longer needed.Fixed
Previously, only paths and images were included.
imageaspect ratio when onlywidthorheightare present.Thanks to @LaurenzV.
v0.39.0Compare Source
Added
fontshorthand parsing.Thanks to @LaurenzV.
usvg::Group::abs_bounding_boxusvg::Group::abs_stroke_bounding_boxusvg::Path::abs_bounding_boxusvg::Path::abs_stroke_bounding_boxusvg::Text::abs_bounding_boxusvg::Text::abs_stroke_bounding_boxChanged
usvg-*crates merged into one. There is just theusvgcrate now, as before.Removed
usvg::Group::abs_bounding_box()method. It's a field now.usvg::Group::abs_filters_bounding_box()usvg::TreeParsing,usvg::TreePostProcandusvg::TreeWritingtraits.They are no longer needed.
Fixed
font-familyparsing.Thanks to @LaurenzV.
v0.38.0Compare Source
Added
usvg::Nodestores its absolute transform now.Node::abs_transform()executes in constant time now.usvg::Tree::calculate_bounding_boxesto calculate all bounding boxes beforehand.usvg::Node::bounding_boxwhich returns a precalculated node's bounding box in object coordinates.usvg::Node::abs_bounding_boxwhich returns a precalculated node's bounding box in canvas coordinates.usvg::Node::stroke_bounding_boxwhich returns a precalculated node's bounding box,including stroke, in object coordinates.
usvg::Node::abs_stroke_bounding_boxwhich returns a precalculated node's bounding box,including stroke, in canvas coordinates.
resvg_get_node_stroke_bboxusvg::Node::filters_bounding_boxusvg::Node::abs_filters_bounding_boxusvg::Tree::postprocessChanged
resvgrendersusvg::Treedirectly again.resvg::Treeis gone.usvgno longer usesrctreefor the nodes tree implementation.The tree is a regular
enumnow.*node.borrow().Rc<RefCell>access.itself is not mutable. Because
Rc<RefCell>provides a shared mutable access.Rc<RefCell<T>>instead ofRc<T>.This is required for proper mutability since
Nodeitself is no longer anRc.usvg::NodeKindintousvg::Node.Removed
resvg::Tree. No longer needed.resvgcan renderusvg::Treedirectly once again.rctree::Nodemethods. TheNodeAPI is completely different now.usvg::NodeExt. No longer needed.usvg::Node::calculate_bbox. Useusvg::Node::abs_bounding_boxinstead.usvg::Tree::convert_text. Useusvg::Tree::postprocessinstead.usvg::TreeTextToPathtrait. No longer needed.Fixed
mask-typeas a presentation attribute.feImagerendering with a non-default position.Thanks to @LaurenzV.
v0.37.0Compare Source
Added
usvgcan write text back to SVG now.Thanks to @LaurenzV.
--preserve-textflag to theusvgCLI tool.Thanks to @LaurenzV.
transform-originproperty.
Thanks to @LaurenzV.
paint-order.Previously, only fill and stroke could have been swapped.
Thanks to @LaurenzV.
usvg_tree::Text::flattenedthat will contain a flattened/outlined text.usvg_tree::Text::bounding_box. Will be set only after text flattening.usvg_tree::NodeExt::abs_transformby storing absolute transforms in the treeinstead of calculating them each time.
Changed
usvg_tree::Text::positionswas replaced withusvg_tree::Text::dxandusvg_tree::Text::dy.usvg_tree::CharacterPosition::xandusvg_tree::CharacterPosition::yare gone.They were redundant and you should use
usvg_tree::TextChunk::xand
usvg_tree::TextChunk::yinstead.usvg_tree::LinearGradient::idandusvg_tree::RadialGradient::idare moved tousvg_tree::BaseGradient::id.clipPathsand
filters could have generated IDs, but it wasn't very reliable and mostly unnecessary.Renderer doesn't rely on them and usvg writer would generate them anyway.
usvg_text_layout::Tree::convert_textno longer replacesoriginal text elements with paths, but instead puts them into
usvg_tree::Text::flattened.Removed
transformfield fromusvg_tree::Path,usvg_tree::Imageandusvg_tree::Text.Only
usvg_tree::Groupcan have it.It doesn't break anything, because those properties were never used before anyway.
Thanks to @LaurenzV.
usvg_tree::CharacterPositionusvg_tree::Path::text_bbox. Useusvg_tree::Text::bounding_boxinstead.usvg_text_layout::TextToPathtrait forTextnodes.Only the whole tree can be converted at once.
Fixed
Was broken since v0.34
Imagenode.Thanks to @LaurenzV.
text-decorationresolving in some cases.Thanks to @LaurenzV.
Thanks to @LaurenzV.
v0.36.0Compare Source
Added
stroke-linejoin=miter-clipsupport. SVG2.Thanks to @torokati44.
fill="url('#gradient')". SVG2.Thanks to @romanzes.
rgb()andrgba()colors. SVG2.Thanks to @yisibl.
auto-start-reversevariant support toorientin markers. SVG2.Thanks to @EpicEricEE.
Changed
Fixed
Was rejecting some valid transforms before.
Thanks to @wez.
Thanks to @missdeer.
v0.35.0Compare Source
Fixed
Removed
FillPaintandStrokePaintfilter inputs support.It's a mostly undocumented SVG feature that no one supports and no one uses.
And it was adding a significant complexity to the codebase.
usvg::filter::Filter::fill_paintandusvg::filter::Filter::stroke_paint.BackgroundImage,BackgroundAlpha,FillPaintandStrokePaintfromusvg::filter::Input.usvg::Group::filter_fill_paintandusvg::Group::filter_stroke_paint.v0.34.1Compare Source
Fixed
usvgSVG output and C API.v0.34.0Compare Source
Changed
usvgusestiny-skiageometry primitives now, including thePathcontainer.The main difference compared to the old
usvgprimitivesis that
tiny-skiausesf32instead off64.So while in theory we could loose some precision, in practice,
f32is used mainlyas a storage type and precise math operations are still done using
f64.tiny-skiaprimitives are move robust, strict and have a nicer API.More importantly, this change reduces the peak memory usages for SVGs with large paths
(in terms of the number of segments).
And removes the need to convert
usvg::PathDataintotiny-skia::Pathbefore rendering.Which was just a useless reallocation.
f32instead off64now.tiny-skia::Pathnow, we allow quadratic curves as well.This includes
usvgCLI output.This is because TrueType fonts contain only quadratic curves
and we were converting them to cubic before.
usvg::Pathno longer implementsDefault. Useusvg::Path::newinstead.usvg::Rectwithtiny_skia::NonZeroRect.usvg::PathBboxwithtiny_skia::Rect.usvg::PathBbox,tiny_skia::Rectallows both width and height to be zero.This is not an error.
usvg::filter::Turbulence::base_frequencywas split intobase_frequency_xandbase_frequency_y.usvg::NodeExt::calculate_bboxno longer includes stroke bbox.floatinstead ofdoubleeverywhere.svgfilterscrate was merged intoresvg.rosvgtreecrate was merged intousvg-parser.usvg::Group::filter_fillmoved tousvg::filter::Filter::fill_paint.usvg::Group::filter_strokemoved tousvg::filter::Filter::stroke_paint.Remove
usvg::Point. Usetiny_skia::Pointinstead.usvg::FuzzyEq. Useusvg::ApproxEqUlpsinstead.usvg::FuzzyZero. Useusvg::ApproxZeroUlpsinstead.resvg_path_bbox. Useresvg_rectinstead.svgfilterscrate.rosvgtreecrate.Fixed
transformonclipPathchildren inusvgSVG output.Previously, each element resolved for a marker would preserve its ID.
Affects only
usvgSVG output and doesn't affect rendering.v0.33.0Compare Source
Added
When rendering isolated groups,
aka layers, we have to know the layer bounding box beforehand, which is ridiculously hard in SVG.
Previously, resvg would simply use the canvas size for all the layers.
Meaning that to render a 10x10px layer on a 1000x1000px canvas, we would have to allocate and then blend
a 1000x1000px layer, which is just a waste of CPU cycles.
The new rendering algorithm is able to calculate layer bounding boxes, which dramatically improves
performance when rendering a lot of tiny layers on a large canvas.
Moreover, it makes performance more linear with a canvas size increase.
The paris-30k.svg
sample from google/forma is rendered 115 times faster on M1 Pro now.
From ~33760ms down to ~290ms. 5269x3593px canvas.
If we restrict the canvas to 1000x1000px, which would contain only the actual
paris-30k.svgcontent,then we're 13 times faster. From ~3252ms down to ~253ms.
resvg::Tree, aka a render tree, which is an even simpler version ofusvg::Tree.usvg::Treehad to be converted intoresvg::Treebefore rendering now.Changed
cratesdirectory now.resvg::Tree::renderinstead ofresvg::render.--export-area-drawingoption uses calculated bounds instead of trimmingexcessive alpha now. It's faster, but can lead to a slightly different output.
fit_toargument fromresvg_render.fit_toargument fromresvg_render_node.usvg::ScreenSizemoved toresvg.usvg::ScreenRectmoved toresvg.resvg::ScreenSizeintoresvg::IntSize.resvg::ScreenRectintoresvg::IntRect.Removed
filterbuild feature fromresvg. Filters are always enabled now.resvg::FitTousvg::utils::view_box_to_transform_with_clipusvg::Size::to_screen_size. Useresvg::IntSize::from_usvginstead.usvg::Rect::to_screen_size. Useresvg::IntSize::from_usvg(rect.size())instead.usvg::Rect::to_screen_rect. Useresvg::IntRect::from_usvginstead.resvg_fit_toresvg_fit_to_typeFixed
font-family.v0.32.0Compare Source
Added
mask-typeproperty support. SVG2usvg_tree::MaskTypeusvg_tree::Mask::kindChanged
BackgroundImageandBackgroundAlphafilter inputs will produce the same outputas
SourceGraphicandSourceAlpharespectively.Removed
enable-backgroundsupport. This feature was never supported by browsersand was deprecated in SVG 2. To my knowledge, only Batik has a good support of it.
Also, it's a performance nightmare, which caused multiple issues in resvg already.
usvg_tree::EnableBackgroundusvg_tree::Group::enable_backgroundusvg_tree::NodeExt::filter_background_start_nodeFixed
v0.31.0Compare Source
Added
usvg::Tree::paint_serversusvg::Tree::clip_pathsusvg::Tree::masksusvg::Tree::filtersusvg::Node::subroots--coordinates-precisionand--transforms-precisionwriting options.Thanks to @flxzt.
Fixed
fill-opacityandstroke-opacityresolving.transformwhen resolvingsymbol.symbolclipping when its viewbox is the same as the document one.were ignored during SVG writing.
v0.30.0Compare Source
Added
usvgCLI tool. Can be installed via cargo as before.Changed
usvginternals into newusvg-treeandusvg-parsercrates.usvg-treecontains just the SVG tree and all the types.usvg-parserparsers SVG intousvg-tree.And
usvgis just an umbrella crate now.usvg::Tree::from*methods one should import theusvg::TreeParsingtrait now.usvg-text-layoutmanually anymore. It is part ofusvgnow.rosvgtreeno longer reexportssvgtypes.rosvgtree::Node::attributereturns just a string now.rosvgtree::Node::find_attributereturns just arosvgtree::Nodenow.usvg::Stretchintousvg::FontStretch.usvg::Styleintousvg::FontStyle.usvg::FitTomoved toresvg::FitTo.usvg::IsDefaulttrait is private now.Removed
rosvgtree::FromValue. Due to Rust's orphan rules this trait is pretty useless.Fixed
transformattributes without skipping the whole element.svgelements.Thanks to @LaurenzV.
text-decorationon text with only one cluster.Thanks to @LaurenzV.
resvgCLI allows files with XML DTD again.v0.29.0Compare Source
Added
resvgCLI loads system fonts only when an input SVG has text nodes now.Fonts loading is an IO-heavy operation and by avoiding it we can speed up
resvgexecution.usvg::Group::should_isolateusvg::Tree::has_text_nodesChanged
usvginternals were moved into the newrosvgtreecrate.usvg::Group::should_isolateto checkif a group affects rendering.
usvg-text-layout::TreeTextToPath::convert_textno longer has thekeep_named_groupsargument.Removed
usvg::Options::keep_named_groups. Dummy groups are no longer removed.resvg_options_set_keep_named_groupsResvgOptions::setKeepNamedGroupsFixed
font-familyhandling.font-weightresolving.v0.28.0Compare Source
Added
usvg::Textandusvg::NodeKind::Text.Changed
usvgisn't converting text to paths by default now. A caller must callusvg::Tree::convert_textorusvg::Text::convertfromusvg-text-layoutcrate on demand.usvgtext layout implementation moved intousvg-text-layoutcrate.width,heightandviewBoxattributes have been set,text nodes are no longer taken into an account. This is because a text node has no bbox
before conversion into path(s), which we no longer doing during parsing.
usvgis purely an SVG parser now. It doesn't convert text to pathsand doesn't write SVG anymore.
usvg::filter::ConvolveMatrixDatamethods are fields now.Removed
usvgCLI binary. No alternatives for now.usvgbuild features.filter. Filter elements are always parsed byusvgnow.text. Text elements are always parsed byusvgnow.export.usvgcannot write an SVG anymore.usvg::Tree::to_string.usvgcannot write an SVG anymore.usvg::TransformFromBBoxtrait. This is just a regularusvg::Transformmethod now.usvg::OptionsRef.usvg::Optionsis enough from now.usvg::Options::fontdb. Used only byusvg-text-layoutnow.--dump-svgfromresvg.v0.27.0Compare Source
Added
lengthAdjustandtextLengthattributes support.imagesize detection.widthandheightattributes can be omitted or set toautoonimagenow. SVG2Fixed
--query-allflag inresvgCLI.v0.26.1Compare Source
Fixed
dominant-baselineandalignment-baselineto be set via CSS.v0.26.0Compare Source
Added
dominant-baselineandalignment-baselinesupport.mix-blend-modeandisolationsupport. SVG2kerning="0"andstyle="font-kerning:none". SVG2<percentage>values foropacity,fill-opacity,stroke-opacity,flood-opacityandstop-opacityattributes.You can write
opacity="50%"now. SVG2Changed
feMorphologyradius value resolving.Fixed
svgwhen only theviewBoxattribute is present.Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Renovate Bot.
Can only be updated if druid performs dependency updates. And that's only going to happen if I decide to fork it for myself.
But before I do that, I'd probably port the UI to a different, still active framework.
Renovate Ignore Notification
Because you closed this PR without merging, Renovate will ignore this update (
0.45.0). You will get a PR once a newer version is released. To ignore this dependency forever, add it to theignoreDepsarray of your Renovate config.If you accidentally closed this PR, or if you changed your mind: rename this PR to get a fresh replacement PR.
Pull request closed