Simon Cozens
6c547864b6
Use individual exception classes instead of enum
2021-03-18 15:49:49 +00:00
Simon Cozens
b26728d3cb
Specifically catch VarLibMergeError
2021-03-17 11:56:02 +00:00
Simon Cozens
5bac84374b
Ensure TTF list is correct
2021-03-15 12:50:07 +00:00
Simon Cozens
e2a859d649
Ensure table name is in error message stack
2021-03-15 12:04:36 +00:00
Simon Cozens
1abfbb6cc7
Explain merge errors in designer-friendly terms
2021-03-13 22:30:27 +00:00
Behdad Esfahbod
abc1ba07a4
[misc.roundTools] New module; move otRound() here
...
Code relying on old place (fixedTools.otRound) still works.
2021-03-04 09:20:43 -07:00
Simon Cozens
46c8f90da8
Use _ to denoted unused loop variable
2020-05-07 21:00:28 +01:00
punchcutter
aeb5149f15
Add variable support for BASE table 1.1
2020-03-20 13:34:02 -07:00
Nikolaus Waxweiler
4320392eb5
merger: Convert input checking asserts into proper exceptions
2020-02-13 15:02:31 +00:00
justvanrossum
51ff4a5d69
Move ensureDecompiled() calls to mergeObjects(). This makes more sense, but still needs the hasattr checks.
2020-01-29 11:05:01 +01:00
justvanrossum
033145adf6
this fixes #1808 , but I'm not sure this is the most elegant solution
2020-01-29 10:10:55 +01:00
justvanrossum
4de5fb800c
improve error when glyph orders don't match; fixes #1758
2019-11-12 10:02:27 +01:00
Nikolaus Waxweiler
68a5ceac6d
varLib: Remove py23 imports
2019-08-10 15:39:02 +01:00
Nikolaus Waxweiler
01328213c7
Remove __future__ imports
2019-08-09 12:20:13 +01:00
Cosimo Lupo
6f1d25497a
Merge remote-tracking branch 'origin/master' into partial-instancer
2019-06-18 18:45:47 +01:00
Cosimo Lupo
4e4f37aa21
varLib.merger: use dict comprehension and zip iterator
2019-06-18 16:30:24 +01:00
Cosimo Lupo
d6c2ea79b6
varLib.merger: simplify if-stmt logic a bit
...
isPairPos and isSinglePos are mutually exclusive and isSinglePos is only defined if isPairPos is False
so it is safe to use it in 'else' or 'elif' branches (logical expressions short-circuit)
2019-06-18 16:21:33 +01:00
Cosimo Lupo
def6310f4a
varLib.merger: when flattening singlepos, copy valuerecords
...
to avoid modifying original master fonts' SinglePos tables
https://github.com/fonttools/fonttools/pull/1641/files#r293302141
2019-06-18 16:10:46 +01:00
Cosimo Lupo
8c90878fcf
Merge remote-tracking branch 'origin/master' into fix-singlepos-merge
2019-06-18 15:38:10 +01:00
Nikolaus Waxweiler
f48051af23
Fix corrupt class-based pair kerning table merging
2019-06-14 10:05:48 +01:00
ReadRoberts
b756bcac18
[varLib.merger] Fix merging GPOS SinglePos subtables
...
When a SinglePost lookup is compiled, pretty much all compilers do some compression by combining similar ValueRecords into a single subtable. This compression produces different lengths of the list of subtables between source fonts. The original code required that all SinglePos lookups have the same subtables, often doesn't work.
I fixed this in varLib.merger.py by first flattening a SinglePos lookup to a single subtable, using the same record format for all records, and then merging the source fonts. After the merge is complete, I call fontTools.otlLib.builder.buildSinglePos() to rebuild the lookup subtables.
2019-06-12 14:30:30 -07:00
Cosimo Lupo
17254fe37a
varLib.merger: Class2Record.Value{1,2} may not be initialised to None
...
When importing from TTX, these attribute are not there.
2019-05-21 18:42:38 -04:00
Cosimo Lupo
4051976f48
Merge remote-tracking branch 'origin/master' into partial-instancer
2019-05-21 14:54:42 -04:00
Khaled Hosny
7e5644a0a8
[varLib] Fix merging GDEF.GlyphClassDef in mutator
...
The code was setting GlyphClassDef.classDefs for the base font to an
empty dict then reading it from all fonts. It accidentally works when
creating variable fonts because the GlyphClassDef of the other fonts
will be used, but when mutating there is only one font.
Fix by reading the glyph classes before assigning to an empty dict.
2019-05-18 04:44:34 +02:00
Cosimo Lupo
4db603be96
varLib.merger: have MutatorMerger use pre-computed deltas and optionally keep VarIdx tables
2019-04-18 10:23:37 +01:00
Behdad Esfahbod
8e080f2a82
[varLib] Fix merging of multiple PairPosFormat2 subtables
...
We should invert each ClassDef1 against its own sublookup Coverage,
not the combined one. Oops!
Fixes https://github.com/fonttools/fonttools/issues/1411
2018-12-19 06:34:40 -05:00
Behdad Esfahbod
335c98512e
[varLib] Variate GDEF LigCarets
...
Untested.
2018-11-19 16:46:22 -05:00
Behdad Esfahbod
a766d8d91e
[varLib.mutator] Mutate GDEF itself
2018-11-19 16:45:30 -05:00
Behdad Esfahbod
0218e07f76
[varLib.mutator] Move some code out of merger
2018-11-19 16:38:27 -05:00
Behdad Esfahbod
38663559b0
[varLib.mutator] Fix Anchor instantiation after recent change
...
Fixes https://github.com/fonttools/fonttools/issues/1380
2018-11-18 20:39:13 -05:00
Behdad Esfahbod
d4da819ce6
Space
2018-11-18 20:28:25 -05:00
Behdad Esfahbod
e30b830403
Merge pull request #1368 from fonttools/varLib-sparse-masters
...
[varLib] Support sparse masters
2018-11-15 15:00:00 -08:00
Behdad Esfahbod
49772b136f
[varLib] Comment
2018-11-14 10:07:51 -05:00
Behdad Esfahbod
8d441779e5
[varLib] Fix PairPosFormat2 merging
...
See comments.
Fixes https://github.com/googlei18n/fontmake/issues/470
2018-11-13 22:30:42 -05:00
Behdad Esfahbod
5c1ca73123
[varLib] Rename allSame() to allEqual()
...
Being same ("is") is not the same as being equal ("=="), even though
the two are equal most of the time.
2018-11-10 15:06:07 -05:00
Behdad Esfahbod
fa303ea07a
[varLib] Comment
2018-11-09 09:57:09 -05:00
Behdad Esfahbod
0a0fc2a09e
[varLib] Minor
2018-11-09 09:53:56 -05:00
Behdad Esfahbod
7711755b2c
[varLib] Add mapper to allSameAs() and use it
2018-11-09 09:51:53 -05:00
Behdad Esfahbod
bff73edcfd
[varLib] Add models.allNone
2018-11-09 09:48:02 -05:00
Behdad Esfahbod
7326cb59f3
[varLib] Limit ClassDef merger to GDEF.GlyphClassDef
...
Would be wrong to change a glyph from class0 to non-zero in a ClassDef2
kind of situation. Contain this code to where it was written for.
2018-11-09 09:41:08 -05:00
Behdad Esfahbod
ec509540f2
[varLib] Fixup MarkMark merging
2018-11-09 01:46:15 -05:00
Behdad Esfahbod
48e918ab7e
[varLib] Minor
2018-11-09 01:35:20 -05:00
Behdad Esfahbod
b21a39861b
[varLib] Add sparse masters to MarkMarkPos
...
Untested.
2018-11-09 01:17:51 -05:00
Behdad Esfahbod
dfff5134e5
[varLib] Towards sharing merge logic of MarkBasePos for MarkMarkPos
2018-11-09 01:02:45 -05:00
Behdad Esfahbod
babc6d878a
[varLib] More XML redundancy test failure fixes
2018-11-09 00:56:20 -05:00
Behdad Esfahbod
479b52e13d
[varLib] When merging MarkBasePos, retain original coverage objects
...
Just such that their existing .Format is preserved, as that is written out
to the XML file, and would break the test suite if not there.
Stupid to write Coverage Format to XML. Oh well...
2018-11-09 00:51:53 -05:00
Behdad Esfahbod
11a679df21
[varLib] Allow sparse masters in GPOS MarkBasePos lookups
...
Part of https://github.com/googlei18n/fontmake/issues/88
Part of https://github.com/fonttools/fonttools/issues/1355
2018-11-09 00:41:25 -05:00
Behdad Esfahbod
8816262982
[varLib] Move ClassDef merger from VariationMerger to AligningMerger
2018-11-08 23:36:12 -05:00
Behdad Esfahbod
37dd59120b
[varLib] Allow merging sparse ClassDefs
...
This is mainly meant for GDEF.GlyphClassDefs, but implementation is on the
ClassDefs type. What can possibly go wrong... Seriously though, this is
pretty much always what is desired. To be embraced by more type mergers
down the road.
Part of https://github.com/googlei18n/fontmake/issues/88
Part of https://github.com/fonttools/fonttools/issues/1355
2018-11-08 23:27:12 -05:00
Behdad Esfahbod
6bb8a1268a
[varLib.merger] Minor
2018-11-08 23:20:08 -05:00