43 Commits

Author SHA1 Message Date
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
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
e22453c933 followup to #1531 2019-03-06 16:47:16 +01:00
Sascha Brawer
6a7e299c09 Fix “DeprecationWarning: invalid escape sequence” in Python 3.7 2019-01-22 16:36:15 +01:00
Rasmus Andersson
4c72b8f781 Change precision to 8 digits to match AFDKO 2019-01-05 11:06:59 -08:00
Rasmus Andersson
768f8ec171 Fixes bug in misc.psCharStrings.encodeFloat and adds test 2019-01-04 15:48:14 -08:00
Nikolaus Waxweiler
3b2bfcf29a Treat Mapping objects as dicts 2018-12-13 15:44:25 +00:00
Cosimo Lupo
081b0fc090
keep fontTools.ufoLib.plistlib compatibility shim
the old readPlist, writePlist are only kept in fontTools.ufoLib.plistlib,
not in fontTools.misc.plistlib
2018-10-18 11:11:34 +01:00
Cosimo Lupo
0cef799a08
move test_{etree,plistlib}.py to misc/{etree,plistlib}_test.py 2018-10-17 17:46:37 +01:00
Miguel Sousa
8d7774a3e8 [pscharstrings] Optimize the charstring's bytecode
by encoding as integers all float values that have no decimal portion.

This optimization is expected to reduce the file size of CFF2 fonts that have intermediate masters.

Related to https://github.com/adobe-type-tools/afdko/issues/444

Many thanks to @cjchapman for the help on the fixed point math
2018-06-29 09:54:00 -07:00
Cosimo Lupo
d9d30c819a
loggingTools: move here the LastResortLogger from py23
and add a small test
2018-06-19 16:54:50 +01:00
Cosimo Lupo
6473cc9349
add more tests for userNameToFilename function
plus minor whitespace
2018-02-28 12:26:52 +00:00
Bill Amidei
ccae4687cc
Moving userNameToFileName to its own file, adding unit test 2018-02-28 11:30:33 +00:00
Cosimo Lupo
232e2b8467
Revert "Merge pull request #1130 from anthrotype/temp-revert-split-glyphs"
This reverts commit 060f856f92e0fb2d8e60f6be080c89c08528bacb, reversing
changes made to 1e42224af741fac73e20f7193d8115cfda7d3594.
2018-02-28 11:24:19 +00:00
Behdad Esfahbod
4fec016862 [cff] Fix calcBound when seac-like components happen in endchar
I'm also unimpressed by the copy-pasted bounds logic in hhea and vhea,
and the fact that that's coded in there instead of calling a function
on CFF / glyf tables respectively.
2018-01-26 17:41:53 -08:00
Cosimo Lupo
56a84ae905 Temporarily revert PR #1035 bamidei/split_g_l_y_f_to_one_per_file
The split-glyf-to-one-glyph-per-file feature is only partially implemented,
as it was discussed here:

https://github.com/fonttools/fonttools/issues/153#issuecomment-346677171

I need to cut a bugfix release today, but I don't want to ship this as is.
I prefer to temporarily rever, tag a release from master branch, then
revert it again to its present state so that bamidei can complete his
work.

---

Revert "[glyf] make splitGlyphs output more compact"

This reverts commit d08d635a93289982b028aacd3b9039fbe742f3e8.

Revert "more whitespace"

This reverts commit bd030f61c6b360fd360632bbc6c19abb057c9a24.

Revert "minor whitespace"

This reverts commit f2a8c787b13b92ae0e0f61477e584316144747c7.

Revert "Merge pull request #1035 from bamidei/split_g_l_y_f_to_one_per_file"

This reverts commit 17b89d9dde7691dbbb6815efba92eff446af62ac, reversing
changes made to b8482d9666f08d3603ee93d3ca52931550f715fc.
2017-12-18 12:00:43 +00:00
Cosimo Lupo
bd030f61c6 more whitespace 2017-11-23 19:05:05 +01:00
Cosimo Lupo
f2a8c787b1 minor whitespace 2017-11-23 18:39:11 +01:00
Cosimo Lupo
17b89d9dde
Merge pull request #1035 from bamidei/split_g_l_y_f_to_one_per_file
Add ability to split glyphs to 1 glyph per ttx file.  Issue #153
2017-11-23 18:30:54 +01:00
Bill Amidei
818a4a2d1e Review comment update: Updated white-space and removed unused test data 2017-11-23 07:51:05 -08:00
Bill Amidei
de94613e08 Updates based upon review feedback for glyf to individual files; include table name in contentOnly file; Remove unnecessary parameters from toXML - leaving only the splitGlyphs optional additional parameter 2017-11-23 07:17:35 -08:00
Cosimo Lupo
d3251241be [py23] Add backports for redirect_stdout/stderr context managers 2017-11-07 11:54:28 +00:00
Bill Amidei
11bfd82854 Added xmlReader test for sub_file 2017-10-03 09:07:07 -07:00
Cosimo Lupo
2e4b1d05df [timeTools_test] use pytest.raises to catch ValueError 2017-10-02 14:19:01 +01:00
Khaled Hosny
4b3a2eb1d9 Respect SOURCE_DATE_EPOCH for time stamp
For reproducible builds, check the presence of SOURCE_DATE_EPOCH
environment variable and use it for the time stamp. This affects the
head.modified (and head.created in merge.py).

