331 Commits

Author SHA1 Message Date
Behdad Esfahbod
ad6c5eb89c black 2023-07-24 13:01:57 -06:00
Behdad Esfahbod
20585ac05b [statisticsPen] Add -q,--quiet 2023-07-24 12:53:15 -06:00
Behdad Esfahbod
050370764a [statisticsPen,svgPathPen] Add -y for face-index 2023-07-24 12:48:57 -06:00
Behdad Esfahbod
2ef075050a [statisticsPen] Add --variations 2023-07-24 12:42:53 -06:00
Behdad Esfahbod
ab2aac58d5 [statisticsPen] Report slant in angles too 2023-07-24 12:35:04 -06:00
Behdad Esfahbod
133f907cbc [statisticsPen] Report perceptual weight/slant average 2023-07-24 12:32:06 -06:00
Behdad Esfahbod
3f46e67e8b [statisticsPen] Report font-wide slant 2023-07-19 20:03:38 -06:00
Behdad Esfahbod
8707a1da58 [statisticsPen] Report font glyph-average weight/width 2023-07-19 19:55:32 -06:00
Cosimo Lupo
5c0f05cc42
allow to pass 'round' parameter in ttGlyphPen, optimize for noRound 2023-06-08 11:41:07 +01:00
Cosimo Lupo
97e626b23e
ttGlyphPen: drop implied before rounding, allow not to round at all
We want to be able to compute implied oncurves both before coordinates have been rounded to integer and afterwards.
Also when ufo2ft builds interpolatable master TTFs, we want to turn off the rounding so that varLib can call dropImpliedOnCurvePoints on the un-rounded coordinates, so we need an option to disable rounding the coordinates in the ttGlyphPens
2023-06-07 17:55:56 +01:00
Cosimo Lupo
b6bb9dfef0
ttGlyphPen: only call dropImpliedOnCurvePoints for simple glyphs after fully formed 2023-06-02 13:53:00 +01:00
Cosimo Lupo
b7f4e9b83e
move dropImpliedOnCurvePoints function to glyf table module
so it can be used by client code on multiple glyf Glyph objects regardles of TTGlyphPen
2023-06-01 16:49:29 +01:00
Cosimo Lupo
a73abc6b87
make drop_implied_oncurves work with multiple interpolatable glyphs 2023-06-01 16:49:29 +01:00
Cosimo Lupo
3bbc19abb1
TTGlyphPen: do not error with empty contours, simply ignore them
Fixes https://github.com/googlefonts/fontmake/issues/1001
2023-05-31 11:58:14 +01:00
Cosimo Lupo
39c9783bf8
add filter pen that explicitly emits closing line when lastPt != movePt
it can be useful when comparing two paths and testing whether then contain the same number/types of segments
2023-05-02 14:56:56 +01:00
Cosimo Lupo
0df4997661
prevent cython.compiled raise AttributeError if cython not properly installed
It's possible sometimes that 'import cython' does not fail but then 'cython.compiled' raises AttributeError.
It actually happened in our internal production environment...

