Page 1 of 1

TÖVE display large svg issue [SOLVED]

Posted: Sun Jun 11, 2023 7:23 pm
by pbergaus
Hello,

I have an issue with displaying large svg files. What do I have to check that an svg file is displayed?
When I
graphics = tove.newGraphics(svgData, 200)
-> Does this scale every size to 200px on the canvas?

I exported a png file with a procedurally generated town.
In gimp I created paths by selecting colors nad exported them to svg.
In Inkscape I exploded the paths and put them into the groups.
I did export the svg file as plain svg.

Is the structure of the svg file bad?


Here are the files:
freilerten_pfade_plain.svg.txt
(304.23 KiB) Downloaded 93 times
Main.lua
(544 Bytes) Downloaded 86 times
conf.lua
(163 Bytes) Downloaded 83 times
Thanks
Philipp

Re: TÖVE display large svg issue

Posted: Sun Jun 11, 2023 8:21 pm
by Andlac028
I didn’t saw the file in Inkscape, but I think 312kB is really big for svg. Aren’t there many unnecesarry nodes (very likely when using exported paths from png)? Try to simplify it with Inkscape’s path simplify (or how it’s called) or use some kind of online svg minimizers to simplify paths a bit.

Re: TÖVE display large svg issue [SOLVED]

Posted: Sun Jun 11, 2023 9:01 pm
by pbergaus
Hello,

thanks for the quick reply.

Yes the file is relatively large, but that was not the issue.
The filling was not set, so it was "black" and not visible. When changing/setting fill to "white" the content was visible.

Thanks