725 Commits

Author SHA1 Message Date
Bailey Parker
6f4e44f13d
Fixes #1675 - T1 eexec end finding spec compliance
The T1 spec (https://www-cdf.fnal.gov/offline/PostScript/T1_SPEC.PDF) on
page 14 says that:

> The text encrypted by eexec must be followed by 512 ASCII zeros. There may be
> white space characters (blank, tab, carriage return or line feed)
> interspersed among these zeros.

  * Add a failing test case with white space characters interspersed
    among the trailing zeros after the eexec

  * Fix eexec end finding so that it passes this new test case
2019-08-01 00:02:12 -04:00
Cosimo Lupo
5455517689
Merge remote-tracking branch 'origin/master' into partial-instancer 2019-07-31 15:22:48 +01:00
Miguel Sousa
e1f0d1ae09 varLib CFF fixes (#1653)
* varLib.cff: Apply conv_to_int() to all the values

* varLib: Don't hardcode file extension to 'ttf'

Also remove unused imports

* varLib.cff: Fix merging of sparse PrivateDict items

Fixes #1651
2019-06-24 17:10:36 -07:00
Cosimo Lupo
18f969ab7d
otlLib_test: convert to using pytest-style tests 2019-06-20 15:33:53 +01:00
Cosimo Lupo
e6b8897f18
instancer: reuse varLib.set_default_weight_width_slant function 2019-06-20 15:09:17 +01:00
Cosimo Lupo
1726a4a1fc
Merge remote-tracking branch 'origin/master' into partial-instancer 2019-06-20 15:05:34 +01:00
Cosimo Lupo
1122a2612b
varLib: add set_default_weight_width_slant
When building a variable font, varLib.build must make sure that
the OS/2.usWeightClass is equal to the wght axis default location,
that the OS/2.usWidthClass is set to the equivalent value (1-9) of
the wdth axis default location, and finally that post.italicAngle
is set to the same default value as slnt axis.

Sometimes the base master doesn't have these values correctly
set leading to discrepancies between OS/2 and post, on the one
hand, and the fvar axes' default values.
2019-06-20 12:23:33 +01:00
Cosimo Lupo
84e9ea167a
woff2: allow to recompress woff2 while keeping flavorData
optionally modifying the list of transformed tables
2019-06-19 12:13:14 +01:00
Cosimo Lupo
33fa149c31
subset: Add tests for --flavor option 2019-06-19 11:32:34 +01:00
Cosimo Lupo
6f1d25497a
Merge remote-tracking branch 'origin/master' into partial-instancer 2019-06-18 18:45:47 +01:00
Cosimo Lupo
93b303ffd3
Merge remote-tracking branch 'origin/master' into fix-singlepos-merge 2019-06-18 16:28:24 +01:00
Cosimo Lupo
3f60e732d5
unicodedata_test: update expected results after ucd 12.1 update 2019-06-18 16:28:07 +01:00
Cosimo Lupo
8c90878fcf
Merge remote-tracking branch 'origin/master' into fix-singlepos-merge 2019-06-18 15:38:10 +01:00
Cosimo Lupo
eda353c4c1
Merge pull request #1642 from fonttools/CFF2-fixes
Fixes merge bug when VF source have no blends or no marking glyphs in any charstrings.
2019-06-17 16:57:16 +01:00
Cosimo Lupo
00e054336f
Merge pull request #1639 from anthrotype/woff2-untransformed
[woff2] support hmtx transform + glyf/loca without transformation
2019-06-17 16:09:02 +01:00
Cosimo Lupo
3f6a381132
woff2_test: add tests for main() console entry point 2019-06-14 18:30:32 +01:00
Cosimo Lupo
c2ec989fcc
Merge pull request #1638 from madig/varLib-merge-kerning-correctly
varLib: Fix merging of class kerning tables
2019-06-14 16:26:07 +01:00
Cosimo Lupo
6777145f5b
Merge pull request #1644 from fonttools/Fix-CFF2-PrivateDict_bug
[varLib.cff] Fix important bug in merging CFF2 PrivateDicts.
2019-06-14 16:18:12 +01:00
Cosimo Lupo
a45af5d8db
minor: typos in comments [skip ci] 2019-06-14 16:06:04 +01:00
Cosimo Lupo
11bfc6856d
Merge remote-tracking branch 'origin/master' into partial-instancer 2019-06-14 11:31:30 +01:00
Cosimo Lupo
65b0609be1
remove redundant table__g_l_y_f.getCoordinates method
just use getCoordinatesAndControls
2019-06-14 11:17:37 +01:00
Cosimo Lupo
18efee2c7b
TupleVariation: rename get{DeltaType,CoordWidth}; do not special-case scalar=0
we still need to branch between the case where coordinates are wrapped in (x, y) tuples or naked floats.
2019-06-14 11:03:38 +01:00
Nikolaus Waxweiler
bcb0761202 Add test 2019-06-14 10:05:48 +01:00
Cosimo Lupo
8bd83f36bd
woff2_test: add tests for transformed hmtx and untransformed glyf+loca 2019-06-13 18:46:46 +01:00
ReadRoberts
cc3c928053 [varLib.cff] Fix important bug in merging FF2 PrivateDicts.
There was a bug that caused the PrivateDict of the first region to be used for all others.
2019-06-12 17:11:01 -07:00
ReadRoberts
dce80efc7c [varLib.cff] Add test case for CFF2 variable font with no markiing glyphs. 2019-06-12 16:45:08 -07:00
ReadRoberts
73501eda46 [varLib.merger] Add test data for merging GPOS SinglePos subtables 2019-06-12 14:32:25 -07:00
Cosimo Lupo
0162446f4c
woff2: don't normalize glyf+loca if we aren't transforming them
Also, the TTFont.getGlyphOrder() automatically makes up a dummy
glyph order from the maxp.numGlyphs, we simply need to ensure
'maxp' is decompiled before 'glyf'.

When transforming glyf, the glyf.glyphOrder is guaranteed to
be present (as the glyf table has been already decompiled), so
we don't need to deal with it being missing or incorrect
(hence removed spurious tests).
2019-06-12 18:41:13 +01:00
Cosimo Lupo
6b0e350a06
woff2_test: remove test for no longer reserved bits 6-7 2019-06-11 15:23:58 +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
Cosimo Lupo
9af92fdb41
woff2_test: fix up flaky tests
some tests were failing when shuffling the order of the tests with
pytest-randomly. That's because calling TTFont.getTableData method
on 'loca' table before having compiled 'glyf' returns an empty b""
string.
2019-06-11 13:22:38 +01:00
Cosimo Lupo
6ea99e4569
feaLib/builder_test: use CapturingLogHandler instead of assertLogs 2019-06-11 13:14:47 +01:00
Khaled Hosny
a56b1af2f6 [subset] Gracefully handle partial MATH table (#1635)
Both MathGlyphInfo and MathVariants can be None, so check for that first
before trying to access their methods.
2019-06-08 17:59:53 -07:00
Cosimo Lupo
9d895be4d5
instancer_test: add test for composite glyph without variations
We assert that the composite glyph's sidebearings and bbox are updated when its parent glyph
has changed.
The tests will fail, but a fix will follow shortly.
2019-06-06 13:33:57 +01:00
Cosimo Lupo
1722f99182
PartialInstancer-VF.ttx: add composite glyph and vhea table
the glyph 'minus' references 'hyphen' as component, but doesn't have any deltas in gvar.

vhea table is required when vmtx is present.
2019-06-06 13:30:21 +01:00
Cosimo Lupo
0abf6a8295
instancer_test: always dump test ttx files with '\n' 2019-05-31 20:08:50 +01:00
Cosimo Lupo
11b73034d7
instancer_test: read expected test file with unix newlines '\n'
or windows isn't happy..
2019-05-31 20:03:52 +01:00
Cosimo Lupo
8c3bfe5475
ttx: use caplog fixture instead of capsys
this capture logging messages whereas capsys captures stdout/stderr
2019-05-31 19:58:02 +01:00
Cosimo Lupo
499d97464d
instancer_test: use caplog fixture 2019-05-31 19:57:53 +01:00
Cosimo Lupo
3d5f5c0a36
Tests/conftest.py: disable fontTools.configLogger globally during tests
otherwise it causes sides effects since logging state is global and should only
be done when __name__ == '__main__'.

We can capture logging messages via the caplog pytest fixture
2019-05-31 19:57:52 +01:00
Cosimo Lupo
b0ede1a3c6
instancer_test: add tests for normalizeAxisLimits function
coverage is now 97%, good enough
2019-05-30 14:10:26 +01:00
Cosimo Lupo
68bbc74a78
instancer_test: add tests for main() function 2019-05-30 13:56:58 +01:00
Cosimo Lupo
b528ff67f0
instancer_test: add unit tests for parseLimits 2019-05-30 13:35:56 +01:00
Cosimo Lupo
b878b867c0
instancer: don't break on unsupported condition formats
continue checking subsequent condition tables in case the other may
be format=1 and may reference a pinned axis; in which case, these
conditions need to be dropped from the condition set, or the whole
record needs to be dropped if the instance coordinate is outside the
condition range.
Condition tables within a condition set are associated with a AND
boolean operator, so if any one doesn't match, the whole set doesn't
apply. Even if we don't recognize one condition format, if we do
ascertain that another condition table does not match the current
partial instance location, we can drop the FeatureVariation record
since it doesn't apply.
2019-05-30 13:13:06 +01:00
Cosimo Lupo
874947c00b
instancer_test: make new test font with FeatureVariations
instead of reading off existing FeatureVars.ttx test file.
This gives us more flexibility to add more tests, and keeps the input
values closer to the expected results
2019-05-30 13:13:06 +01:00
Cosimo Lupo
36f2775d6c
instancer: always keep FeatureVariationRecords with unknown condition format
there was a logic issue in the function that checks whether a FeatureVariationRecord
has a unique set of condition (was returning False instead of True for unsupported condition).
It's safer to always keep such records with unknown condition formats as new formats
may be added in the future. A warning is already issued in these cases.
2019-05-30 11:22:01 +01:00
Cosimo Lupo
3560267a0b
instancer_test: add tests for instantiateFeatureVariations
using the same test file FeatureVars.ttx used by varLib_test.py
2019-05-29 19:24:02 +01:00
Cosimo Lupo
e2c0acf1c2
Merge remote-tracking branch 'origin/master' into partial-instancer 2019-05-29 18:04:54 +01:00
Cosimo Lupo
8f88131a78
FeatureVars.ttx: fix up expected test results after aa8a5bc 2019-05-29 13:48:11 +01:00
Miguel Sousa
9fb0cac564 fontBuilder: Don't add a stub signature to DSIG
An empty DSIG is enough to make MS applications happy and also fixes an error reported by MS Font Validator
2019-05-25 10:09:13 -07:00