[fonttools/fonttools] d73de4: [cu2qu] Add failing test for split_cubic_into_thre...

0 views
Skip to first unread message

Cosimo Lupo

unread,
Apr 22, 2026, 12:08:28 PM (4 days ago) Apr 22
to fontto...@googlegroups.com
Branch: refs/heads/fix-cu2qu-split-three-complex-div
Home: https://github.com/fonttools/fonttools
Commit: d73de432a7d8b0e4e54c58970709e9ebb8369500
https://github.com/fonttools/fonttools/commit/d73de432a7d8b0e4e54c58970709e9ebb8369500
Author: Cosimo Lupo <cos...@anthrotype.com>
Date: 2026-04-22 (Wed, 22 Apr 2026)

Changed paths:
M Tests/cu2qu/cu2qu_test.py

Log Message:
-----------
[cu2qu] Add failing test for split_cubic_into_three complex division

Same class of Cython-vs-pure-Python divergence fixed in
calc_cubic_points by PR #3930, but in split_cubic_into_three
which has its own / 3.0 expressions. Cython's C complex division
(__divdc3) uses multiply-by-reciprocal internally, producing a
1-ULP difference from Python's scalar division. This causes ±1
off-curve coordinate rounding on fonts with fractional default-
master coordinates (e.g. JosefinSans-Italic).

https://github.com/fonttools/fonttools/issues/3928



To unsubscribe from these emails, change your notification settings at https://github.com/fonttools/fonttools/settings/notifications

Cosimo Lupo

unread,
Apr 22, 2026, 1:23:16 PM (3 days ago) Apr 22
to fontto...@googlegroups.com
Branch: refs/heads/main
Home: https://github.com/fonttools/fonttools
Commit: d73de432a7d8b0e4e54c58970709e9ebb8369500
https://github.com/fonttools/fonttools/commit/d73de432a7d8b0e4e54c58970709e9ebb8369500
Author: Cosimo Lupo <cos...@anthrotype.com>
Date: 2026-04-22 (Wed, 22 Apr 2026)

Changed paths:
M Tests/cu2qu/cu2qu_test.py

Log Message:
-----------
[cu2qu] Add failing test for split_cubic_into_three complex division

Same class of Cython-vs-pure-Python divergence fixed in
calc_cubic_points by PR #3930, but in split_cubic_into_three
which has its own / 3.0 expressions. Cython's C complex division
(__divdc3) uses multiply-by-reciprocal internally, producing a
1-ULP difference from Python's scalar division. This causes ±1
off-curve coordinate rounding on fonts with fractional default-
master coordinates (e.g. JosefinSans-Italic).

https://github.com/fonttools/fonttools/issues/3928


Commit: 37a013acc7622a4e58ce849324f8c5284685aef7
https://github.com/fonttools/fonttools/commit/37a013acc7622a4e58ce849324f8c5284685aef7
Author: Cosimo Lupo <cos...@anthrotype.com>
Date: 2026-04-22 (Wed, 22 Apr 2026)

Changed paths:
M Lib/fontTools/cu2qu/cu2qu.py

Log Message:
-----------
[cu2qu] Use _complex_div_by_real in split_cubic_into_three

Apply the same fix from PR #3930 to the two remaining / 3.0
expressions in split_cubic_into_three, which were missed by
the original calc_cubic_points fix.

https://github.com/fonttools/fonttools/issues/3928


Commit: 1419daa6680c5c899713598956caa69ad47bcd23
https://github.com/fonttools/fonttools/commit/1419daa6680c5c899713598956caa69ad47bcd23
Author: Cosimo Lupo <cos...@anthrotype.com>
Date: 2026-04-22 (Wed, 22 Apr 2026)

Changed paths:
M Lib/fontTools/cu2qu/cu2qu.py
M Tests/cu2qu/cu2qu_test.py

Log Message:
-----------
Merge pull request #4083 from fonttools/fix-cu2qu-split-three-complex-div

[cu2qu] Use _complex_div_by_real in split_cubic_into_three


Compare: https://github.com/fonttools/fonttools/compare/74c193fec73b...1419daa6680c
Reply all
Reply to author
Forward
0 new messages