Skip to content

svg2tvgt does not handle exponent notation #26

@InstanceGaming

Description

@InstanceGaming
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions