Gin
Loading...
Searching...
No Matches
gin_svg.h File Reference

Namespaces

namespace  SVG
 SVG parsing and rendering helpers built on NanoSVG.

Enumerations

enum class  SVG::Engine { SVG::nanosvg , SVG::juce }
 Rendering backend. More...

Functions

juce::Image SVG::renderToImage (const juce::String &svgText, int width, int height, Engine engine=Engine::juce)
 Renders svgText into a width x height ARGB image with a transparent background.
juce::Image SVG::renderToImage (const juce::String &svgText, int width, int height, juce::Colour backgroundColour, Engine engine=Engine::juce)
 As above, but fills the image with backgroundColour before drawing.
juce::Path SVG::renderToPath (const juce::String &svgText)
 Returns all visible shapes flattened into a single juce::Path in the SVG's own coordinate space.
juce::Path SVG::renderToPath (const juce::String &svgText, juce::Rectangle< float > targetBounds, juce::RectanglePlacement placement=juce::RectanglePlacement::centred)
 Returns the SVG as a juce::Path fitted into targetBounds.
void SVG::render (const juce::String &svgText, juce::Graphics &g, juce::Rectangle< float > targetBounds, Engine engine=Engine::juce)
 Draws svgText into targetBounds on the given Graphics context.