3425 Commits

Author SHA1 Message Date
Cosimo Lupo
f38cde159b
py23: in Python3 < 3.6, round3 wraps built-in round() to workaround inconsistent behaviour between floats/ints and ndigits=None 2016-12-02 12:15:47 +00:00
Cosimo Lupo
6775add8b0
Bump version: 3.2.2 → 3.2.3 2016-12-02 10:19:36 +00:00
Cosimo Lupo
3e03d6061e
updated changelog for 3.2.3 2016-12-02 10:09:35 +00:00
Cosimo Lupo
9d8dacbedc Merge pull request #755 from anthrotype/round3-optimize
[py23] further optimizie round3 function
2016-12-01 22:04:56 +00:00
Cosimo Lupo
eb8654dc4e
py23: move import decimal to top-level scope 2016-12-01 17:43:35 +00:00
Cosimo Lupo
7abd4d281c
py23_test: minor whitespace 2016-12-01 17:24:01 +00:00
Cosimo Lupo
2fbf371232
py23_test: add unit tests for isclose() backport 2016-12-01 17:13:09 +00:00
Cosimo Lupo
b09501fd8b
py23: only use the slow round3 implementation for half-way, even cases; add backport of py35 math.isclose() 2016-12-01 17:12:20 +00:00
Adrien Tétar
2df7241f9c Merge pull request #754 from fonttools/round3-optimize
[py23] optimize round3 function
2016-11-30 20:20:37 +01:00
Cosimo Lupo
63621b347d
py23_test: in round2/round3, drop support for ndigit with __index__ attribute; add test for when a number is already an integer 2016-11-30 13:01:20 +00:00
Cosimo Lupo
f742ea07e8
py23: in round3, avoid rounding if number is already int; return the same type when called with two args
We only define 'round3' for PY2 and 'round2' for PY3, and also make sure 'round3' is always an alias of
the built-in 'round' on Python 3; and similarly 'round2' is an alias of built-in 'round' on Python 2.

Thus, for clarity, one can do:

    from fontTools.misc.py23 import round3 as round

or

    from fontTools.misc.py23 import round2 as round

