7232 Commits

Author SHA1 Message Date
justvanrossum
4de5fb800c improve error when glyph orders don't match; fixes #1758 2019-11-12 10:02:27 +01:00
Just van Rossum
b8fafdd259
[WIP] [designspaceLib] designspace docs edits (#1750)
Various changes in the designspaceLib readme.rst
- added docs for DesignSpaceDocument object, methods and attributes
- removed comments on validation, localisation and generating UFO instances.
- added note that axis minimum, default and maximum are in userspace coordinates.
- added clarification to map input (userpace!) / output (designspace!) values.
- added note that sourceDescriptor location is in designspace coordinates.
- moved comment on rule subs to rule descriptor object.
- added proposed "processing" flag to rules element
- move note on sub element
- implementation differences
- varlib vs. mutatormath
- older versions
- rules and generating static ufo instances
- Updated the description of the `copyInfo` flag of the sourceDescriptor.
- Change the example import.
- Remove additional mention of copyInfo.
2019-11-07 19:30:51 +01:00
Behdad Esfahbod
9df78f303b [otData] Support BASE table version 1.1 2019-10-31 11:45:49 -07:00
Just van Rossum
07140c12bd
[pens] Improve error message if pen.moveTo() is omitted. (#1757)
Improve error message if pen.moveTo() is omitted. See also robotools/fontParts#470
2019-10-30 14:45:55 +01:00
Cosimo Lupo
5790f7f9af
Merge pull request #1752 from anthrotype/region-axis-count
enforce VarStore RegionAxisCount == fvar.AxisCount
2019-10-29 13:02:43 +00:00
Cosimo Lupo
ebadcd96e6
set pre-initialized CountReference in VarRegionList.preWrite with fvar.axisCount
so we can reuse CountReference class, as suggested in https://github.com/fonttools/fonttools/pull/1752#issuecomment-547113944

The patch is no shorter though.
2019-10-29 12:52:42 +00:00
Cosimo Lupo
e8f5bbcc6a
renamed LiteralCount to StaticCount
makes it clearer what it is
2019-10-24 15:42:09 +01:00
Cosimo Lupo
141ff20b37
varLib_test: test building (pseudo) VF with only a single master
The SingleMaster.designspace contains only one source master, so there is no real
variation data.
Still, and empty HVAR table is added (with RegionAxisCount == fvar.AxisCount).
The gvar and cvar table are not added in this case, since they are empty and
not required.
2019-10-24 14:10:08 +01:00
Cosimo Lupo
4eee7c071d
varLib: don't add empty gvar or cvar with no variations 2019-10-24 14:05:29 +01:00
Cosimo Lupo
adc5b2997e
[otBase|otTables] enforce VarStore RegionAxisCount == fvar.AxisCount
even when there are no Regions and thus we can't take the length of VarRegionAxis array.
This is to appease older versions of OTS which blindly enforce this rule and
reject a VF that has, e.g., an empty HVAR table with no regions if the
HVAR.VarStore.VarRegionList.RegionAxisCount != fvar.AxisCount.

Fixes https://github.com/fonttools/fonttools/issues/1670

Related:
https://github.com/fonttools/fonttools/pull/1671
https://github.com/googlefonts/fontmake/issues/565
https://github.com/khaledhosny/ots/pull/192
2019-10-24 12:54:16 +01:00
Just van Rossum
d96c92f95e
Merge pull request #1747 from justvanrossum/rclt_issue1625
[designspaceLib] [varLib] Allow FeatureVariations to be processed *after* other features
2019-10-21 16:08:04 +02:00
Cosimo Lupo
021820f6da
Merge pull request #1751 from msoxzw/msoxzw-patch-ttCollection
Add "with statement context manager" in ttCollection
2019-10-21 10:17:48 +01:00
msoxzw
fcbbce5ca2
Add with statement context manager like ttFont 2019-10-21 07:03:45 +00:00
justvanrossum
76b8517102 ooops, forgot to add the expected results file 2019-10-20 09:25:50 +02:00
justvanrossum
e2bac99eb8 Test adding FeatureVariations with an existing 'rclt' feature 2019-10-20 09:19:40 +02:00
justvanrossum
7bfeb1ab97 assume ds is a DesignSpaceDocument instance and therefore is known to have the rulesProcessingLast attribute 2019-10-19 11:17:26 +02:00
justvanrossum
4322a3f95d more testing of rules-processing-last 2019-10-18 13:36:02 +02:00
justvanrossum
f4925fff44 perform some testing with <rules processing=...> and doc.rulesProcessingLast 2019-10-18 13:33:29 +02:00
justvanrossum
f9b04572f6 fix error message, reformatted long line 2019-10-18 13:24:32 +02:00
justvanrossum
0ee3f01f0c use designspace.rulesProcessingLast flag to determine whether we should use 'rvrn' or 'rclt' 2019-10-18 13:21:06 +02:00
justvanrossum
d42b7d74ca Implement <rules> attribute 'processing' according to spec update #1750, as well as the related doc.rulesProcessingLast flag 2019-10-18 13:20:28 +02:00
justvanrossum
db04262bed support multiple <featureTag> features 2019-10-17 20:46:59 +02:00
justvanrossum
d2ea72cbec addFeatureVariations(): allow the feature tag to be specified (default to 'rvrn'); allow said feature to already exist, in which case we append new lookup indices to the existing feature 2019-10-17 20:01:05 +02:00
Cosimo Lupo
28b685c9c0
bump unicodedata2 requirement >= 12.1.0 2019-10-17 12:15:31 +01:00
Nikolaus Waxweiler
f939d2dc31
Merge pull request #1743 from fonttools/remove-some-py2-vestiges
Remove some Python 2 vestiges, deprecate using non-builtin types in plistlib
2019-10-14 11:18:50 +01:00
Nikolaus Waxweiler
6b9eefcf48 Warn if use_builtin_types is False 2019-10-14 11:04:52 +01:00
Nikolaus Waxweiler
6da6a2c377 Fix typo 2019-10-12 13:49:36 +01:00
Nikolaus Waxweiler
94c3aff991 Remove redundant object subclassing 2019-10-12 13:44:03 +01:00
Nikolaus Waxweiler
b54e11c1a5 Remove conditional to use built-in types by default 2019-10-12 13:40:48 +01:00
Nikolaus Waxweiler
c67a2e5ff0 Remove more legacy imports 2019-10-12 13:26:59 +01:00
Nikolaus Waxweiler
2acb1de6c9 Remove unicode import 2019-10-12 13:22:31 +01:00
Nikolaus Waxweiler
fb07ab1d8f Remove PY2-era re.ASCII reference 2019-10-12 12:24:16 +01:00
Nikolaus Waxweiler
641058ead2 Remove PY2 conditional and unicode import 2019-10-12 12:20:22 +01:00
Nikolaus Waxweiler
b0afdc273e Remove singledispatch import conditional 2019-10-12 12:20:06 +01:00
Nikolaus Waxweiler
969df8303b Remove some Python 2 era import gaming 2019-10-11 22:36:33 +01:00
Nikolaus Waxweiler
cea5abd676
Merge pull request #1742 from fonttools/name-handle-duplicate-name-records-different-string-types
[name] Handle duplicate name records with different `string` types
2019-10-11 18:53:45 +02:00
Nikolaus Waxweiler
e4f7495f32 [name] Be less cautious about getting data for NameRecord comparisons 2019-10-11 17:39:56 +01:00
Nikolaus Waxweiler
2e82438d93 [name] Handle duplicate name records with different string types 2019-10-11 14:24:03 +01:00
Cosimo Lupo
5f2eaf12cf
Merge pull request #1740 from anthrotype/fixed-to-float-str
don't round in fixedToFloat, unless we're dumping floats to XML
2019-10-09 18:10:13 +01:00
Cosimo Lupo
7433ac786a
graphite: round 16.16F 'version' to shortest decimal float on decompile
we could alternatively decode these version fields as a long integer like we do elsewhere
for similar table versions, but I am not sure whether external code relies on them being
like they are now (i.e. compact decimal float).

https://github.com/fonttools/fonttools/issues/944
2019-10-08 13:40:07 +01:00
Cosimo Lupo
2eeba71d5f
fix cvar, gvar and instancer tests to compare floats as almost-equality 2019-10-08 13:40:07 +01:00
Cosimo Lupo
a7e368d00f
otConverters: use floatToFixedToStr/strToFixedToFloat in Fixed/F2Dot14 toXML/fromXML 2019-10-08 13:40:06 +01:00
Cosimo Lupo
eb5a2ceb8d
_t_r_a_k: use floatToFixedToStr and strToFixedToFloat in TrackTableEntry toXML/fromXML 2019-10-08 13:40:06 +01:00
Cosimo Lupo
c60512de0e
_g_l_y_f: use floatToFixedToStr and strToFixedToFloat in GlyphComponent toXML/fromXML 2019-10-08 13:40:06 +01:00
Cosimo Lupo
8791caf3b8
_a_v_a_r: use floatToFixedToStr and strToFixedToFloat in toXML/fromXML methods 2019-10-08 13:40:05 +01:00
Cosimo Lupo
d66c92fbe0
_f_v_a_r: use floatToFixedToStr and strToFixedToFloat in Axis and NamedInstance 2019-10-08 13:40:05 +01:00
Cosimo Lupo
b50c10af7a
TupleVariation_test: test toXML and fromXML with float axis supports 2019-10-08 13:40:05 +01:00
Cosimo Lupo
79d654eaf2
TupleVariation: use floatToFixedToStr and strToFixedToFloat in toXML/fromXML methods 2019-10-08 13:40:04 +01:00
Cosimo Lupo
8500dfca71
psCharStrings_test: test load/dump fixed point numbers 2019-10-08 13:40:04 +01:00
Cosimo Lupo
86793f2617
psCharStrings: use floatToFixedToStr and strToFixedToFloat in T2CharString.toXML and fromXML
Also, toXML signature must contain ttFont=None keyword argument, like
the rest of toXML methods elsewhere.
2019-10-08 13:40:03 +01:00