svg icon indicating copy to clipboard operation
svg copied to clipboard

without openfl

Open cancerberoSgx opened this issue 4 years ago • 2 comments

Is it possible to use it without openfl since it's huge dependency for those using it in command line applications ? Can't it render to a RGBA 8-bit depth or similar image bitmap (in a type like Bytes) for example ? User is responsible to convert it to any image format he needs. This way the library get's agnostic from output format too which is more flexible, even for openfl users. Thanks

cancerberoSgx avatar Jul 06 '19 10:07 cancerberoSgx

I'd be happy to include a pull request that makes the dependency optional.

The easy way to do it is to wrap specific code sections with #if openfl ... #end in order to make them active only if the OpenFL library is included

jgranick avatar Jul 09 '19 21:07 jgranick

The the part of outputting the image to a bitmap, that appears to be done here:

https://github.com/openfl/svg/blob/5842f1c636c848e31ef9f72b5962bf78a6611b21/format/svg/SVGRenderer.hx#L66

Adding a public method to the main Svg class that merely returns the result of this rather than outputting to a Graphics object would be convenient.

EliteMasterEric avatar Sep 27 '21 04:09 EliteMasterEric