Cosimo Lupo
8891f4185e
[t2CharStringPen] allow tolerance to be > 0.5
...
See https://github.com/fonttools/fonttools/pull/804#issuecomment-272559973
2017-01-13 22:32:10 +00:00
Cosimo Lupo
456e159a5a
[t2CharStringPen] raise ValueError if tolerance not in range 0 <= t <= 0.5
2017-01-13 09:34:42 +00:00
Cosimo Lupo
0a9800b109
[t2CharStringPen] use abs() instead of math.fabs()
...
abs ends up calling fabs for floats anyway, and is a bit faster if 'number' is an int
2017-01-13 09:25:49 +00:00
Cosimo Lupo
3165fa9703
[t2CharStringPen] always round the advance widths regardless of roundTolerance
...
hmtx only can have integer values, so it would be weird to have widths as float in CFF...
2017-01-12 22:38:28 +00:00
Cosimo Lupo
adac78591d
[t2CharStringPen] restore default rounding; tolerance must be between 0 and .5
2017-01-12 21:34:59 +00:00
Cosimo Lupo
834d0d4cca
[t2CharStringPen] disable rounding coordinates; add 'roundTolerance' argument
...
Rounding of coordinates is now disabled by default.
The pen now accepts an optional 'roundTolerance' float, with values between
0 and 1 (default is 0).
Values >= 0.5 mean round all coordinates to integers.
Values between 0 and 0.5 mean round only when the absolute difference
between the original float and the rounded integer is within the tolerance
Fixes #769
2017-01-12 19:48:55 +00:00
James Godfrey-Kittle
5d7f3a9a1f
Fix author name typo
2015-10-30 10:32:04 -07:00
James Godfrey-Kittle
e85b975f3a
Fix imports in t2CharStringPen
...
We don't need the array module here, and it looks like py23.* should
be imported everywhere.
2015-10-23 11:36:46 -07:00
James Godfrey-Kittle
82e53f020c
Use Python3-compatible arguments for roundIntPoint
2015-10-23 11:23:21 -07:00
James Godfrey-Kittle
7b3ac62db7
Add pen which draws to Type 2 charstrings
2015-10-23 11:15:16 -07:00