uber / cyborg

Display Android Vectordrawables on iOS.
Apache License 2.0
300 stars 19 forks source link

Error parsing vector that Android is happy with #73

Closed flatslats closed 4 years ago

flatslats commented 4 years ago

I've got a few vector assets that render fine in Android but fail with "Error parsing the tag: Expected one of the path commands, but found "t"". Perhaps this is due to how the assets were created, or perhaps it's a Cyborg issue (I haven't had time to really dig into it).

I can provide an example if anybody wants to recreate/debug, unless you have a "it's probably this" solution?

Many thanks.

benpious commented 4 years ago

Thanks for reporting this. This appears to be a bug in Cyborg; the SVG 2 Spec says that we should support a "shorthand" for Quadratic curves, which starts with "T" or "t"; but it seems we do not. I'm not sure how this slipped under the radar for so long, and I hope that it isn't causing you too much trouble.

In terms of temporary workarounds; you might try a different exporter, or perhaps running an SVG optimizer on the SVG before converting, which may, as an implementation detail, choose to rewrite these commands. Internally we have never encountered this issue; which suggests that either our exporter (a command line version of the Android Studio tool) or our content authoring tool (Figma) prefers not to use this command, for some reason.