45 Commits

Author SHA1 Message Date
Behdad Esfahbod
b3a0a21125 [transform] Remove redundant methods 2024-05-22 18:46:07 -06:00
Behdad Esfahbod
42a5fbdfdd [VARC] Redesign table
No spec yet. For results see:

https://github.com/harfbuzz/boring-expansion-spec/issues/103#issuecomment-1863533305
2024-05-22 18:46:06 -06:00
Behdad Esfahbod
c3175b271a [transform] Add __eq__ / __ne__ to DecomposedTransform 2024-05-22 18:45:27 -06:00
Khaled Hosny
cf08265cd5 Black 2024-02-06 15:47:35 +02:00
Behdad Esfahbod
7fdb6c23f1 [transform] Use math.copysign 2023-02-06 08:31:01 -07:00
Behdad Esfahbod
4355d006ad [transform] Improve DecomposedTransform
And add tests.

See thread starting at:
https://github.com/fonttools/fonttools/pull/2958#issuecomment-1416859441
2023-02-04 16:30:57 -07:00
Behdad Esfahbod
8e981a1b28 [transform] Change the DecomposedTransform skewX sign to match Transform
Unfortunate but for consistency's sake.

This deviates from VarComposite convention.

https://github.com/fonttools/fonttools/pull/2958#issuecomment-1416155600
2023-02-03 10:23:23 -07:00
Behdad Esfahbod
c0d100f7e8 [transform] Add DecomposedTransform.fromTransform() 2023-02-03 10:06:47 -07:00
Behdad Esfahbod
cf9dece8f2 [transform] Add Transform.toDecomposed() 2023-02-03 09:55:00 -07:00
Behdad Esfahbod
bdbc53b689 [transform] Document DecomposedTransform 2023-02-03 09:37:11 -07:00
Behdad Esfahbod
89aeff636c [transform] Fix mishap 2023-02-03 09:14:08 -07:00
Behdad Esfahbod
2e20e47473 [transform] Rename VarTransform to DecomposedTransform 2023-02-03 09:05:55 -07:00
Behdad Esfahbod
96f602cf3c [transform] Use dataclass for VarTransform 2023-02-03 09:03:19 -07:00
Behdad Esfahbod
69966aa5d7 [BasePen] Add addVarComponent() 2023-02-02 15:25:09 -07:00
Behdad Esfahbod
59418656a4 [VarComposite] Add VarTransform and use 2023-02-02 14:50:26 -07:00
Nikolaus Waxweiler
d584daa8fd Blacken code 2022-12-13 11:26:36 +00:00
Simon Cozens
0f03e6529a
[docs] Fix sphinx warnings (#2453)
* Add default auto doc options

* Ensure all references are unique

* Use anonymous links to avoid duplicate references

* Remove default options, fix wrong module name

* Don’t index repeated class

* Remove repeated classes included through automodule

* Fix warnings

* We don’t use our own static directory

* Correctly format XML in docs

* Fix indentation

* Fix overline

* Bring TOC to top

* Fix definition list

* Offset definition lists and examples

* Fix erroneous markup

* Fix markup

* Already included in automodule

* Fix args markup

* Correct markup for example

* Don’t reindex repeated module

* Correct XML code block markup

* Fix markup errors, change example to doctest

* Correct list markup

* Make ttx docstring both valid RST and valid help output

* Various other boring markup fixes

* Fix example indenting

* Make docstring valid RST and valid help output

* Mock import for reportlab

* It’s ok if manual links don’t appear in toctrees

* Oops typo, I guess doctests are useful
2021-12-02 15:31:49 +00:00
Cosimo Lupo
9c37862087 add Transform.transformVector method
Adds a transformVector and transformVectors methods to the Transform class. Useful for things like https://github.com/googlefonts/ufo2ft/pull/515
2021-08-03 11:49:44 +02:00
Cosimo Lupo
9bdab32082
remove __nonzero__ as it's only for py2 2020-04-29 11:23:29 +01:00
Cosimo Lupo
dbc9d132c0
transform: make Transform class a NamedTuple
This removes some boilerplate code, and also helps when using static type checkers like mypy.
The typing.NamedTuple class was added with python 3.6 which is our min required python, so we are good.
2020-04-29 11:11:39 +01:00
Nikolaus Waxweiler
01328213c7 Remove __future__ imports 2019-08-09 12:20:13 +01:00
Cosimo Lupo
1ac4d2a427
Revert "Merge pull request #1351 from anthrotype/transform-properties"
This reverts commit 70b0fbf9cfb3e2e1e2fc25fd75ddb71814cd62fb, reversing
changes made to 6a5a4c742219d0590f77d1a35163760e5c98a5a9.
2018-10-26 18:10:33 +01:00
Cosimo Lupo
a9f0c89585
transform: add getters for xScale, xyScale, yxScale, yScale, xOffset and yOffset
UFO images have a transformation matrix with those names.
This makes the Transform look more like a namedtuple, in that it can be accessed both by
index and by property name.
2018-10-26 17:10:40 +01:00
Behdad Esfahbod
f70d264ef0 Add __bool__ to fontTools.misc.transform.Transform 2016-04-06 18:15:43 -07:00
Miguel Sousa
a7aef47695 fix "indentation contains mixed spaces and tabs" errors reported by Landscape 2015-08-09 00:33:50 -07:00
Behdad Esfahbod
bd67253118 Some more whitespace fixes from pep8 tool 2015-04-26 01:59:01 -04:00
Behdad Esfahbod
1296c7457e Make tests pass with Python3
In python3, str(float) is noisy.  Always format floats using "%g".
2015-03-03 15:54:37 -08:00
Behdad Esfahbod
e02b9ea05b Fix tests to return failures 2015-03-03 10:47:40 -08:00
Behdad Esfahbod
1ae29591ef from __future__ import absolute_import
Such that our Python 2 is closer to Python 3.

Part of https://github.com/behdad/fonttools/issues/77
2014-01-14 15:07:50 +08:00
Behdad Esfahbod
56da965344 Add @total_ordering to classes with __lt__ 2013-12-07 03:35:16 -05:00
Behdad Esfahbod
8ea6439d3b Implement __ne__ when __eq__ is defined 2013-12-06 22:25:48 -05:00
Behdad Esfahbod
153ec40209 Fix a few pychecker warnings
Fixes https://github.com/behdad/fonttools/issues/58
2013-12-04 01:15:46 -05:00
Denis Jacquerye
af1c9968b2 from __future__ imports must be first for python 3.3.2
adding \ to break lines in fontTools/misc/transorm.py
unneeded closing parenthesis in T_S_I__1.py
2013-11-29 16:03:42 -05:00
Behdad Esfahbod
e388db566b py23 Use new-style classes
Such that we get the same semantics in both Python 2 and 3.
2013-11-28 18:53:30 -05:00
Behdad Esfahbod
714b2a6141 Remove __getslice__
Not needed.  __getitem__ handles it just fine.
2013-11-28 17:32:44 -05:00
Behdad Esfahbod
b7fd2e1913 py23 Remove uses of __cmp__ and cmp() 2013-11-28 17:32:42 -05:00
Behdad Esfahbod
32c10eecff py23 from __future__ import division and adjust divisions 2013-11-28 17:32:42 -05:00
Behdad Esfahbod
30e691edd0 py23 from __future__ import print_function 2013-11-27 17:27:45 -05:00
Behdad Esfahbod
7ed91eca1e py23 import in all nontrivial source files and unused import cleanup 2013-11-27 15:25:00 -05:00
Behdad Esfahbod
3a9fd30180 2to3 equivalent to --fix=tuple_params
I hope I got this all right...
2013-11-27 03:30:21 -05:00
pabs3
85fe10da62 Remove executable permissions from files that do not need them
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@588 4cde692c-a291-49d1-8350-778aa11640f8
2011-03-28 10:18:27 +00:00
jvr
deca398915 more doctests
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@455 4cde692c-a291-49d1-8350-778aa11640f8
2003-09-16 11:30:29 +00:00
jvr
f184f75486 Added lots of doco and doctests.
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@454 4cde692c-a291-49d1-8350-778aa11640f8
2003-09-16 11:01:40 +00:00
jvr
6385a4e9e1 remove trailing whitespace
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@413 4cde692c-a291-49d1-8350-778aa11640f8
2003-08-24 16:17:11 +00:00
jvr
9e58c90401 this module has been included in so many (in house) packages that it's time it gets a more central place.
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@399 4cde692c-a291-49d1-8350-778aa11640f8
2003-08-22 14:56:48 +00:00