5048 Commits

Author SHA1 Message Date
Cosimo Lupo
a91f6047a2
Bump version: 4.2.0 → 4.2.1.dev0 2019-11-28 17:15:49 +00:00
Cosimo Lupo
8e30545a29
Release 4.2.0 2019-11-28 17:15:49 +00:00
Cosimo Lupo
d9b6067447
roundingPen: Add RoundingPointPen, like RoundingPen but for point pens 2019-11-28 16:32:40 +00:00
Cosimo Lupo
b885a852ed
recordingPen: add RecordingPointPen, like RecordingPen but for point pens 2019-11-28 16:29:36 +00:00
Cosimo Lupo
0fef59fd9e
transformPen: add TransformPointPen, like TransformPen but for point pens 2019-11-28 16:29:36 +00:00
Cosimo Lupo
646e26603d
filterPen: add FilterPointPen, like FilterPen but for point pens
the base class simply passes through contours/components unchanged
2019-11-28 16:29:35 +00:00
Cosimo Lupo
3d4fb2b371
add RoundingPen, a filter pen to round coordinates and comp offsets 2019-11-27 11:01:09 +00:00
Cosimo Lupo
f6e69af7ba
Merge pull request #1763 from anthrotype/ttpen-float-coords
ttGlyphPen must round float coordinates and offsets
2019-11-26 16:31:25 +00:00
Cosimo Lupo
97fce155ad
ttGlyphPen: always round float coordinates and offsets to integers
Fixes googlefonts/fontmake#593
2019-11-26 16:16:48 +00:00
Nikolaus Waxweiler
a1f4d609e6 [varLib] fix logging typo about setting OS/2.usWeightClass 2019-11-26 16:03:26 +00:00
Jens Kutilek
6c3edaded2
ufoLib groupnames conversion 2 → 3 (#1762)
* If a group name is the same as a glyph name, it cannot be a kerning group name
* Add test
2019-11-22 09:51:35 +01:00
Cosimo Lupo
9d3b14dd5f
Bump version: 4.1.0 → 4.1.1.dev0 2019-11-18 16:29:17 +00:00
Cosimo Lupo
4076060344
Release 4.1.0 2019-11-18 16:29:16 +00:00
Cosimo Lupo
dbe20b7217
minor: typos and variable names 2019-11-18 10:51:30 +00:00
Cosimo Lupo
0b9404d7a4
instancer: rename parameters to more generic 'axisLimits'
I use the term 'location' for map of {axis_tag: float} coordinates, 'axisRanges'
for a map of {axis_tag: Tuple[float, float]} ranges, and 'axisLimits' to include
either single-float coordinates or range tuples.
2019-11-15 19:36:57 +00:00
Cosimo Lupo
12e1a6de37
instancer: catch early if input range doesn't include current default 2019-11-15 19:02:12 +00:00
Cosimo Lupo
6142825d7b
instancer: document case when peak is < 1.0 but outer limit exceeds 2.0 2019-11-15 18:35:37 +00:00
Cosimo Lupo
7d136da836
remove stale comment
a featureVars' range(0,0) is perfectly valid.
2019-11-15 18:01:02 +00:00
Cosimo Lupo
599d24a9e1
instancer: add comments to instantiateAvar 2019-11-15 17:43:22 +00:00
Cosimo Lupo
7c695d411f
Merge remote-tracking branch 'origin/master' into l3-instancer 2019-11-15 17:05:47 +00:00
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
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
8bf82539bb
instancer: update module-level docstring for L3 instancing 2019-10-28 17:39:21 +00:00
Cosimo Lupo
f861c68873
instancer: keep emptied HVAR table
Even if HVAR no longer contains any variations, it's better to keep it because
otherwise one would have to check the glyphs' phantom points to confirm that
the advance widths (or heights for VVAR) don't vary
2019-10-24 17:37:49 +01:00
Cosimo Lupo
3c6ddb0ef8
instancer: never drop STAT DesignAxes; only prune out-of-range AxisValues
The current method for L1 and L2 partial instacing of STAT table --
i.e. drop all pinned axes are respective axis values -- was incorrect.
STAT design axis are a superset of the fvar axes, they describe the relations
between members of a font family in which some aspects may be implemented as
variation axes within a single VF, others as multiple discrete fonts.

When we remove an axis from fvar, we still want to keep the STAT's DesignAxis,
as well as the single AxisValue table along that design axis which describes
the position of the new instance within the family's stylistic attributes.

This means, intantiateAvar will never drop any DesignAxis, but will only drops
AxisValue tables when: 1) we're pinning an axis and the desired instance
coordinate doesn't exactly equal any of the existing AxisValue records;
2) we're restricting an axis range, and the (nominal) AxisValue falls
outside of the desired range.

We never add new AxisValue records, as that's a design decision that
is outside of the scope of the partial instancer.
2019-10-24 17:37:48 +01:00
Cosimo Lupo
0b746bc38d
instancer: implement restricting axis ranges (L3)
Added method to limitTupleVariationAxisRanges which takes a map of
axis tags to (min, max) ranges and drops entire deltasets when outside
of the new limits, or scales the ones that are within range.

Modified _TupleVarStoreAdapter to account for the fact that, when limiting
axes, existing regions can be modifed rathern than simply dropped
(see rebuildRegions).

Implemented limiting axis ranges for fvar, FeatureVariations, and avar.

Note how we pass user-scale coordinates to instantiateAvar, because we need
both the default normalized coordinates and the ones mapped forward (by
the very same avar table that we are instancing).

STAT table support will follow in a separate commit.
2019-10-24 17:10:32 +01:00
Cosimo Lupo
e8f5bbcc6a
renamed LiteralCount to StaticCount
makes it clearer what it is
2019-10-24 15:42:09 +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
Cosimo Lupo
550711e106
move MAX_F2DOT14 constant to fixedTools 2019-10-23 16:50:12 +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
msoxzw
fcbbce5ca2
Add with statement context manager like ttFont 2019-10-21 07:03:45 +00: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
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
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
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