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

Float parse error for paths #8

Closed
eugeneilyin opened this issue Nov 15, 2018 · 1 comment
Closed

Float parse error for paths #8

eugeneilyin opened this issue Nov 15, 2018 · 1 comment

Comments

@eugeneilyin
Copy link
Contributor

The current implementation of Delphi SVG library has an issue with floating-point-constant parsing logic. Here is an example of fingerprint system icon from Google material design:

image

The correct BNF notation provided in the SVG 1.1 spec for floating numbers is:

number:
    sign? integer-constant
    | sign? floating-point-constant
flag:
    "0" | "1"
comma-wsp:
    (wsp+ comma? wsp*) | (comma wsp*)
comma:
    ","
integer-constant:
    digit-sequence
floating-point-constant:
    fractional-constant exponent?
    | digit-sequence exponent
fractional-constant:
    digit-sequence? "." digit-sequence
    | digit-sequence "."
exponent:
    ( "e" | "E" ) sign? digit-sequence
sign:
    "+" | "-"
digit-sequence:
    digit
    | digit digit-sequence
digit:
    "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"
wsp:
    (#x20 | #x9 | #xD | #xA)

SVG 2.0 spec still not stabilized

eugeneilyin added a commit to eugeneilyin/DelphiSVG that referenced this issue Nov 15, 2018
Add additional chars support for correct float parsing
@eugeneilyin eugeneilyin mentioned this issue Nov 15, 2018
@eugeneilyin
Copy link
Contributor Author

@ekot1 please find the pull request with the fix above

@ekot1 ekot1 closed this as completed in 2c02f23 Nov 15, 2018
ekot1 added a commit that referenced this issue Nov 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant