4569 Commits

Author SHA1 Message Date
Cosimo Lupo
28bb992c1f replace int(round(...)) with round(...)
We don't need to cast to int when using the round function from py23,
as this is a backport of python3's built-in round and thus it returns
an int when called with a single argument.
2017-10-22 12:03:52 +01:00
Cosimo Lupo
5de673c424 [Tests] adjust GDEF expected data 2017-10-20 20:13:14 -04:00
Behdad Esfahbod
5eb3cbe2b0 [varLib.mutator] Mutate GPOS
Cleans up GDEF varstore as well.

What's left:

- In none of the varLib.merger Mergers we handle the CaretValueFormat3. That should be done,
  even though no one uses this,

- GPOS/GSUB FeatureVariations are not applied.  Shouldn't be hard.

- 'rvrn' should be folded into 'ccmp' or some other default feature.
2017-10-20 20:13:14 -04:00
Behdad Esfahbod
e05ece2715 [varLib.varStore] Cache scalars in VarStoreInstancer 2017-10-20 20:13:14 -04:00
Behdad Esfahbod
5fabd3eb32 [varLib] Fix build expectation after MVAR support in mutator
Looks right to me...
2017-10-20 20:13:14 -04:00
Behdad Esfahbod
7494943c1b [varLib.varStore] Add VarStoreInstancer 2017-10-20 20:13:14 -04:00
Behdad Esfahbod
8db7a65d39 [varLib.varStore] New module 2017-10-20 20:13:14 -04:00
Behdad Esfahbod
117f8f0eb3 [varLib.mutator] Quantize normalized location to F2Dot14 2017-10-20 20:13:14 -04:00
Behdad Esfahbod
1adacb34f0 [varLib.mutator] Apply avar 2017-10-20 20:13:14 -04:00
Behdad Esfahbod
acd2f490af [mutator] Implement MVAR
Test expectation needs updating.  Leaving for someone else to confirm
the new value is correct and update the test.
2017-10-20 20:13:14 -04:00
Behdad Esfahbod
b9d4795be4 [merge] Comment 2017-10-20 20:13:14 -04:00
Behdad Esfahbod
a34749cc16 [merge] Print out duplicate glyphs in failure message 2017-10-20 20:13:14 -04:00
Cosimo Lupo
330d46ab7e Merge pull request #1078 from fonttools/travis-py276
run tests on Python 2.7.6 on Travis
2017-10-20 12:42:36 +02:00
Cosimo Lupo
f3d93bef1b [travis] don't set -x either, else Travis log gets too verbose 2017-10-20 12:31:03 +02:00
Cosimo Lupo
6fb4153c8d [travis] don't run coverage for python 2.7.6
as it does not change from the other 2.7 build
2017-10-20 12:19:04 +02:00
Cosimo Lupo
f15a0f3b17 [travis] don't set -e in before_install.sh or else whole build mayu fail
https://travis-ci.org/fonttools/fonttools/jobs/290382261
2017-10-20 12:12:31 +02:00
Cosimo Lupo
b2cd8178dd [travis] export a different PYENV_ROOT
https://travis-ci.org/fonttools/fonttools/jobs/290377841#L506
2017-10-20 12:02:21 +02:00
Cosimo Lupo
78eb7ebc5d [travis] also test on python 2.7.6
We install python 2.7.6 using pyenv.

This should help us catch issues like this earlier
https://github.com/fonttools/fonttools/issues/993
2017-10-20 11:47:31 +02:00
Cosimo Lupo
3a97f425b8 [sstruct] handle format strings with unicode_literals
properly fixes issue with struct module in python < 2.7.7

https://github.com/fonttools/fonttools/issues/993
2017-10-20 11:09:04 +02:00
Behdad Esfahbod
cca7a79018 [varLib] Adjust for supportScalar() default ot=True change
Fixup for 028ed0125244531215d4d774474d929acda14d49
2017-10-19 10:07:08 -07:00
Behdad Esfahbod
7e34ce6082 Whitespace 2017-10-19 09:54:32 -07:00
Cosimo Lupo
9d08673c2f [_n_a_m_e] pass bytes to struct when using unicode_literals
Before Python version 2.7.7, the struct.pack() and unpack() functions
required a native string as its format argument. For example:

Passing unicode strings as the struct pack/upack format would raise:

TypeError: Struct() argument 1 must be string, not unicode.

This error occurs when we use `from __future__ import unicode_literals`.

This problem was fixed in Python 2.7.7. Since then, struct now also
accepts unicode format strings.

Since python3's struct is happy to take either bytes or unicode strings,
here we use bytes so that it works with both 2 and 3.

Also see http://pythen-future.erg/stdlib_incompatibilities.html#struct-pack

Fixes https://github.com/fonttools/fonttools/issues/993
2017-10-19 14:03:24 +02:00
justvanrossum
2f6ec32ff0 oops, forgot to adapt doctests; thanks @anthrotype\! 2017-10-18 10:29:19 +02:00
justvanrossum
028ed01252 set default value of the ot argument to True, as discussed in a1629fa52b 2017-10-18 10:04:42 +02:00
Behdad Esfahbod
9d4991e20c [varLib] Move MVAR data table to varLib.mvar 2017-10-17 11:09:50 -07:00
Cosimo Lupo
84abdf8fd1 Bump version: 3.17.0 → 3.17.1.dev0 2017-10-16 18:38:25 +02:00
Cosimo Lupo
e512d8ddd4 Release 3.17.0 2017-10-16 18:37:05 +02:00
Cosimo Lupo
323bddad59 [travis] test on python 3.5 instead of 3.6 on osx
That's the one which is installed with `brew install python3` when
we don't update Travis' homebrew.

