CRAN release: 2022-02-03
CRAN release: 2021-02-20
svglite now uses systemfonts for text metric calculations and font family lookup.
svglite can now encode OpenType font features into the CSS if the used font contains registered features
svglite now directly encodes raster data into png instead of rendering it through cairo. If the provided raster is smaller than the final requested size it will be resized.
SVG’s can now get a top-level id so that style definitions doesn’t spill into the surrounding HTML (#91)
Dimensions are now encoded into the top-level
Clip defs are now only written if they don’t already exist (#110)
Clipping is now defined with outer groups instead of on each element (#109)
svglite now uses cpp11 instead of Rcpp (#100)
svgz output is now supported natively (#6)
Text adjustments are now encoded in css where possible (#107)
The use of textLength CSS property can now be turned off (#118)
web font imports can now be given when creating an svg (#108)
Add scaling argument to devices to control line-width and text scaling (#115)
svg files that are being written are now only valid at all times if
always_validis set to
svglite now guards against attempts at writing to the device before a new page has been requested (#126)
CRAN release: 2020-02-07
CRAN release: 2019-05-17
Improvements to reproducibility of generated SVGs: Negative zeros are now treated as positive, and the clip ID are now generated from truncated elements.
svglite now uses the
polygonSVG element. This ensures that polygons are properly closed (#82).
Text metrics are now correctly computed for Unicode characters in plotmath expressions (#81).
CRAN release: 2016-11-04
The device functions gain
Two new vignettes:
vignette("scaling"). The vignette on fonts explains in detail how to use the new fonts arguments and why. The vignette on scaling goes over scaling issues, e.g. when embedding svglite outputs in a web page.
stringSVG()device function for quick testing.
Clip paths now get a unique identifier to avoid collisions when multiple plots are included in a document (#67).
Raster graphics are now correctly cropped (#64) and handle transparency properly.
The dimensions of text fields are now hardcoded in the SVGs to prevent alignment issues.
CRAN release: 2016-02-09
Intermediate outputs are always valid SVG (#53).
Use raster test compatible with older versions of R.
Fix incorrect device size (#50).
CRAN release: 2015-12-09
svglite is fully featured svg graphics device that works on all platforms, forked from RSvgDevice. It supports all graphics device features:
Text is now coloured, and uses the same default fonts as R (Arial, Times New Roman, and Courier). Font metrics are computed using the gdtools package so that
Transparent colours are now generated with
rgba()rather than using
fill-opacitystyles (#16). NA fills and colours are translated to “none”.
par(bg)affects the background colour (#8).
Rasters are supported by embedding base64-encoded pngs in a data url (#2).
We also made a few other tweaks to the rendered SVG:
<svg>is set (not
height): I’m reasonably certain this makes it easier to use in more places (#12).
Default styling properties are specified in a global
<style>element: this reduces overall file size, and should make it easier to re-style the output for your own needs.
You can now only produce a single page per device - previously this worked but produced incorrect output (#5).
Output no longer contains dummy
And added some helper functions: