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
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.0
Release Notes
linebender/resvg (usvg)
v0.45.0
Compare 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.0
toApache-2.0 OR MIT
.See resvg#838 for more information.
This release has an MSRV of 1.65 for
usvg
and 1.67.1 forresvg
and the C API.Added
background-color
attribute.image-rendering
attributes.!important
CSS 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][].
fontdb
andrustybuzz
have been updated.markers
but no actual markers.Fixed
use
referencessymbol
.v0.44.0
Compare Source
Added
Thanks to @LaurenzV.
resvg_get_object_bbox
cargo-c
metadata.Thanks to @lu-zero.
From
forfontdb
andusvg
font types.Thanks to @dhardy.
Changed
resvg_get_image_bbox
returns a layer and not object bounding box now.Use
resvg_get_object_bbox
to preserve the old behavior.Fixed
S
orT
segments afterA
.viewBox
flattening.v0.43.0
Compare Source
Added
Thanks to @notjosh.
Changed
zune-jpeg
instead ofjpeg-decoder
.Thanks to @mattfbacon.
Fixed
Thanks to @LaurenzV.
Thanks to @LaurenzV.
v0.42.0
Compare Source
Added
resvg
can render color fonts now, aka Emojis.In TrueType terms,
COLRv0
,COLRv1
(mostly),sbix
,CBDT
andSVG
tables are supported.Thanks to @LaurenzV.
usvg::FontResolver
now.Thanks to @LaurenzV.
usvg::Options::font_resolver
. Similar tousvg::Options::image_href_resolver
we already had.usvg::Options::fontdb
url("#id")
.image
element viewbox flattening.Instead of having
usvg::Image::view_box
that the caller should handle themselves,we instead replace it with
transform
and optionalclip-path
.This greatly simplifies
image
rendering.usvg::Image::size
Similar to
image
above, but affects the rootsvg
element instead.pattern
viewbox flattening.Similar to
image
above, but for patterns.Thanks to @LaurenzV.
Changed
usvg::fontdb::Database
should be set inusvg::Options
and not passedto the parser separately now.
usvg::Options
andusvg::ImageHrefResolver
have a lifetime now.usvg::Visibility
enum 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()
feImage
content as a link to an element.In SVG,
feImage
can 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
image
element. will be parsed as This simplifiesfeImage
rendering, since we don't have to handle both cases now.--list-fonts
resvg argument can be used without providing an SVG file now.Can simply call
resvg --list-fonts
now.--list-fonts
resvg argument includes generic font family names as well now.Thanks to @ahaoboy.
Removed
usvg::ViewBox
,usvg::AspectRatio
,usvg::Align
types. 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::root
instead.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_size
instead.Fixed
context-fill
handling.Thanks to @LaurenzV.
v0.41.0
Compare Source
Added
context-fill
andcontext-stroke
support.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
text
element uses multiple fonts and one of them produces ligatures.use
resolving.svg
resolving.Node::abs_transform
documentation. The current element's transform is included.v0.40.0
Compare Source
Added
usvg::Tree
isSend + Sync
compatible now.usvg::WriteOptions::preserve_text
to control howusvg
generates an SVG.usvg::Image::abs_bounding_box
Changed
usvg
are immutable now. Meaning thatusvg::Tree
cannot be modifiedafter creation anymore.
usvg
are private now. Use getters instead.usvg::Tree
parsing methods require thefontdb
argument now.defs
children like gradients, patterns, clipPaths, masks and filters are guaranteeto have a unique, non-empty ID.
defs
children like gradients, patterns, clipPaths, masks and filters are guaranteeto have
userSpaceOnUse
units now. NoobjectBoundingBox
units anymore.usvg::Mask
is allowed to have no children now.text
build feature isn't enabled.usvg::Tree::clip_paths
,usvg::Tree::masks
,usvg::Tree::filters
returnsa 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
,width
andheight
methods were replacedwith
usvg::filter::Primitive::rect
.usvg::Tree::paint_servers
intousvg::Tree::linear_gradients
,usvg::Tree::radial_gradients
,usvg::Tree::patterns
.All three returns pre-collected slices now.
usvg::Path
no longer can have an invalid bbox. Paths with an invalid bbox will berejected during parsing.
usvg
methods that return bounding boxes return non-optionalRect
now.No
NonZeroRect
as well.usvg::Text::flattened
returns&Group
and notOption<&Group>
now.usvg::ImageHrefDataResolverFn
andusvg::ImageHrefStringResolverFn
require
fontdb::Database
argument.Arc
and notRc<RefCell>
now.resvg::render_node
now includes filters bounding box. Meaning that a node with a blur filterno longer be clipped.
usvg::utils::view_box_to_transform
withusvg::ViewBox::to_transform
.usvg::XmlOptions
intousvg::WriteOptions
and 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 alwaysuserSpaceOnUse
now.usvg::Units
. No longer needed.Fixed
Previously, only paths and images were included.
image
aspect ratio when onlywidth
orheight
are present.Thanks to @LaurenzV.
v0.39.0
Compare Source
Added
font
shorthand parsing.Thanks to @LaurenzV.
usvg::Group::abs_bounding_box
usvg::Group::abs_stroke_bounding_box
usvg::Path::abs_bounding_box
usvg::Path::abs_stroke_bounding_box
usvg::Text::abs_bounding_box
usvg::Text::abs_stroke_bounding_box
Changed
usvg-*
crates merged into one. There is just theusvg
crate now, as before.Removed
usvg::Group::abs_bounding_box()
method. It's a field now.usvg::Group::abs_filters_bounding_box()
usvg::TreeParsing
,usvg::TreePostProc
andusvg::TreeWriting
traits.They are no longer needed.
Fixed
font-family
parsing.Thanks to @LaurenzV.
v0.38.0
Compare Source
Added
usvg::Node
stores its absolute transform now.Node::abs_transform()
executes in constant time now.usvg::Tree::calculate_bounding_boxes
to calculate all bounding boxes beforehand.usvg::Node::bounding_box
which returns a precalculated node's bounding box in object coordinates.usvg::Node::abs_bounding_box
which returns a precalculated node's bounding box in canvas coordinates.usvg::Node::stroke_bounding_box
which returns a precalculated node's bounding box,including stroke, in object coordinates.
usvg::Node::abs_stroke_bounding_box
which returns a precalculated node's bounding box,including stroke, in canvas coordinates.
resvg_get_node_stroke_bbox
usvg::Node::filters_bounding_box
usvg::Node::abs_filters_bounding_box
usvg::Tree::postprocess
Changed
resvg
rendersusvg::Tree
directly again.resvg::Tree
is gone.usvg
no longer usesrctree
for the nodes tree implementation.The tree is a regular
enum
now.*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
Node
itself is no longer anRc
.usvg::NodeKind
intousvg::Node
.Removed
resvg::Tree
. No longer needed.resvg
can renderusvg::Tree
directly once again.rctree::Node
methods. TheNode
API is completely different now.usvg::NodeExt
. No longer needed.usvg::Node::calculate_bbox
. Useusvg::Node::abs_bounding_box
instead.usvg::Tree::convert_text
. Useusvg::Tree::postprocess
instead.usvg::TreeTextToPath
trait. No longer needed.Fixed
mask-type
as a presentation attribute.feImage
rendering with a non-default position.Thanks to @LaurenzV.
v0.37.0
Compare Source
Added
usvg
can write text back to SVG now.Thanks to @LaurenzV.
--preserve-text
flag to theusvg
CLI tool.Thanks to @LaurenzV.
transform-origin
property.
Thanks to @LaurenzV.
paint-order
.Previously, only fill and stroke could have been swapped.
Thanks to @LaurenzV.
usvg_tree::Text::flattened
that will contain a flattened/outlined text.usvg_tree::Text::bounding_box
. Will be set only after text flattening.usvg_tree::NodeExt::abs_transform
by storing absolute transforms in the treeinstead of calculating them each time.
Changed
usvg_tree::Text::positions
was replaced withusvg_tree::Text::dx
andusvg_tree::Text::dy
.usvg_tree::CharacterPosition::x
andusvg_tree::CharacterPosition::y
are gone.They were redundant and you should use
usvg_tree::TextChunk::x
and
usvg_tree::TextChunk::y
instead.usvg_tree::LinearGradient::id
andusvg_tree::RadialGradient::id
are moved tousvg_tree::BaseGradient::id
.clipPath
sand
filter
s 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_text
no longer replacesoriginal text elements with paths, but instead puts them into
usvg_tree::Text::flattened
.Removed
transform
field fromusvg_tree::Path
,usvg_tree::Image
andusvg_tree::Text
.Only
usvg_tree::Group
can have it.It doesn't break anything, because those properties were never used before anyway.
Thanks to @LaurenzV.
usvg_tree::CharacterPosition
usvg_tree::Path::text_bbox
. Useusvg_tree::Text::bounding_box
instead.usvg_text_layout::TextToPath
trait forText
nodes.Only the whole tree can be converted at once.
Fixed
Was broken since v0.34
Image
node.Thanks to @LaurenzV.
text-decoration
resolving in some cases.Thanks to @LaurenzV.
Thanks to @LaurenzV.
v0.36.0
Compare Source
Added
stroke-linejoin=miter-clip
support. SVG2.Thanks to @torokati44.
fill="url('#gradient')"
. SVG2.Thanks to @romanzes.
rgb()
andrgba()
colors. SVG2.Thanks to @yisibl.
auto-start-reverse
variant support toorient
in markers. SVG2.Thanks to @EpicEricEE.
Changed
Fixed
Was rejecting some valid transforms before.
Thanks to @wez.
Thanks to @missdeer.
v0.35.0
Compare Source
Fixed
Removed
FillPaint
andStrokePaint
filter 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_paint
andusvg::filter::Filter::stroke_paint
.BackgroundImage
,BackgroundAlpha
,FillPaint
andStrokePaint
fromusvg::filter::Input
.usvg::Group::filter_fill_paint
andusvg::Group::filter_stroke_paint
.v0.34.1
Compare Source
Fixed
usvg
SVG output and C API.v0.34.0
Compare Source
Changed
usvg
usestiny-skia
geometry primitives now, including thePath
container.The main difference compared to the old
usvg
primitivesis that
tiny-skia
usesf32
instead off64
.So while in theory we could loose some precision, in practice,
f32
is used mainlyas a storage type and precise math operations are still done using
f64
.tiny-skia
primitives 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::PathData
intotiny-skia::Path
before rendering.Which was just a useless reallocation.
f32
instead off64
now.tiny-skia::Path
now, we allow quadratic curves as well.This includes
usvg
CLI output.This is because TrueType fonts contain only quadratic curves
and we were converting them to cubic before.
usvg::Path
no longer implementsDefault
. Useusvg::Path::new
instead.usvg::Rect
withtiny_skia::NonZeroRect
.usvg::PathBbox
withtiny_skia::Rect
.usvg::PathBbox
,tiny_skia::Rect
allows both width and height to be zero.This is not an error.
usvg::filter::Turbulence::base_frequency
was split intobase_frequency_x
andbase_frequency_y
.usvg::NodeExt::calculate_bbox
no longer includes stroke bbox.float
instead ofdouble
everywhere.svgfilters
crate was merged intoresvg
.rosvgtree
crate was merged intousvg-parser
.usvg::Group::filter_fill
moved tousvg::filter::Filter::fill_paint
.usvg::Group::filter_stroke
moved tousvg::filter::Filter::stroke_paint
.Remove
usvg::Point
. Usetiny_skia::Point
instead.usvg::FuzzyEq
. Useusvg::ApproxEqUlps
instead.usvg::FuzzyZero
. Useusvg::ApproxZeroUlps
instead.resvg_path_bbox
. Useresvg_rect
instead.svgfilters
crate.rosvgtree
crate.Fixed
transform
onclipPath
children inusvg
SVG output.Previously, each element resolved for a marker would preserve its ID.
Affects only
usvg
SVG output and doesn't affect rendering.v0.33.0
Compare 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.svg
content,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::Tree
had to be converted intoresvg::Tree
before rendering now.Changed
crates
directory now.resvg::Tree::render
instead ofresvg::render
.--export-area-drawing
option uses calculated bounds instead of trimmingexcessive alpha now. It's faster, but can lead to a slightly different output.
fit_to
argument fromresvg_render
.fit_to
argument fromresvg_render_node
.usvg::ScreenSize
moved toresvg
.usvg::ScreenRect
moved toresvg
.resvg::ScreenSize
intoresvg::IntSize
.resvg::ScreenRect
intoresvg::IntRect
.Removed
filter
build feature fromresvg
. Filters are always enabled now.resvg::FitTo
usvg::utils::view_box_to_transform_with_clip
usvg::Size::to_screen_size
. Useresvg::IntSize::from_usvg
instead.usvg::Rect::to_screen_size
. Useresvg::IntSize::from_usvg(rect.size())
instead.usvg::Rect::to_screen_rect
. Useresvg::IntRect::from_usvg
instead.resvg_fit_to
resvg_fit_to_type
Fixed
font-family
.v0.32.0
Compare Source
Added
mask-type
property support. SVG2usvg_tree::MaskType
usvg_tree::Mask::kind
Changed
BackgroundImage
andBackgroundAlpha
filter inputs will produce the same outputas
SourceGraphic
andSourceAlpha
respectively.Removed
enable-background
support. 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::EnableBackground
usvg_tree::Group::enable_background
usvg_tree::NodeExt::filter_background_start_node
Fixed
v0.31.0
Compare Source
Added
usvg::Tree::paint_servers
usvg::Tree::clip_paths
usvg::Tree::masks
usvg::Tree::filters
usvg::Node::subroots
--coordinates-precision
and--transforms-precision
writing options.Thanks to @flxzt.
Fixed
fill-opacity
andstroke-opacity
resolving.transform
when resolvingsymbol
.symbol
clipping when its viewbox is the same as the document one.were ignored during SVG writing.
v0.30.0
Compare Source
Added
usvg
CLI tool. Can be installed via cargo as before.Changed
usvg
internals into newusvg-tree
andusvg-parser
crates.usvg-tree
contains just the SVG tree and all the types.usvg-parser
parsers SVG intousvg-tree
.And
usvg
is just an umbrella crate now.usvg::Tree::from*
methods one should import theusvg::TreeParsing
trait now.usvg-text-layout
manually anymore. It is part ofusvg
now.rosvgtree
no longer reexportssvgtypes
.rosvgtree::Node::attribute
returns just a string now.rosvgtree::Node::find_attribute
returns just arosvgtree::Node
now.usvg::Stretch
intousvg::FontStretch
.usvg::Style
intousvg::FontStyle
.usvg::FitTo
moved toresvg::FitTo
.usvg::IsDefault
trait is private now.Removed
rosvgtree::FromValue
. Due to Rust's orphan rules this trait is pretty useless.Fixed
transform
attributes without skipping the whole element.svg
elements.Thanks to @LaurenzV.
text-decoration
on text with only one cluster.Thanks to @LaurenzV.
resvg
CLI allows files with XML DTD again.v0.29.0
Compare Source
Added
resvg
CLI 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
resvg
execution.usvg::Group::should_isolate
usvg::Tree::has_text_nodes
Changed
usvg
internals were moved into the newrosvgtree
crate.usvg::Group::should_isolate
to checkif a group affects rendering.
usvg-text-layout::TreeTextToPath::convert_text
no longer has thekeep_named_groups
argument.Removed
usvg::Options::keep_named_groups
. Dummy groups are no longer removed.resvg_options_set_keep_named_groups
ResvgOptions::setKeepNamedGroups
Fixed
font-family
handling.font-weight
resolving.v0.28.0
Compare Source
Added
usvg::Text
andusvg::NodeKind::Text
.Changed
usvg
isn't converting text to paths by default now. A caller must callusvg::Tree::convert_text
orusvg::Text::convert
fromusvg-text-layout
crate on demand.usvg
text layout implementation moved intousvg-text-layout
crate.width
,height
andviewBox
attributes 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.
usvg
is purely an SVG parser now. It doesn't convert text to pathsand doesn't write SVG anymore.
usvg::filter::ConvolveMatrixData
methods are fields now.Removed
usvg
CLI binary. No alternatives for now.usvg
build features.filter
. Filter elements are always parsed byusvg
now.text
. Text elements are always parsed byusvg
now.export
.usvg
cannot write an SVG anymore.usvg::Tree::to_string
.usvg
cannot write an SVG anymore.usvg::TransformFromBBox
trait. This is just a regularusvg::Transform
method now.usvg::OptionsRef
.usvg::Options
is enough from now.usvg::Options::fontdb
. Used only byusvg-text-layout
now.--dump-svg
fromresvg
.v0.27.0
Compare Source
Added
lengthAdjust
andtextLength
attributes support.image
size detection.width
andheight
attributes can be omitted or set toauto
onimage
now. SVG2Fixed
--query-all
flag inresvg
CLI.v0.26.1
Compare Source
Fixed
dominant-baseline
andalignment-baseline
to be set via CSS.v0.26.0
Compare Source
Added
dominant-baseline
andalignment-baseline
support.mix-blend-mode
andisolation
support. SVG2kerning="0"
andstyle="font-kerning:none"
. SVG2<percentage>
values foropacity
,fill-opacity
,stroke-opacity
,flood-opacity
andstop-opacity
attributes.You can write
opacity="50%"
now. SVG2Changed
feMorphology
radius value resolving.Fixed
svg
when only theviewBox
attribute 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 theignoreDeps
array 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