Khaled Hosny
383e70fc39
[sstruct] Accept pad byte format character
...
The list of format characters that sstruct accepts was missing “x” for
ignored pad bytes.
2021-07-05 01:33:16 +02:00
Khaled Hosny
bdd462f066
[sstruct] Accept bool format character
...
The list of format characters that sstruct accepts was missing “x” for
ignored pad booleans.
2021-07-03 13:50:08 +02:00
Khaled Hosny
617aee7f03
[sstruct] Minor
...
To reduce the noise in the next commits.
2021-07-03 13:49:53 +02:00
Behdad Esfahbod
f64f0b42f2
Consolidate bit_count / popCount methods
...
Fixes https://github.com/fonttools/fonttools/issues/2331
2021-06-04 10:15:51 -06:00
Behdad Esfahbod
d12d7fbb75
[glyf] Remove unused code
...
Also simplify bounds check.
2021-04-13 15:13:00 -06:00
Behdad Esfahbod
80069e9608
[py23] Make tobytes() always return bytes even for bytearray
2021-04-08 11:13:15 -06:00
Behdad Esfahbod
3a80b56829
[py23] Change tobytes() to accept bytearray
2021-04-08 09:41:45 -06:00
Just van Rossum
5fc65d7168
Misc py23 cleanups ( #2243 )
...
* Replaced all from ...py23 import * with explicit name imports, or removed completely when possible.
* Replaced tounicode() with tostr()
* Changed all BytesIO ans StringIO imports to from io import ..., replaced all UnicodeIO with StringIO.
* Replaced all unichr() with chr()
* Misc minor tweaks and fixes
2021-03-29 11:45:58 +02:00
Chris Simpkins
7abf2e4c75
transition basestring
to str
...
https://github.com/fonttools/fonttools/issues/2232
2021-03-27 10:23:29 -04:00
Chris Simpkins
3e252d8c87
[py23] change deprecation warning from "next release" to "future release"
2021-03-20 11:52:12 -04:00
Behdad Esfahbod
062b7c434e
Merge pull request #2214 from fonttools/varLib-round
...
[varLib] Move rounding to VariationModel, to avoid error accumulation from multiple deltas
2021-03-04 16:40:40 -07:00
Behdad Esfahbod
d56b844142
[varLib] Round outline deltas using banker's round as well
...
See https://github.com/fonttools/fonttools/pull/2214#issuecomment-790742479
2021-03-04 13:00:04 -07:00
Just van Rossum
6a8821d91c
Revert "Use Vector in some places where it improves the clarity of the code" ( #2215 )
...
* Revert most of "Use Vector in some places where it improves the clarity of the code (#2206 )"
This reverts most of commit 0d3ce2cafc6f604fc46d4d3bfbab34a5bc59e27b.
2021-03-04 20:15:24 +01:00
Behdad Esfahbod
3a9a2bd4b1
[misc.roundTools] Add noRound(), maybeRound(), and roundFunc()
...
Moving out of CFF code, to be used in VariationModel().
Part of https://github.com/fonttools/fonttools/issues/2213
2021-03-04 09:20:43 -07:00
Behdad Esfahbod
abc1ba07a4
[misc.roundTools] New module; move otRound() here
...
Code relying on old place (fixedTools.otRound) still works.
2021-03-04 09:20:43 -07:00
Just van Rossum
0d3ce2cafc
Use Vector in some places where it improves the clarity of the code ( #2206 )
...
* Use Vector in some places where it improves the clarity of the code
* add __all__ to vector.py
* turned some list comprehensions into generator expressions: there's no need for an intermediate list in these cases
* Add empty __slots__ to Vector, so we don't waste space on a __dict__.
* add some tests for segmentPointAtT
2021-03-04 15:32:45 +01:00
justvanrossum
9c9ab5ac3a
removed info-less doc string
2021-02-27 20:05:53 +01:00
justvanrossum
44b7560fe5
move Vector to its own submodule, and rewrite as a tuple subclass
2021-02-27 19:54:53 +01:00
Simon Cozens
a775b6e19c
Fix _aligment_transformation as suggested
2021-02-26 13:13:59 +00:00
Simon Cozens
60c1ee0107
Black whole module
2021-02-26 10:03:37 +00:00
Simon Cozens
1a3478da0e
Fixes from review
2021-02-26 10:03:32 +00:00
Simon Cozens
2ef7964e90
If we swapped the segments, we must swap them back when returning results
2021-02-18 22:12:20 +00:00
Simon Cozens
1795ee98b2
Address various feedback
2021-02-18 14:54:27 +00:00
Simon Cozens
fdceeee0c6
Unnecessary parens
2021-02-18 11:39:46 +00:00
Simon Cozens
c082616c6f
Make hacky uniquifying thing more explicit
2021-02-18 11:39:36 +00:00
Simon Cozens
80a3227f44
Raise error in unknown curve degrees
2021-02-18 11:39:01 +00:00
Simon Cozens
6a223e5f93
Rename parameters
2021-02-18 11:38:40 +00:00
Simon Cozens
2e211194c8
No harm in handling all segment types here
2021-02-18 11:23:24 +00:00
Simon Cozens
c17b1c9e9f
Oops, this has a different interface to the curve-based ones
2021-02-18 11:20:45 +00:00
Simon Cozens
01957a9b94
Intersection and point-at-time functions from beziers.py
2021-02-18 10:49:52 +00:00
Simon Cozens
8e42f693a7
Add function to compute bounding box area
2021-02-18 10:48:09 +00:00
justvanrossum
f416a5cb17
fix Vector division
2021-02-03 20:24:04 +01:00
Cosimo Lupo
822d3bf261
plistlib: remove unused 'type: ignore' comment to appease mypy
2021-01-25 17:42:19 +00:00
justvanrossum
186032cb10
fixed formatting
2020-11-09 15:39:21 +01:00
Nikolaus Waxweiler
0742a9bff3
Implement suggestions
2020-09-21 17:01:22 +01:00
Nikolaus Waxweiler
a1df979335
Update Lib/fontTools/misc/plistlib/__init__.py
...
Co-authored-by: Cosimo Lupo <cosimo@anthrotype.com>
2020-09-21 16:53:55 +01:00
Nikolaus Waxweiler
4efc06e62f
Update Lib/fontTools/misc/plistlib/__init__.py
...
Co-authored-by: Cosimo Lupo <cosimo@anthrotype.com>
2020-09-21 16:53:46 +01:00
Nikolaus Waxweiler
2906ac2908
One less type-ignore
2020-09-16 20:28:33 +01:00
Nikolaus Waxweiler
09a64418f0
Misplaced ignore
2020-09-16 20:08:45 +01:00
Nikolaus Waxweiler
a501c0cbe7
More typing and ignores
2020-09-16 19:59:50 +01:00
Nikolaus Waxweiler
10864be26f
Fix one typing warning
2020-09-16 17:42:46 +01:00
Nikolaus Waxweiler
863d9fd3c8
Add py.typed file
2020-09-16 12:03:52 +01:00
Nikolaus Waxweiler
e1c9710272
More types, correct stale comment
2020-09-16 09:52:46 +01:00
Nikolaus Waxweiler
fa32cf2fed
Remove unused type comment
2020-09-16 09:31:05 +01:00
Nikolaus Waxweiler
a364cff13f
No need for _D anymore
2020-09-15 23:58:23 +01:00
Nikolaus Waxweiler
be77335993
Remove unused typing imports
2020-09-15 23:31:03 +01:00
Nikolaus Waxweiler
8a5baa0aa6
Return Any from load*
...
https://github.com/python/typeshed/pull/4543
2020-09-15 23:27:39 +01:00
Nikolaus Waxweiler
d70ca8224e
More typing
2020-09-15 18:31:07 +01:00
Nikolaus Waxweiler
4f51a5da10
More typing
2020-09-15 17:20:03 +01:00
Nikolaus Waxweiler
9d13fe1150
Simplify typing for singledispatch
2020-09-15 15:01:53 +01:00