All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
This changelog also contains important changes in dependencies.
- Greatly improve
symbol
resolving speed inusvg
.
0.15.0 - 2021-06-13
- Allow reading SVG from stdin in
resvg
binary. --id-prefix
tousvg
.FitTo::Size
resvg
binary accepts--width
and--height
args together now. Previously, only--width
or--height
were allowed.usvg::Path::text_bbox
- The maximum number of SVG elements is limited by 1_000_000 now. Mainly to prevent a billion laugh style attacks.
- The maximum SVG elements nesting is limited by 1024 now.
usvg::Error::ElementsLimitReached
- Improve clipping and masking performance on large images.
- Remove layers caching. This was a pointless optimization.
- Split Preprocessing into Reading and Parsing in
resvg --perf
. usvg::XmlOptions
rewritten.usvg::Tree::to_string
requires a reference toXmlOptions
now.
usvg::Tree::from_file
. Usefrom_data
orfrom_str
instead.usvg::Error::InvalidFileSuffix
usvg::Error::FileOpenFailed
- (c-api)
RESVG_ERROR_INVALID_FILE_SUFFIX
- Ignore tiny blur values. It could lead to a transparent image.
use
style propagation when used withsymbol
.- Vertical text layout with relative offsets.
- Text bbox calculation.
usvg
uses font metrics instead of path bbox now.
0.14.1 - 2021-04-18
- Allow
href
without thexlink
namespace. This feature is part of SVG 2 (which we do not support), but there are more and more files like this in the wild.
- (usvg) Do not write
usvg:version
to the output SVG.
- (usvg)
overflow='inherit'
resolving. - (usvg) SVG Path length calculation that affects
startOffset
property intextPath
. - (usvg) Fix
feImage
resolving when the linked element hasopacity
,clip-path
,mask
and/orfilter
attributes. - (usvg) Fix chained
feImage
resolving. - CLI arguments processing.
0.14.0 - 2021-03-06
- Multiple critical bugs in
tiny-skia
.
0.13.1 - 2021-01-20
image
with float size scaling.- Critical bug in
tiny-skia
.
0.13.0 - 2020-12-21
--resources-dir
option to CLI tools.- (usvg)
Tree::from_xmltree
- Remove the
Image
struct.render()
andrender_node()
methods now accepttiny_skia::PixmapMut
. - Update
fontdb
. - Update
tiny-skia
. - (c-api)
resvg_size
usesdouble
instead ofuint32_t
now. - (qt-api)
defaultSize()
anddefaultSizeF()
methods now return SVG size and not SVG viewbox size. - (usvg)
Options::path
changed toOptions::resources_dir
and requires a directory now. - (c-api)
resvg_options_set_file_path
changed toresvg_options_set_resources_dir
and requires a directory now. - (qt-api)
ResvgOptions::setFilePath
changed toResvgOptions::setResourcesDir
and requires a directory now.
- Support multiple values inside a
text-decoration
attribute.
Image
. Usetiny_skia::PixmapMut
instead.- (c-api)
resvg_image
struct andresvg_image_*
methods.resvg
renders onto the provided buffer now. - (c-api)
resvg_color
, because unused.
0.12.0 - 2020-12-05
- resvg no longer requires a C++ compiler!
tiny-skia
was updated to a pure Rust version, which means thatresvg
no longer depends onclang
and should work on 32bit targets.rustybuzz
was updated to a pure Rust version.tools/explorer-thumbnailer
is back and written in Rust now. Thanks to gentoo90.
- (usvg) Do not panic when a font has a zero-sized underline thickness.
- (usvg) Multiple
textPath
processing fixes by chubei-oppen. - (qt-api)
boundsOnElement
andboundingBox
were returning transposed bounds.
0.11.0 - 2020-07-04
- All backends except Skia were removed. Skia is the only official one from now.
- New C API implementation.
- Support for user-defined fonts in usvg, resvg and C API.
--serif-family
,--sans-serif-family
,--cursive-family
,--fantasy-family
--monospace-family
,--use-font-file
,--use-fonts-dir
,--skip-system-fonts
and--list-fonts
options to all CLI tools.- New tests suite. Instead of testing against the previous build, now we're testing against
prerendered PNG images. Which is way faster.
And you can test resvg without the internet connection now.
And all you need is justcargo test
.
- Library uses an embedded Skia by default now.
- Switch
harfbuzz_rs
withrustybuzz
. - Rendering doesn't require
usvg::Options
now. - (usvg) The
fontdb
module moved into its own crate. - (usvg)
fontconfig
is no longer used for matching generic fonts on Linux. Mainly because it's very slow. - (usvg) When an
image
element contains a file path, the file will be loaded into memory now, instead of simply storing a file path. And will be dumped as base64 on SVG save. In case of an SVG image, it will be loaded as aTree
and saved as base64 encoded XML on save. - (usvg)
ImageData
replaced withImageKind
. - (usvg) Fonts database is empty by default now and should be filled manually.
- (c-api) Almost a complete rewrite.
- All backends except the Skia one.
Options
from all backends. We don't use it anymore.- (usvg)
ImageFormat
. - (c-api) Rendering on a backends canvas no longer supported. Was constantly misused.
0.10.0 - 2020-06-19
- The
resvg
crate has been split into four: resvg-cairo, resvg-qt, resvg-skia and resvg-raqote.
So from now, instead of enabling a required backend via cargo features, you should select a required backend-specific crate.
This allows us to have a better integration with a selected 2D library.
And we also have separated C API implementations now.
And each backend has its own vendored archive too. - (qt-backend) Use
QImage
instead of Rust libraries for raster images loading.
- The
resvg
crate. Use backend-specific crates. tools/rendersvg
. Each backend has its own CLI tool now.tools/usvg
.usvg
implements CLI by default now.- (c-api)
resvg_*_render_to_file
methods. - (qt-backend)
jpeg-decoder
andpng
dependencies.
0.9.1 - 2020-06-03
- Stack overflow when
enable-background
andfilter
are set on the same element. - Grayscale PNG loading.
- Allow building on BSD.
- (usvg) Font fallback when shaping produces a different amount of glyphs.
- (usvg) Ignore a space after the last character during
letter-spacing
processing. - (usvg)
marker-end
rendering when the last segment is a curve with the second control point that coincides with end point. - (usvg) Accept embedded
image
data without mime. - (usvg) Fonts search in a home directory on Linux.
- (usvg)
dy
calculation fortextPath
thanks to Stoeoef - (usvg)
textPath
resolving when a referenced path has a transform.
Thanks to Stoeoef. - (usvg) Load user fonts on macOS too.
- (xmlparser) Parsing comment before DTD.
0.9.0 - 2020-01-18
feConvolveMatrix
,feMorphology
,feDisplacementMap
,feTurbulence
,feDiffuseLighting
andfeSpecularLighting
support.BackgroundImage
,BackgroundAlpha
,FillPaint
andStrokePaint
support as a filter input.- Load grayscale raster images.
enable-background
support.- resvg/usvg can be built without text rendering support now.
OutputImage::make_vec
andOutputImage::make_rgba_vec
.feImage
with a reference to an internal element.
feComposite
k1-4 coefficients can have any number now. This matches browsers behaviour.- Use
flate2
instead oflibflate
for GZip decoding. - (usvg)
fill
andstroke
attributes will always be set forpath
now. - (usvg)
g
,path
andimage
can now be set insidedefs
. Required byfeImage
. - (c-api) Rename
resvg_*_render_to_image
intoresvg_*_render_to_file
.
- (usvg) Transform processing during text-to-path conversion.
feComposite
with fully transparent region was producing an invalid result.- Fallback to
matrix
infeColorMatrix
whentype
is not set or invalid. - ID preserving for
use
elements. feFlood
with subregion andprimitiveUnits=objectBoundingBox
.- (harfbuzz_rs) Memory leak.
0.8.0 - 2019-08-17
- A Skia backend thanks to JaFenix.
feComponentTransfer
support.feColorMatrix
support.- A better CSS support.
- An
*.otf
fonts support. - (usvg)
dx
,dy
are supported insidetextPath
now. - Use a box blur for
feGaussianBlur
withstdDeviation
>=2. This is 4-8 times faster than IIR blur. Thanks to Shnatsel.
- All backends are using Rust crates for raster images loading now.
- Use
pico-args
instead ofgumdrop
to reduced the build time oftools/rendersvg
andtools/usvg
. - (usvg) The
xmlwriter
is used for SVG generation now. Almost 2x faster than generating ansvgdom
. - (usvg) Optimize font database initialization. Almost 50% faster.
- Use a lower PNG compression ratio to speed up PNG generation. Depending on a backend and image can be 2-4x faster.
OutputImage::save
->OutputImage::save_png
.- (usvg)
Path::segments
->Path::data
. - Cairo backend compilation is 2x faster now due to overall changes.
- Performance improvements (Oxygen Icon theme SVG-to-PNG):
- cairo-backend: 22% faster
- qt-backend: 20% faster
- raqote-backend: 34% faster
- (qt-api) A default font resolving.
- (usvg)
baseline-shift
processing insidetextPath
. - (usvg) Remove all
tref
element children. - (usvg)
tref
withxml:space
resolving. - (usvg) Ignore nested
tref
. - (usvg) Ignore invalid
clipPath
children that were referenced viause
. - (usvg)
currentColor
will always fallback to black now. Previously,stroke
was set tonone
which is incorrect. - (usvg)
use
can reference an element inside a non-SVG element now. - (usvg) Collect all styles for generic fonts and not only Regular.
- (usvg) Parse only presentation attributes from the
style
element and attribute.
- (cairo-backend)
gdk-pixbuf
dependency. - (qt-backend) JPEG image format plugin dependency.
svgdom
dependency.
0.7.0 - 2019-06-19
- New text layout implementation:
textPath
support.writing-mode
support, aka vertical text.- Text BIDI reordering.
- Better text shaping.
word-spacing
is supported for all backends now.harfbuzz
dependency.- Subscript, superscript offsets are extracted from font and not hardcoded now.
shape-rendering
,text-rendering
andimage-rendering
support.- The
arithmetic
operator forfeComposite
. - (usvg)
--quiet
argument. - (c-api)
resvg_get_image_bbox
. - (qt-api)
ResvgRenderer::boundingBox
. - (resvg) A raqote backend thanks to jrmuizel. Still experimental.
- Text will be converted into paths on the
usvg
side now. - (resvg) Do not rescale images before rendering. This is faster and better.
- (usvg) An
image
element with a zero or negative size will be skipped now. Previously, a linked image size was used, which is incorrect. - Geometry primitives (
Rect
,Size
, etc) are immutable and always valid now. - (usvg) The default
color-interpolation-filters
attribute will not be exported now.
- (usvg) All text related structures and enums. Text will be converted into
Path
now. InitObject
andinit()
because they are no longer needed.- (c-api)
resvg_handle
,resvg_init
,resvg_destroy
. - (c-api)
resvg_cairo_get_node_bbox
andresvg_qt_get_node_bbox
. Use backend-independentresvg_get_node_bbox
instead. - (cairo-backend)
pango
dependency. - (resvg)
Backend::calc_node_bbox
. UseNode::calculate_bbox()
instead.
letter-spacing
on cursive scripts (like Arabic).- (rctree) Prevent stack overflow on a huge, deeply nested SVG.
- (c-api)
resvg_is_image_empty
was always returningfalse
. - (resvg) Panic when
filter
withobjectBoudningBox
was set on an empty group. - (usvg)
mask
withobjectBoundingBox
resolving. - (usvg)
pattern
'sviewBox
attribute resolving viahref
. - (roxmltree) Namespace resolving.
0.6.1 - 2019-03-16
- (usvg)
transform
multiplication. - (usvg)
use
insideclipPath
resolving.
0.6.0 - 2019-03-16
- Nested
baseline-shift
support. - (qt-api)
renderToImage
. - (usvg) A better algorithm for unused defs (
defs
element children, like gradients) removal. - (usvg)
Error::InvalidSize
. - (c-api)
RESVG_ERROR_INVALID_SIZE
.
- (usvg) A major rewrite.
baseline-shift
withsub
,super
and percent values calculation.- Marker resolving moved completely to
usvg
. - If an SVG doesn't have a valid size than an error will occur. Previously, an empty tree was produced.
- (qt-api)
render
methods areconst
now. - (usvg) Disable default attributes exporting.
- (usvg) Marker element and attributes. Markers will be resolved just like
use
now.
- (resvg) During the
tspan
rendering, thetext
bbox will be used instead of thetspan
bbox itself. This is the correct behaviour by the SVG spec. - (cairo-backend)
font-family
parsing. - (usvg)
filter:none
processing. - (usvg)
text
insidetext
processing. - (usvg) Endless loop during
use
resolving. - (usvg) Endless loop when SVG has indirect recursive
xlink:href
links. - (usvg) Endless loop when SVG has recursive
marker-*
links. - (usvg) Panic during
use
resolving. - (usvg) Panic during inherited attributes resolving.
- (usvg) Groups regrouping.
- (usvg)
dx
/dy
processing ontext
. - (usvg)
textAnchor
resolving. - (usvg) Ignore
fill-rule
ontext
. - (svgtypes) Style with comments parsing.
- (roxmltree) Namespaces resolving.
0.5.0 - 2019-01-04
marker
support.- Partial
baseline-shift
support. letter-spacing
support.- (qt-backend)
word-spacing
support. Does not work on the cairo backend. - tools/explorer-thumbnailer
- tools/kde-dolphin-thumbnailer
- Object bounding box calculation.
- Pattern scaling.
- Nested
objectBoundigBox
support. - (usvg)
color
onuse
resolving. - (usvg)
offset
attribute resolving inside thestop
element. - (usvg) Ungrouping of groups with non-inheritable attributes.
- (usvg)
rotate
attribute resolving. - (usvg) Paths without stroke and fill will no longer be removed. Required for a proper bbox resolving.
- (usvg) Coordinates resolving when units are
userSpaceOnUse
. - (usvg) Groups regrouping. Caused an incorrect rendering of
clipPath
that hadfilter
on a child. - (usvg) Style attributes resolving on the root
svg
element. - (usvg)
SmoothCurveTo
andSmoothQuadratic
conversion. - (usvg)
symbol
resolving. - (cairo-backend) Font ascent calculation.
- (qt-backend) Stroking of LineTo specified as CurveTo.
- (svgdom)
stroke-miterlimit
attribute parsing. - (svgdom)
length
andnumber
attribute types parsing. - (svgdom)
offset
attribute parsing. - (svgdom) IRI resolving order when SVG has duplicated ID's.
0.4.0 - 2018-12-13
- (resvg) Initial filters support.
- (resvg) Nested
clipPath
andmask
support. - (resvg) MSVC support.
- (rendersvg)
font-family
,font-size
andlanguages
to args. - (usvg)
systemLanguage
attribute support. - (usvg) Default font family and size is configurable now.
- (c-api)
RESVG_ERROR_PARSING_FAILED
. - (c-api)
font_family
,font_size
andlanguages
toresvg_options
. - (qt-api)
ResvgRenderer::setDevicePixelRatio
.
- (rendersvg) Use
gumdrop
instead ofgetopts
. - (c-api) Qt wrapper is header-only now.
- (cairo-backend) Text layout.
- (cairo-backend) Rendering of a zero length subpath with a square cap.
- (qt-backend) Transform retrieving via Qt bindings.
- (resvg) Recursive SVG images via
image
tag. - (resvg) Bbox calculation of the text with rotate.
- (resvg) Invisible elements processing.
- (qt-api) SVG from QByteArray loading when data is invalid.
- (usvg)
display
attribute processing. - (usvg) Recursive
mask
resolving. - (usvg)
inherit
attribute value resolving. - (svgdom) XML namespaces resolving.
- (rendersvg)
failure
dependency.
0.3.0 - 2018-05-23
- (c-api)
resvg_is_image_empty
. - (c-api)
resvg_error
enum. - (c-api) Qt wrapper.
- (resvg) Advanced text layout support (lists of x, y, dx, dy and rotate).
- (resvg) SVG support for
image
element. - (usvg)
symbol
element support. - (usvg) Nested
svg
elements support. - (usvg) Paint fallback resolving.
- (usvg) Bbox validation for shapes that use painting servers.
- (svgdom) Elements from ENTITY resolving.
- (c-api)
resvg_parse_tree_from_file
,resvg_parse_tree_from_data
resvg_cairo_render_to_image
andresvg_qt_render_to_image
will return an error code now. - (cairo-backend) Use
gdk-pixbuf
crate instead ofimage
. - (resvg)
Render::render_to_image
andRender::render_node_to_image
will returnOption
and notResult
now. - (resvg) New geometry primitives implementation.
- (resvg) Rename
render_*
modules tobackend_
. - (rendersvg) Use
getopts
instead ofclap
to reduce the executable size. - (svgtypes)
StreamExt::parse_iri
andStreamExt::parse_func_iri
will parse not only well-formed data now.
- (qt-backend) Gradient with
objectBoundingBox
rendering. - (qt-backend) Text bounding box detection during the rendering.
- (cairo-backend)
image
element clipping. - (cairo-backend) Layers management.
- (c-api)
resvg_get_node_transform
will return a correct transform now. - (resvg)
text-decoration
thickness. - (resvg)
pattern
scaling. - (resvg)
image
without size rendering. - (usvg) Panic during
visibility
resolving. - (usvg) Gradients with one stop resolving.
- (usvg)
use
attributes resolving. - (usvg)
clipPath
andmask
attributes resolving. - (usvg)
offset
attribute instop
element resolving. - (usvg) Incorrect
font-size
attribute resolving. - (usvg) Gradient stops resolving.
- (usvg)
switch
element resolving. - (svgdom) Mixed
xml:space
processing. - (svgtypes)
Paint::from_span
poor performance.
- (c-api)
resvg_error_msg_destroy
. - (resvg)
parse_rtree_*
methods. Useusvg::Tree::from_
instead. - (resvg)
Error
.
0.2.0 - 2018-04-24
- (svg) Partial
clipPath
support. - (svg) Partial
mask
support. - (svg) Partial
pattern
support. - (svg)
preserveAspectRatio
support. - (svg) Check that an external image is PNG or JPEG.
- (rendersvg) Added
--query-all
and--export-id
arguments to render SVG items by ID. - (rendersvg) Added
--perf
argument for a simple performance stats.
- (resvg) API is completely new.
font-size
attribute inheritance duringuse
resolving.