and be certain that the fast built-in implementation will be used on the
respective python major version.
2016-11-30 12:58:58 +00:00
Cosimo Lupo
5de665fffe Merge pull request #752 from fonttools/subset-non-bmp
[subset] workaround for "narrow" py2 builds and --text= option
2016-11-29 18:38:37 +00:00
Cosimo Lupo
16d0e5e8ad
subset: workaround for narrow py2 builds when iterating over non-BMP chars in unicode string
Fixes https://github.com/fonttools/fonttools/issues/750
2016-11-29 15:49:05 +00:00
Cosimo Lupo
99307e8991
subset_test: unit tests for subsetting non-BMP characters with --text/--text-file options 2016-11-29 15:45:07 +00:00
Cosimo Lupo
bcd4268442
subset/testdata: add a version of TestTTF-Regular.ttx containing an additional non-BMP character, U+1F6D2 2016-11-29 15:42:51 +00:00
justvanrossum
e5d2d49900 two more doctests 2016-11-29 14:42:20 +01:00
justvanrossum
8fa2ee1d95 Do the capping before calculating the normalized value to avoid ZeroDivisionError when default == lower or default == upper. Added doctests to verify. Fixes #749 2016-11-29 14:38:46 +01:00
Parag Nemade
167ee6041e Make inspect.py file compatible to run with python2 and python3 (#748)
Signed-off-by: Parag A Nemade <pnemade@fedoraproject.org>
2016-11-28 07:33:24 -06:00
Cosimo Lupo
fd77eff51e Merge pull request #747 from moyogo/appveyor
appveyor: latest setuptools fixed
2016-11-27 10:17:36 +00:00
moyogo
c81d213a84 appveyor: latest setuptools fixed 2016-11-27 10:00:13 +00:00
justvanrossum
f713c93340 made warning even more specific 2016-11-26 14:05:23 +01:00
justvanrossum
7eff97e08b made warning more specific 2016-11-26 14:05:23 +01:00
justvanrossum
4a5c838b5b Improve the warnings issued when 'useless' FontDict key/value pairs are provided either by an OTF, or a TTX file; It now warns reliably in both those cases. 2016-11-26 14:05:23 +01:00
justvanrossum
ce73bba3f3 use log.warning() instead of log.log(logging.WARNING, ...) 2016-11-26 14:05:23 +01:00
justvanrossum
cce31c9950 Also warn when keys are ignored upon compile. 2016-11-26 14:05:23 +01:00
justvanrossum
8d22c39d0b Output an XML comment with the keys that were ignored; Added references to the other issues involved. 2016-11-26 14:05:23 +01:00
justvanrossum
f9d265d1e6 This commit fixes #740.
Commits 3063def and 5b47971 introduced a separate fontDictOperators list for FontDict, only listing those TopDict key/value pairs that are actually used in the FontDict context. It provided a fallback that TTX files containing such "useless" key/value pairs would not be rejected.

However, the code still rejected binary fonts that contained such values, even though it didn't before, and yes, such fonts exist. Also: such fonts are not broken per spec, they just contain some fields that otherwise no one ever looks at, so it's a little harsh to reject them.

This patch removes most of the special FontDict code, and uses everything from TopDict, *except* the order attribute: it sets that to a list of the relevant keys for the FontDict. The effect of this is that "useless" key/value pairs are ignored, not just upon reading XML, but also upon decompilation and compilation of binary fonts. It improves on the previous XML reading behavior in that it no longer silently ignores key typos in the TTX input.

Ideally, we would *output* everything that is actually in the FontDict to TTX, and only ignore the values when compiling, but I didn't find a clean solution for that, so I decided to just fix the issue.
2016-11-26 14:05:23 +01:00
moyogo
ea92dd75f1 appveyor: use setuptools==28.8.0 since 29.0.0 doesn’t install cli-{32,64}.exe and other binaries 2016-11-26 09:38:41 +00:00
Cosimo Lupo
400e8e8dd0
Bump version: 3.2.1 → 3.2.2 2016-11-24 17:19:58 +00:00
Cosimo Lupo
403d05d822
update changelog for 3.2.2 2016-11-24 17:19:36 +00:00
Just van Rossum
cae8916f06 Merge pull request #742 from mashabow/patch-1
Fix "Private Use (plane 15)" range
2016-11-21 07:05:38 +01:00
Masaya Nakamura
08a0d550db Fix "Private Use (plane 15)" range
https://twitter.com/ken_lunde/status/796564061206913024
https://www.microsoft.com/typography/otspec/errata.htm
2016-11-21 11:26:57 +09:00
Behdad Esfahbod
78d3cbea57 [subset] Fix subsetting MathVariants
Was failing on Caudex-Regular.ttf for example.
2016-11-11 10:58:02 -08:00
Behdad Esfahbod
25083502e4 [perimeterPen] Update check for cusps
If p1 coincides with p0 or p2, we still can use the lineTo()
code.
2016-11-08 16:39:38 -08:00
Behdad Esfahbod
7915a45ddf [varLib] Handle fonts without GPOS
Fixes https://github.com/fonttools/fonttools/issues/699
2016-11-08 15:44:39 -08:00
Behdad Esfahbod
a11bc5655d [merge] Ignore LangSys if None
Fixes https://github.com/fonttools/fonttools/issues/739
for now, though proper fix is more complicated.

This was hit now because the subsetter was changed a while back
to retain script systems even if empty...  I don't like that.
2016-11-08 14:06:50 -08:00
Behdad Esfahbod
4868a631b9 [Snippets/interpolatable] Improve error reporting
Also enable full vector.  It's necessary for accurate report.
2016-11-07 20:30:57 -08:00
Cosimo Lupo
86207144ae Merge pull request #736 from robmck-ms/master
[varLib] Do not emit null axes in fvar (default==min==max)
2016-11-05 12:51:46 +00:00
Rob McKaughan
1bebcec00d Do not emit null axes in fvar (default==min==max) 2016-11-04 14:53:43 -07:00
Cosimo Lupo
66d847e365
Update changelog for 3.2.1 2016-11-03 14:32:15 +00:00
Cosimo Lupo
6e0b952441
Bump version: 3.2.0 → 3.2.1 2016-11-03 14:21:51 +00:00
Cosimo Lupo
c66a2bc327
Bump version: 3.1.2 → 3.2.0
I had forgotten to bump the version for 3.2.0... Sorry :(

This is not a problem for the released packages, since versioneer correctly writes the tagged version.
It's only the hard-coded version string that's used as a fallback if git fails to compute the version which I forgot to update.
2016-11-03 14:21:51 +00:00
Cosimo Lupo
c653e1408c Merge pull request #734 from moyogo/revert-OS2
Fix "OS/2: fsSelection bits 0 and 5 should match head.macStyle bits 1 and 0"
2016-11-03 13:35:49 +00:00
moyogo
acfb137881 OS2/2: fix checking fsSelection bits matching head.macStyle bits 2016-11-03 11:37:00 +00:00
Cosimo Lupo
df967e70fc
varLib: rename --buildHVAR option to --build-HVAR; add 'build_HVAR=False' kwarg to 'build' function
better not having to pass an argparse.Namespace object to varLib.build
2016-11-03 10:59:00 +00:00
Rob McKaughan
bdbb8c5374 Add commandline switch to build HVAR 2016-11-02 20:54:50 -07:00
Cosimo Lupo
49268c8ab8 Merge pull request #732 from anthrotype/backslash-glyphs
[feaLib] support backslash-escaped glyphs in FEA
2016-11-02 16:16:44 +00:00
Cosimo Lupo
3933a16dd1
Update changelog 2016-11-02 16:10:34 +00:00
Cosimo Lupo
3b1e0bdc47
[feaLib.builder_test] fix up tests for backslash-escaped glyph names 2016-11-02 16:01:35 +00:00
Cosimo Lupo
a0cc66bfc0
[feaLib.parser] strip initial backslash from glyph names
Fixes https://github.com/fonttools/fonttools/issues/457

Backslash-prefixed glyph name can be used in a Feature file to distinguish them from identically-named keywords.

From section "2.f.i. Glyph name" of Adobe's Feature File Specification:

> An initial backslash serves to differentiate a glyph name from an identical keyword in the feature file language. For example, a glyph named "table" must be specified in the feature file as: \table

Thus, when we parse a glyph name that begins with a backslash, we need to ignore the first character.

Note that makeotf rejects feature files with glyph names that start with or contain backslashes, even when escaped with another backslash.

feature liga {
    sub \\glyphWithBackslash by A;
} liga;

This yields:

    makeotfexe [FATAL] <Backslash-Regular> invalid token (text was "\") [features 2]
2016-11-02 16:01:21 +00:00