Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

svg2tvgt does not handle exponent notation #26

Open
InstanceGaming opened this issue Apr 30, 2024 · 0 comments
Open

svg2tvgt does not handle exponent notation #26

InstanceGaming opened this issue Apr 30, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@InstanceGaming
Copy link

InstanceGaming commented Apr 30, 2024

Error Context: 'm 29.999999,966.99995 c 2.165728,0.62971 2,2.92139 2,4 v 6 l 5.500488,2.93602 v -0.94881 h 1.999512 v 1.87166 l 5.500488,2.53858 v 3 l -0.242802,-1.07127 -5.461299,-0.96633 c -0.142213,0.55588 0,0.96633 -0.830021,1.8397 -0.834042,-0.87337 -0.706803,-1.52334 -0.834042,-2.14146 l -3.632812,-0.66064 h -1.999512 c _0,2.46655 -10e-7,4.60254 -0.798688,9.063.'
Unhandled exception:
System.Exception: Unexpected char 'e', expected one of 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ., +, -
   at SvgPathParser.AcceptChar(Char[] list)
   at SvgPathParser.ParseNumberGeneric(Boolean allow_sign)
   at SvgPathParser.ParseCoordinate()
   at SvgPathParser.ParseCoordinatePair()
   at SvgPathParser.ParseCoordinatePairTuple(Int32 tuple_size)
   at SvgPathParser.ParseCoordinatePairTupleSequence(Int32 tuple_size)+MoveNext()
   at SvgPathParser.ParseCurveTo()
   at SvgPathParser.ParseDrawToCommand()
   at SvgPathParser.ParsePath()
   at SvgPathParser.Parse(String str, IPathRenderer renderer)
   at SvgConverter.TranslateNodes(AnalyzeResult data, TvgStream stream, SvgNode node)
   at SvgConverter.TranslateNodes(AnalyzeResult data, TvgStream stream, SvgNode node)
   at SvgConverter.TranslateNodes(AnalyzeResult data, TvgStream stream, SvgNode node)
   at SvgConverter.ConvertToTvgText(SvgDocument document)
   at Application.Main(String[] args)

Proposed solution: add "e" and "E" to the AcceptChar() check in svg2tvgt.cs, as float.Parse() seems to handle the exponent notation already.

Version: In lieu of a semantic version (why no version numbers?), the Windows executable's SHA1 is f2068828d9ccead7bfdeb0cd950ec23a07e78ec8, downloaded from your site 4/30/2024.

@InstanceGaming InstanceGaming changed the title svg2tvgt does not handle scientific notation svg2tvgt does not handle exponent notation Apr 30, 2024
@ikskuh ikskuh added the bug Something isn't working label May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants