637 Commits

Author SHA1 Message Date
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
Nikolaus Waxweiler
bbfc7b9ff5 Fix type mixup 2020-09-15 14:27:22 +01:00
Nikolaus Waxweiler
ff0e0028f4 Use overload instead of exploding singledispatch 2020-09-15 13:00:36 +01:00
Nikolaus Waxweiler
7c02ab3d3c woopsie 2020-09-15 00:02:54 +01:00
Nikolaus Waxweiler
80b8b1556c WIP: add typing info to plistlib 2020-09-14 23:45:21 +01:00
Simon Cozens
18a978bd3d Remove MacOS module references. Fixes #1978. 2020-07-07 09:08:10 +01:00
Simon Cozens
775dc6074e
fontTools.misc.* documentation, part 2 (#1981)
* Document misc.filenames
* Document misc.fixedTools
* Document misc.intTools
* Document misc.loggingTools
* Document misc.macCreatorType
* Document misc.macRes
* Document misc.plistlib
2020-06-08 15:53:48 +01:00
Simon Cozens
76902b7129
[docs] fontTools.misc.* part 1 (#1956)
* Document misc.arrayTools
* Document misc.bezierTools
* Document cliTools
* Document eexec
2020-05-19 09:51:17 +01:00
Cosimo Lupo
b81d13952a
Merge pull request #1932 from simoncozens/pscharstring-repeated-init
[misc.psCharStrings] Use inheritance to avoid repeated code in initializer
2020-05-11 11:15:54 +01:00
Simon Cozens
b69052de47 [misc.psCharStrings] Use inheritance to avoid repeated code in initializer 2020-05-07 21:21:40 +01:00
Simon Cozens
f52eabeefe Fix typo in loggingTools variable name 2020-05-07 21:18:29 +01:00
justvanrossum
f7f01b3c1a add getGlyphNames() to FakeFont 2020-04-29 16:31:30 +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
Cosimo Lupo
b2788f8656
move cython shadow module to fontTools.misc 2020-03-31 17:42:38 +01:00
schriftgestalt
a0f39128d4 remove unused variable 2020-03-12 13:46:42 +01:00
Christof Kaufmann
1a6cb48ea0 Use non-localized date parsing to fix #1838 2020-02-25 11:59:31 +01:00
Cosimo Lupo
550711e106
move MAX_F2DOT14 constant to fixedTools 2019-10-23 16:50:12 +01:00
Nikolaus Waxweiler
6b9eefcf48 Warn if use_builtin_types is False 2019-10-14 11:04:52 +01:00
Nikolaus Waxweiler
6da6a2c377 Fix typo 2019-10-12 13:49:36 +01:00
Nikolaus Waxweiler
94c3aff991 Remove redundant object subclassing 2019-10-12 13:44:03 +01:00
Nikolaus Waxweiler
b54e11c1a5 Remove conditional to use built-in types by default 2019-10-12 13:40:48 +01:00
Nikolaus Waxweiler
c67a2e5ff0 Remove more legacy imports 2019-10-12 13:26:59 +01:00
Nikolaus Waxweiler
2acb1de6c9 Remove unicode import 2019-10-12 13:22:31 +01:00
Nikolaus Waxweiler
fb07ab1d8f Remove PY2-era re.ASCII reference 2019-10-12 12:24:16 +01:00
Nikolaus Waxweiler
b0afdc273e Remove singledispatch import conditional 2019-10-12 12:20:06 +01:00
Nikolaus Waxweiler
969df8303b Remove some Python 2 era import gaming 2019-10-11 22:36:33 +01:00
Cosimo Lupo
86793f2617
psCharStrings: use floatToFixedToStr and strToFixedToFloat in T2CharString.toXML and fromXML
Also, toXML signature must contain ttFont=None keyword argument, like
the rest of toXML methods elsewhere.
2019-10-08 13:40:03 +01:00
Cosimo Lupo
6fd31d47ec
fixedTools: use simple divison in fixedToFloat; add floatToFixedToStr, strToFixedToFloat, etc.
Fixes #737
2019-10-08 13:40:03 +01:00
Nikolaus Waxweiler
01328213c7 Remove __future__ imports 2019-08-09 12:20:13 +01:00
Nikolaus Waxweiler
ab45b3b0c1 Pare down py23 module to Python 3 symbols only, deprecate 2019-08-09 11:30:39 +01:00
Cosimo Lupo
160a9cb238
fix doctest calling configLogger causing flakiness of other tests
since we use pytest-randomly to randomize the test execution, depending on when
this specific test is executed, it may have the side effect of configuring
the global logging configuration, causing other tests that capture logging
messages to fail.

E.g. see https://travis-ci.org/fonttools/fonttools/jobs/545680550
2019-06-14 11:50:07 +01:00
Cosimo Lupo
1fc1d2f529
[loggingTools] remove unused backport of LastResortLogger
we are not in the business of logging.
2019-06-11 13:39:59 +01:00
Read Roberts
5b3db36670
Sparse cff2vf support (#1591)
* Added getter (in the form of a property decorator) for T2Charstring.vsindex. Fixes endless compile loop in some circumstances.

Fixed bug in mutator: need to remove vsindex from snapshotted charstrings, plus formatting clean up

* Fix for subsetting HVAR tables that have an AdvanceWidthMap when the --retain-gid option is used. Needed to make subset_test.py::test_retain_gids_cff2 tests pass.

* in varLib/cffLib.py, add support for sparse sources, and sources with more than one model, and hence more than one VarData element in the VarStore.

CFF2 source fonts with multiple FontDicts in the FDArray need some extra work. With sparse fonts, some of the source fonts may have a fewer FontDicts than the default font. The getfd_map function() builds a map from the FontDict indices in the default font to those in each region font. This is needed when building up the blend value lists in the master font FontDict PrivateDicts, in order to fetch PrivateDict values from the correct FontDict in each region font.

In specializer.py, add support for CFF2 CharStrings with blend operators. 1) In generalizeCommands, convert a blend op to a list of args that are blend lists for the following regular operator. A blend list as a default font value, followed by the delta tuple. 2) In specializeCommands(), convert these back to blend ops, combining as many successive blend lists as allowed by the stack limit.

Add test case for sparse CFF2 sources.
The test font has 55 glyphs. 2 glyphs use only 2 sources (weight = 0 and 100). The rest use 4 source fonts: the two end points of the weight axis, and two intermediate masters. The intermediate masters are only 1 design space unit apart, and are used to change glyph design at the point in design space. For the rest, at most 2 glyphs use the same set of source fonts. There are 12 source fonts.

Add test case for specializer programToCommands() and commandsToProgram by converting each CharString.program in the font to a command list, and back again, and comparing original and final versions.
2019-04-26 09:33:52 -07:00
Cosimo Lupo
80306037b7
arrayTools: calcIntBounds should use otRound, not round3
Somehow we forgot to replace round -> otRound in arrayTools.calcIntBounds.
This function is used by glyf table to compute the glyphs' bounding boxes.
We already use otRound (aka 'int(math.floor(v + .5))') to round glyph
coordinates upon compiling glyf table. So the use of python3's round
in calcIntBounds was producing inconsistent roundings between the glyph
coordinates and the glyph bbox (sometimes, i.e. only when the glyf table
contains float coordinates, e.g. after instantiating with varLib.mutator).
2019-04-04 12:38:54 +01:00
Miguel Sousa
ddff29cb5d Fix DeprecationWarning: invalid escape sequence 2019-04-01 14:04:14 -07:00
justvanrossum
20c93b9fdb use RecursionError, and provide an alias for RuntimeError for Py2 2019-03-17 18:18:10 +01:00
Cosimo Lupo
1fd11a3a0a psCharStrings: replace sys.stderr.write with log.warning 2019-03-12 11:43:10 +00:00
justvanrossum
d897a08fc8 more updated issue URLs 2019-03-06 16:52:35 +01:00