googlefonts / picosvg

Helps simplify SVG files. Intended for use as part of a font build.
Apache License 2.0
141 stars 12 forks source link

Allow more SVG text in allowText option #294

Closed NightFurySL2001 closed 1 year ago

NightFurySL2001 commented 1 year ago

SVG defineds 3 text element: text, tspan and textPath. Allows all 3 to be passthrough when allowText = True

NightFurySL2001 commented 1 year ago

Fixes #292

anthrotype commented 1 year ago

Can you add a test in tests/svg_test.py maybe using the SVG from the issue report #292 ? Add it somewhere here, name the file e.g. text-tspan-before.svg and save the expected result next to it, name it text-tspan-nano.svg like the others:

https://github.com/googlefonts/picosvg/blob/84c649c5a15e3c441ed85f9fc8f1d3c49c526ad9/tests/svg_test.py#L290

NightFurySL2001 commented 1 year ago

From what I see in 44192dec68, the push author used a new function instead of putting it in the mentioned position as picosvg should throw error when allowText = False.

Can @zond help a lil bit here?

anthrotype commented 1 year ago

ok, yes you're right. Add a new test function or parametrize the one for allowText=True, thanks!

anthrotype commented 1 year ago

sorry I pushed the wrong button :)

NightFurySL2001 commented 1 year ago

@anthrotype any updates?

anthrotype commented 1 year ago

thanks!