Trying to get SVG right

Testing my SVG parser on the Super Tiny Icons

Trying to get Image::CairoSVG to render SuperTinyIcons, I got a lot of failures:

wechat.png failed: extract_path_info: Need 7 parameters for arc at /home/ben/software/install/lib/site_perl/5.32.1/Image/CairoSVG.pm line 347.
wekan.png failed: extract_path_info: Need 7 parameters for arc at /home/ben/software/install/lib/site_perl/5.32.1/Image/CairoSVG.pm line 347.
whatsapp.png failed: extract_path_info: Need 7 parameters for arc at /home/ben/software/install/lib/site_perl/5.32.1/Image/CairoSVG.pm line 347.
wifi.png failed: extract_path_info: Need 7 parameters for arc at /home/ben/software/install/lib/site_perl/5.32.1/Image/CairoSVG.pm line 347.
wire.png failed: extract_path_info: Need 7 parameters for arc at /home/ben/software/install/lib/site_perl/5.32.1/Image/CairoSVG.pm line 347.

I searched the SVG specification but could not see any reason that an arc in a path might have a number of parameters other than 7. It turned out that SVG paths can’t have that, but they can’t have leading zeros either, so

a481 481 0 0036-78  

has to be parsed as

a 481 481 0 0 0 36 -78

It turned out my regular expression parser in Image::SVG::Path had some errors related to parsing the single-digit flags. I got the regex right but still the results looked bad:

Here the correct SVG rendering is on the left, and my module’s results are on the right. This was some kind of mistranslation of the Python code. Changing ^ to || got me to

but this is missing the dots on the “i”. Hmm.

I’ve gone ahead and put the full results for the Super Tiny Icons on this web page. I’ll try to remember to update it as I try to improve the module.