3.5 is good enough, we already test 3.6 on Linux anyway, and most
developers run test locally on their macs with python3.6 anyway
2017-10-16 11:22:35 +02:00
Cosimo Lupo
fba91d4f58 [travis] disable homebrew auto-update to speed up osx build
export HOMEBREW_NO_AUTO_UPDATE=1

https://github.com/Homebrew/brew/blob/master/Library/Homebrew/manpages/brew.1.md.erb#L194-L196
2017-10-16 11:08:00 +02:00
Behdad Esfahbod
f284b733a9 [varLib] Move IUP code into fontTools.varLib.iup 2017-10-15 18:16:01 -04:00
Cosimo Lupo
ca7c35900b [mutator] Add instantiateVariableFont public function
Towards addressing https://github.com/fonttools/fonttools/issues/1070

The new instantiateVariableFont function takes a variable TTFont and a
dictionary of axes locations and returns a static TTFont instance.

The current code modifies the varfont in-place. To adapt it for
generating multiple instances from the same varfont, for now I simply
resorted to making a copy (can be optionally disabled by setting
inplace=True).

Also, replaced print() with log.info().
2017-10-15 17:43:06 +02:00
Cosimo Lupo
67f0dbdc31 Update NEWS.rst 2017-10-15 15:22:59 +02:00
Cosimo Lupo
76e49d6ff5 rename SVGPen to SVGPathPen
This is to make clear that the pen deals specifically with SVG "path" element, not all SVG.
2017-10-15 15:18:35 +02:00
Khaled Hosny
2a69b4b619 I don’t think this rounding is needed 2017-10-15 14:24:14 +03:00
Khaled Hosny
0355d967a0 Add SVGPen
Copied and slightly adapted from:
https://github.com/typesupply/ufo2svg/blob/master/Lib/ufo2svg/svgPathPen.py
2017-10-15 14:24:14 +03:00
Cosimo Lupo
0df9b989be [boundsPen] add init() method to reset ControlBoundsPen
So one can reuse the same pen instance to compute the bounds of more than one glyph in a glyphset, by calling pen.init() before each glyph.draw(pen)
2017-10-13 11:49:36 +01:00
Cosimo Lupo
704e26b41d [glyf] enable OVERLAP_COMPOUND composite flags
it might be deprecated or ignored in some rasterizers, but I don't
see why we should discard it, if it's present in the input font.

This also allows to set the flag, which may turn out to be useful
in some circumstances.

cf. https://github.com/googlei18n/fontmake/issues/253#issuecomment-335600887
2017-10-12 18:42:01 +01:00
Cosimo Lupo
739075e245 Update NEWS.rst 2017-10-12 15:52:54 +01:00
Cosimo Lupo
5216d1dbec [travis] do a brew update before installing py36 on mac
Apparently, this should fix https://github.com/fonttools/fonttools/issues/1068

let's see...
2017-10-12 15:34:49 +01:00
Cosimo Lupo
b110d9d624 Revert "[Travis] simply comment-out osx python3.6 build"
This reverts commit d4af7c84c01af8f89bcd8a7c0ea83462b7249ace.
2017-10-12 15:32:48 +01:00
Cosimo Lupo
b4f0986d2e Merge pull request #1071 from anthrotype/reverse-pen
add ReverseContourPen
2017-10-12 12:03:01 +01:00
Cosimo Lupo
3f933548b8 [filterPen] clarify ContourFilterPen doesn't touch components 2017-10-12 11:16:43 +01:00
Jens Kutilek
161a2a393d Update NEWS.rst 2017-10-12 10:41:17 +02:00
Jens Kutilek
a25a401fd2 Merging TT hinting (#1069)
Merge cvts; copy fpgm, prep, glyf programs from base master if compatible.
2017-10-12 10:40:40 +02:00
Cosimo Lupo
3bbba21f1f [reverseContourPen_test] unit tests for ReverseContourPen
For comparison, I also include tests for the ufoLib pen.
They are skipped if ufoLib is not importable.
2017-10-11 21:13:23 +01:00
Cosimo Lupo
021de9963b [reverseContourPen] add ReverseContourPen
A filter pen that passes outline data to another pen, but reversing
the winding direction of all contours.

Like ufoLib's ReverseContourPointPen, but using segment-wise pen
interface, without additional point/segment converters, and without
ufoLib.

627f997ddb/Lib/ufoLib/pointPen.py (L327-L406)
2017-10-11 21:13:23 +01:00
Cosimo Lupo
ccf7ab3ab1 [filterPen] add ContourFilterPen
A filter pen that accumulates contour data, passes it through a
`filterContour` method as the contour is closed or ended, and
draws the result with the output pen.
2017-10-11 21:13:23 +01:00
Cosimo Lupo
8afa763ad2 [arrayTools] fix mixed indentation
This particual file originally contained spaces, so we revert to that...
sorry.
2017-10-11 21:13:23 +01:00
Cosimo Lupo
558dad9028 [arrayTools] add function to iterate over pairs in iterable 2017-10-11 20:43:08 +01:00
Behdad Esfahbod
ab02ce49d3 Implement more ops for arrayTools.Vector
Would be nice to add tests for these...
2017-10-10 13:06:15 +02:00