See https://reproducible-builds.org/specs/source-date-epoch/
2017-10-02 11:37:00 +02:00
Masaya Nakamura
3708f2c8d3 Don't cache charString bounds
https://github.com/fonttools/fonttools/pull/970#discussion_r117903692
2017-08-01 10:54:47 +09:00
Masaya Nakamura
a68bfc2458 [psCharStrings] Add recalcBounds() to T2CharString 2017-08-01 10:51:47 +09:00
Behdad Esfahbod
f056c124e5 [misc.classifyTools] Make classification order stable
Sets don't have a welldefined comparison function, so sort them...

Not the most efficient implementation, but good enough.

Fixes https://github.com/fonttools/fonttools/issues/927
2017-04-18 15:57:14 -07:00
Cosimo Lupo
cca1d20b0e
[loggingTools] added LogMixin class
This is useful to quickly add logging functionality to classes, and
to reduce boilerplate.

It adds a 'log' property to the class inheriting from it, which uses
logging.getLogger to get a logging.Logger (sigleton) object named after
<module>.<class> of self.
2017-04-11 18:40:52 +01:00
Cosimo Lupo
8df708269f
[loggingTools_test] give more time to TimerTest::test_split
timers can be capricious...

https://travis-ci.org/fonttools/fonttools/jobs/195116432#L1265-L1278
2017-01-25 10:07:09 +00:00
Cosimo Lupo
98013fe526
[loggingTools_test] don't assert exact clock times
Windows timer can be imprecise:
https://ci.appveyor.com/project/fonttools/fonttools/build/1.0.419/job/vlpd9qv07384w5sl
2017-01-17 14:12:14 +00:00
Cosimo Lupo
cf5807bb94
[Tests] covert transform doctests into transform_test.py 2017-01-17 13:39:36 +00:00
Cosimo Lupo
99a9cb901a
[Tests] covert timeTools doctests into timeTools_test.py 2017-01-17 13:39:36 +00:00
Cosimo Lupo
34474743f5
[Tests] covert textTools doctests into textTools_test.py 2017-01-17 13:39:36 +00:00
Cosimo Lupo
7a62f04adf
[Tests] covert py23 doctests to unittest and add to py23_test.py 2017-01-17 13:39:35 +00:00
Cosimo Lupo
29141af3a9
[Tests] convert loggingTools doctests into loggingTools.py 2017-01-17 13:39:35 +00:00
Cosimo Lupo
8b0130ccb3
[Tests] convert eexec doctests into eexec_test.py 2017-01-17 13:39:35 +00:00
Cosimo Lupo
f22722ae51
[Tests] convert classifyTools doctests into bezierTools_test.py 2017-01-17 13:39:35 +00:00
Cosimo Lupo
3e23cc7bd6
[Tests] convert bezierTools doctests into bezierTools_test.py 2017-01-17 13:39:34 +00:00
Cosimo Lupo
4973060af0
[Tests] convert arrayTools doctests into arrayTools_test.py 2017-01-17 13:39:34 +00:00
Cosimo Lupo
e1d340cc65
[Tests] use absolute imports and add __init__.py where relevant
We can't use relative imports any more since the tests are now located outside the package.

I had to add __init__.py to Tests/feaLib/ so that pytest does not get confused by the presence
of two test files with the same basename: i.e. Tests/feaLib/builder_test.py and Tests/feaLib/builder_test.py

https://github.com/pytest-dev/pytest/issues/774
http://stackoverflow.com/questions/12582503/py-test-test-discovery-failure-when-tests-in-different-directories-are-called
2017-01-16 09:14:13 +00:00
Cosimo Lupo
78ad48eaf3
Move all *_test.py modules and test data to external Tests/ folder 2017-01-16 09:14:12 +00:00