Import std.image.svg
std.image.svg
SVG, over nanosvg: Svg.Parse reads an SVG's shapes, paths, strokes, fills, and gradients into an Svg, whose Width and Height are its size in pixels at 96 dots an inch, and Rasterize draws it into an Image, its edges antialiased. nanosvg leaves out SVG's text, images, filters, masks, and clipping, and style sheets but for style attributes.
std/image/svg.fb
Types
Svg
class
Public Class Svg
An SVG's shapes, which Rasterize draws into an Image.
-
The SVG in
text. Throws an IOError of INVALID_DATA when thetextisn't an SVG, or is one without a size, by its width and height or its viewBox. -
How wide it is, in pixels at 96 dots an inch.
-
How tall it is, in pixels at 96 dots an inch.
-
It drawn at
scale, in an image of its size times thescale, each side rounded up. Panics when thescaleisn't above 0, or the image would have more pixels than an Image holds. -
It drawn as large as it fits in an image of
widthbyheight, in the middle of it. Panics when the size is one an Image can't be.
Report an issue with this page or with FutureBlitz on GitHub.