Similar issue to https://github.com/pydantic/pydantic/pull/573 and https://github.com/ipython/ipython/issues/13294
2023-03-02 17:43:38 +00:00
Behdad Esfahbod
e72d195583 [qu2cu] Adjust stats to match cu2qu 2023-02-22 09:18:49 -07:00
Behdad Esfahbod
8f89a435ac [ttGlyphPen] Rename preserveTopology to dropImpliedOnCurves 2023-02-22 09:08:39 -07:00
Behdad Esfahbod
7580fc7e24 [cu2quPen] Remove unnecessary check 2023-02-22 07:44:13 -07:00
Cosimo Lupo
c7fa0e6f26
Cu2QuPointPen: minor refactoring of _drawPoints method 2023-02-22 12:03:04 +00:00
Behdad Esfahbod
58f9245115 [ttGlyphPen] Refactor code into function 2023-02-21 21:16:27 -07:00
Behdad Esfahbod
9c60b86b46 [cu2quPen] Add all_quadratic=True 2023-02-21 14:52:15 -07:00
Behdad Esfahbod
82e0536beb [glyf] Support cubic curves
https://github.com/harfbuzz/boring-expansion-spec/issues/41
2023-02-21 13:01:49 -07:00
Behdad Esfahbod
085b489012 [qu2cuPen] Change stats
To count number of quadratic vs cubic segments.
2023-02-21 13:01:41 -07:00
Behdad Esfahbod
94ee47c6e4 [qu2cu] Add a test and fix a bug 2023-02-20 12:22:16 -07:00
Behdad Esfahbod
41732b5904 [qu2cu] Use math.isclose 2023-02-20 12:02:09 -07:00
Behdad Esfahbod
f87a897c7f
Merge pull request #2993 from fonttools/qu2cu
qu2cu
2023-02-20 11:04:48 -07:00
Behdad Esfahbod
d0896ac296 [qu2cu] Simplify API
Drop the one that was special-case of the other.
2023-02-20 10:03:30 -07:00
Behdad Esfahbod
efed2550be [qu2cu_pen] Respect all_cubic for oncurveless curves 2023-02-20 09:10:07 -07:00
Behdad Esfahbod
336cfc3e8f [qu2cu_pen] Respect all_cubic 2023-02-20 09:05:58 -07:00
Behdad Esfahbod
8427e6dd18 [ttGlyphPen] Add preserveTopology=True
If False, perform implicit-oncurve elimination.
2023-02-18 15:45:27 -07:00
Behdad Esfahbod
84cd10d666 [qu2cuPen] Don't add implicit points for cubics
We can't since that would be interpretted as a superBezier.
2023-02-18 09:46:56 -07:00
Behdad Esfahbod
86aff322b9 [qu2cuPen] Drop quadratic implicit oncurves too 2023-02-18 09:46:56 -07:00
Behdad Esfahbod
c11682ca85 [qu2cuPen] Drop cubic implicit oncurves 2023-02-18 09:46:56 -07:00
Behdad Esfahbod
ea8ae8f399 Black 2023-02-18 09:46:56 -07:00
Behdad Esfahbod
ceae682246 [qu2cu] Add all_cubic parameter 2023-02-18 09:46:56 -07:00
Behdad Esfahbod
1a10b05c99 [qu2cuPen] Process multiple qCurveTo's at a time 2023-02-18 09:46:56 -07:00
Behdad Esfahbod
8c88184413 [qu2cuPen] Support quadratic splines with no on-curve 2023-02-18 09:46:56 -07:00
Behdad Esfahbod
e3f7154a9d [qu2cuPen] Keep quadratics if more economical
Perhaps the pen should have a setting for this.
2023-02-18 09:46:56 -07:00
Behdad Esfahbod
b221f867df [qu2cu] Add cli.py that converts TTFs to cubic glyf1 2023-02-18 09:46:56 -07:00
Behdad Esfahbod
92e3433589 [pens] Add qu2cuPen.py 2023-02-18 09:46:56 -07:00
Behdad Esfahbod
2b9be6eca1 [Cu2QuMultiPen] Add TODO 2023-02-18 09:46:56 -07:00
Behdad Esfahbod
ac94ee9949 [Cu2QuPen] Use FilterPen 2023-02-18 09:46:56 -07:00
Behdad Esfahbod
e18fca76ef [filterPen] Add current_pt 2023-02-18 09:46:56 -07:00
Behdad Esfahbod
64bce6fc9b [cu2quPen] Remove deprecated ignore_single_points 2023-02-18 09:46:56 -07:00
Cosimo Lupo
847ce2866e
reverseContourPen: fix duplicate lineTo when outputImpliedClosingLine=True 2023-02-17 17:07:24 +00:00
Behdad Esfahbod
d342440235 [pointPen] Raise AttributeError in addVarComponent 2023-02-06 08:33:30 -07:00
Behdad Esfahbod
e374af919d [ttGlyphSet] Only decompose VarComposites on AttributeError
Keep NotImplementedError for clients to really say don't want it.
2023-02-03 13:35:09 -07:00
Behdad Esfahbod
df43ae3684 [basePen] Add addVarComposite() to DecomposingPen
Also change AbstractPen's.
2023-02-03 12:37:40 -07:00
Behdad Esfahbod
11b2427f61 [pointPen] Add addVarComponent to GuessSmoothPointPen 2023-02-03 11:19:04 -07:00