~silnrsi/smith/+git/fonttools-master:fealib-raise-error-missing-arg

Last commit made on 2022-05-17
Get this branch:
git clone -b fealib-raise-error-missing-arg https://git.launchpad.net/~silnrsi/smith/+git/fonttools-master

Branch merges

Branch information

Name:
fealib-raise-error-missing-arg
Repository:
lp:~silnrsi/smith/+git/fonttools-master

Recent commits

2a6459b... by Nikolaus Waxweiler <email address hidden>

Add missing location argument to raise

42e4d66... by Nikolaus Waxweiler <email address hidden>

Merge pull request #2609 from fonttools/ds5-add-some-polish

[designspaceLib] Add some polish to the v5 paths

fc174a9... by Nikolaus Waxweiler <email address hidden>

Undo warning

26bf33b... by Nikolaus Waxweiler <email address hidden>

Use assert instead of standalone error

b488d10... by Cosimo Lupo <email address hidden>

Merge pull request #2611 from tshinnic/svglib_parser_real_number_format

Handle one more valid real number format in svgLib parse_path()

a09e80b... by Cosimo Lupo <email address hidden>

Merge pull request #2596 from tshinnic/path_arc_rx_ry_nonnegative

Protect SVG path parsing from negative rx ry on arc commands

5abfef1... by Tom Shinnick

Handle one more valid real number format in svgLib parse_path()

Using svg.draw(pen) and parse_path() from svgLib threw exception
     ValueError: could not convert string to float: 'a'
on a SVG <path> string generated by Inkscape. Altering the path
string might object to other string bits like 'Z' or 'v', or
give even stranger exceptions.

Finally tracked it down to the path containing particular valid
numbers like "-4e-5" or "1e-4". Changing these to "-4.0e-5" or
"1.0e-4" would stop the exceptions. The parse_path() was not
accepting valid SVG real numbers.

The specification for real number formats is a bit of a mess in
CSS land right now, but the reassuringly concrete spec is:
    https://www.w3.org/TR/css-syntax-3/#number-token-diagram
which allows a real number having an exponent but without having
a fractional part, such as the number "1e3".

This change updates an RE to make fractional parts optional,
and adds a test for this valid SVG number format.

2066d3a... by Tom Shinnick

Update svgLib test for now non-negative arc radius values

Missed this test in previous commit.

Test is testing that parsing extraction of individual parameters
works as specified when spaces are omitted. Such as signaled when
a new number is specified with a leading sign +/-

Test previously used
     "M1-2A3-4-1.0 01.5.7",
where the first arc radius value was '3' and the second was '-4'.

Now that we are forcing radius values to be non-negative using abs()
the value returned in the test is not
     ("arcTo", (3.0, -4.0, -1.0, False, True, (0.5, 0.7))),
but rather
     ("arcTo", (3.0, 4.0, -1.0, False, True, (0.5, 0.7))),

Changed to expect the positive value, nicely the test continues to
test omitting spaces, but now also tests that negative radius values
are forced non-negative.

9f984d9... by Nikolaus Waxweiler <email address hidden>

Fix up tests

177e0a7... by Nikolaus Waxweiler <email address hidden>

Clean up one of the DSv5 documents somewhat