3171 Commits

Author SHA1 Message Date
Cosimo Lupo
7adfe98690 [_v_m_t_x_test] add test for vmtx table (simply inherits from hmtx one) 2016-10-14 18:35:33 +01:00
Cosimo Lupo
f6b951c6da [_h_m_t_x_test] add test module for hmtx table compiler/decompiler 2016-10-14 18:35:33 +01:00
Cosimo Lupo
115993216a [_h_m_t_x] use list() instead of tuple() in __setitem__
This is for consistency with the way the hmtx `decompile` method already worked.
2016-10-14 18:35:33 +01:00
Cosimo Lupo
2839145c05 [_h_m_t_x] log glyph names with negative advances upon compile; re-raise struct.error as TTLibError with nicer message 2016-10-14 18:35:33 +01:00
Cosimo Lupo
ca6beadd22 [_h_m_t_x] warn if hhea.numberOfHMetrics > maxp.numGlyphs
the comment said "We warn later" but that's not true.
2016-10-14 18:35:33 +01:00
Cosimo Lupo
c8901bf940 [tox] remove unneeded print statements
This information is already displayed by pytest in the header of the test run output
2016-10-14 18:35:33 +01:00
Cosimo Lupo
ce313520cf [tox] use --pyargs fontTools to run tests against package installed in tox env instead of source dir
This will ensure we don't forget to add any data files to the MANIFEST.in (which means test data is not available to the inlined tests).

{posargs} allows to pass extra arguments to the test runner, when runing `tox -- {posargs}` from the command line.

With `--pyargs` option, pytest tries to interpret arguments as python package/module names, and if import fails as regular filesystem paths.
2016-10-14 18:35:33 +01:00
Cosimo Lupo
b1846201ba [_h_m_t_x] set longMetricFormat='Hh' as class attribute
In theory this could be overridden with the old 'hh' struct format, though I wouldn't recommend it.
2016-10-14 18:35:33 +01:00
Cosimo Lupo
1d545b8f91 [_h_m_t_x] Read advanceWidth as unsigned short (uint16); warn on decompile if exceeds 0x7FFF; raise on compile if negative
struct.pack will raise with `argument out of range` when trying to compile a negative integer as unsigned "H".
2016-10-14 18:35:33 +01:00
Cosimo Lupo
8351600bc6 Merge pull request #707 from anthrotype/travis-osx
[Travis] try to speed up osx builds a bit
2016-10-14 18:30:28 +01:00
Cosimo Lupo
30799bb6df [travis] also drop 3.4 for OSX; only run 2.7 and 3.5 2016-10-14 18:07:17 +01:00
Cosimo Lupo
941234c93d [travis] test on latest PyPy 5.4.1 2016-10-14 17:43:05 +01:00
Cosimo Lupo
e4a3d4aba4 [travis] don't test on OSX pypy any more
I believe it's enough to test pypy implementation only on Linux.
We don't really need to also test it in on OSX, as fonttools is a pure python project so it should just work there as well.
Travis CI has just become too slow...
2016-10-14 17:41:22 +01:00
Cosimo Lupo
f6362b0ebf Revert ".travis.yml: also test with built-in Python 2.7 on OSX 10.11"
This reverts commit a63e1ed5d37797ee361b0a23d09bf8a03aaee23d.

The default OSX Travis worker is now osx10.11-xcode7.3 so we don't need to separately test the latter as it's now default.

Also, since the OSX are getting quite slow lately, we can't afford to test two different python2.7 on OSX; so from now on we just test the system Python 2.7.11 that comes with El Capitan (so no more 2.7.5 on Mavericks).
2016-10-14 17:31:16 +01:00
Behdad Esfahbod
72f5cb8579 Fixup 2016-10-13 15:59:25 -07:00
Behdad Esfahbod
3872e3ba3b Revert "remove 'fontTools' symbolic link in Snippets as not cross-plaftorm"
This reverts commit d2e73ca1abf37eaa65a870851cb8427cb6541131.

Even if not cross-platform, this provides useful functionality on Linux and
Mac.
2016-10-13 15:47:49 -07:00
Behdad Esfahbod
37dbb77c67 Make varLib module callable 2016-10-13 15:43:19 -07:00
Behdad Esfahbod
4158b54244 Make subset module callable 2016-10-13 15:42:14 -07:00
Behdad Esfahbod
b39772b256 [varLib] Fix interpolate_layout for non-similar SinglePos
Has to be ported to varfont merger as well.
2016-10-12 16:11:20 -07:00
Behdad Esfahbod
b9c38af1ff Disable HVAR generation until I fix it
https://github.com/fonttools/fonttools/issues/705
2016-10-12 13:30:52 -07:00
Cosimo Lupo
850293a30a Merge pull request #700 from fonttools/versioneer+bumpversion
version
2016-10-12 11:57:10 +01:00
Sascha Brawer
f5b31db578 [fvar] Omit optional PostScript name when missing; improve tests
If a named instance has a PostScript name, the name is now printed as
a comment into the XML dump. Also, unit tests on `fvar` are now
exercising all code paths, both with and without PostScript names.
2016-10-12 10:58:41 +02:00
Behdad Esfahbod
12d4f277d7 [varLib.merger] Towards supporting merging individual attributes 2016-10-11 20:39:22 -07:00
Cosimo Lupo
f136bfe844 dev-requirements.txt: use bumpversion (fork with annotated tags support) 2016-10-12 00:49:57 +01:00
Cosimo Lupo
b94598e08b setup.cfg: add versioneer and bumpversion configurations
I had to remove the comments because bumpversion will strip them out anyway upon re-writing the updated version string in setup.cfg file.
Similarly, I had to normalize the whitespace like bumpversion would do. :-/

