svg
svg copied to clipboard
without openfl
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
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
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.