Hello All,
We are having difficulty displaying colour SVG illustrations (originally created in Adobe Illustrator as EPS) using https://github.com/openfl/svg. With Flash target the SVG images appear black and white with some elements missing and/or additional ones appearing when rendering. With HTML5 target the entire index page is black. Our main target is HTML5 and I’m trying to make a case for using Haxe/OpenFl (they are displaying fine in standard HTML pages).
We are using this code to test:
package;
import openfl.display.Sprite;
import openfl.Assets;
import openfl.display.Shape;
import format.SVG;
class Main extends Sprite {
public function new () {
super ();
var svg : SVG = new SVG(Assets.getText("assets/apple_01.svg"));
var shape : Shape = new Shape();
svg.render(shape.graphics,0,0,500,500);
addChild(shape);
}
}
OpenFl 7.1.2, SVG 1.1.2, Lime 6.2.0, Haxe 3.4.7
Any help gratefully received.
Thanks
Mark
NB: we have a large number of these SVG files (1,000+) and really want to avoid converting them all to PNG format as we will be displaying them at various sizes in our app.
I’m attaching 3 files:
How the image looks as PNG (apple_01.png).
A screen capture of how the SVG is displaying in Flash target using above code (apple_01_flash.png).
The original SVG (apple_01.svg).