`tag=True` option means a tag is automatically created when bumping the version with bumpversion script.
However, in order to get 'annotated' instead of 'lightweight' tags -- i.e. the tag also contains the tag author, date and message --, we need to (temporarily?) use a fork of bumpversion that includes an unmerged PR: https://github.com/peritus/bumpversion/pull/58
2016-10-12 00:49:57 +01:00
Cosimo Lupo
3acacb592d fontTools: use versioneer to get_versions(); if fails, print warning and fall back to latest known tag 2016-10-12 00:49:57 +01:00
Cosimo Lupo
6df7feb70d add back the MANIFEST.in for all the extra files in sdist
We need this as we no longer use setuptools_scm to retrieve the full list of files under version control.
Instead, we need to spell them out one by one.
Hopefully we don't forget anyone...
2016-10-12 00:49:54 +01:00
Cosimo Lupo
36cc2ed249 add .gitattributes file for versioning git archives (e.g. Github's 'download zip') 2016-10-12 00:40:12 +01:00
Cosimo Lupo
8bc5c6123c .gitignore: remove setuptools_scm 'version.py' 2016-10-12 00:40:06 +01:00
Cosimo Lupo
47cdb2a501 setup.py: use versioneer instead of setuptools_scm 2016-10-12 00:40:06 +01:00
Cosimo Lupo
48b566dc09 check-in auto-generated versioneer.py and _version.py files 2016-10-11 19:01:34 +01:00
James Godfrey-Kittle
5606f47c03 Merge pull request #691 from jamesgk/varlib-usability
varLib usability stuff
2016-10-10 15:20:03 -07:00
Cosimo Lupo
c4c102950d Merge pull request #698 from anthrotype/write-to-version-py
Write version.py file with static string
2016-10-10 16:02:55 +01:00
Cosimo Lupo
b1fae3fe32 ttx/ttLib: use from fontTools import version as before 2016-10-10 15:26:04 +01:00
Cosimo Lupo
7223536d7d fontTools.__init__: restore fontTools.version for backward compatiblity
See https://github.com/fonttools/fonttools/issues/697#issuecomment-252622588
2016-10-10 15:20:07 +01:00
Cosimo Lupo
10b30b954a .gitignore: add Lib/fontTools/version.py
We no longer need to check this file in the repository, as it is generated upon installtion from the git metadata by setuptools_scm
2016-10-10 15:11:55 +01:00
Cosimo Lupo
6b152f57ae generate 'version.py' file with plain version string instead of using pkg_resources to read version from package metadata
See https://github.com/fonttools/fonttools/issues/697#issuecomment-252621005
2016-10-10 15:06:11 +01:00
Cosimo Lupo
c719da5bca [sstruct/xmlWriter]: issue a deprecation warning when the two top-level modules are imported
Part of #696

(These are a actually `UserWarning` instead of `DeprecationWarning`, as the latter are normally muted)
2016-10-08 17:21:36 +01:00
Cosimo Lupo
8a7b245069 Merge pull request #695 from htgoebel/patch-1
Remove extra_path distribution kwarg
2016-10-08 14:33:58 +01:00
Hartmut Goebel
f8982ac952 Remove extra_path distribution kwarg
This is of no use, it is undocumented and bound to be removed.

See https://bugs.python.org/issue901727 and https://bugs.python.org/issue27919.
2016-10-08 15:10:02 +02:00
James Godfrey-Kittle
1e8e17e753 [varLib] Define an interpolate_layout method 2016-10-06 17:33:07 -07:00
James Godfrey-Kittle
6f6106ef6c [varLib] Rename interpolate-layout to be loadable 2016-10-06 17:32:37 -07:00
Behdad Esfahbod
b5d7eb8fd4 [varLib] Show failure path when merging fails 2016-10-05 17:03:48 -07:00
Cosimo Lupo
53dce87b03 Merge pull request #688 from fonttools/fix-varlib-names
Fix varlib names
2016-10-05 19:23:10 +01:00
James Godfrey-Kittle
0682e77370 Merge pull request #690 from jamesgk/area-pen
Allow single-point open contours in area pen
2016-10-04 18:05:43 -07:00
Behdad Esfahbod
87e07bc4c4 [varLib] Add kerning merger for interpolate-layout.py 2016-10-04 17:46:22 -07:00
James Godfrey-Kittle
c732ffce8e [areaPen] Add test for endPath 2016-10-04 17:33:16 -07:00
James Godfrey-Kittle
238e8cbc52 Typo 2016-10-04 17:32:49 -07:00
James Godfrey-Kittle
870b7ce92a Allow single-point open contours in area pen
Sometimes an anchor is drawn as a moveTo followed by an endPath, for
that case it makes sense just to ignore and count the area as zero.
2016-10-04 16:27:09 -07:00
Cosimo Lupo
79d755a837 [varLib] use both Macintosh and Windows names for fvar names; use addName method from _n_a_m_e.NameRecord; use unicode_literals
We must coerce name strings with `tounicode` because, on Python 2, the ElementTree library that we use to parse the designspace's XML will return ASCII-encoded `bytes` (PY2 `str`) whenever it can; and only returns `unicode` (PY3 `str`) when strings can't be encoded as ASCII... :(
However the `addName` method requires unicode strings (it wouldn't be able to encode them with multiple platform-specific encodings otherwise).
So we decode bytes as ASCII before passing them to addName.
2016-10-04 17:08:29 +01:00