Chlumsky / msdfgen

Multi-channel signed distance field generator
MIT License
3.91k stars 404 forks source link

Bad output with SVG input #102

Closed JD31 closed 4 years ago

JD31 commented 4 years ago

Hi !

I am playing with your tools which seems great. I am trying to do a global texture atlas with a font and with some icons defined in SVG.

I have problems when generating some SVG. Please see in attachment.

Any clues ?

enroute_ndb_ncfb.zip

Chlumsky commented 4 years ago

Msdfgen can only work with a single non-intersecting shape. Because of this fact and also because the SVG parser is only rudimentary, it only supports SVG files with only a single path element. I suggest you either:

  1. Write your own SVG parser and 2D geometry engine for computing the union of overlapping paths,
  2. Preprocess the SVG files using a different program to satisfy the conditions above.

Here is your file with the paths merged in Inkscape: enroute_ndb_ncfb_merged.zip

Chlumsky commented 4 years ago

Closing as "not a bug"/duplicate of #13. Yes, the SVG import doesn't work on most files, but it was never meant to and making sure it does is beyond the scope of this project.