8576 Commits

Author SHA1 Message Date
Cosimo Lupo
e7ea2b0147
Merge pull request #2175 from fonttools/move-paint-format-enum
COLRv1: fix lazy loading by moving Paint.Format enum outside of Paint class nested scope
2021-02-08 11:54:14 +00:00
Cosimo Lupo
df672a7ae4
move PaintFormat enum outside of Paint class nested scope
When a TTFont is loaded with lazy=True, the otTables are only loaded upon BaseTable.__getattr__
when the requested attribute is not found in the instance __dict__.
Since the Paint.Format enum was defined at class level, every Paint instance, even when loaded
lazily, will have a 'Format' attribute and the magic decompile-on-missing-attribute will not
trigger, since the class attribute will be returned when the instance is missing one.

For this reason, and to not add further special cases, it's better to simply move this Paint.Format
enum class outside to the module level scope, and rename it PaintFormat.
2021-02-05 12:11:43 +00:00
Cosimo Lupo
82c32cbf88
C_O_L_R_test: fix incorrect NumLayers
there's actually 3 LayerRecords defined in the COLR_V1_SAMPLE, not 4.
2021-02-05 10:36:12 +00:00
Cosimo Lupo
f0374be5e1
Merge pull request #2171 from fonttools/colorLib-unbuilder
COLRv1: add functions to un-build COLR otTables to raw dicts
2021-02-04 12:34:36 +00:00
Cosimo Lupo
4b17301321
unbuilder: get Format attribute directly from the Paint instance 2021-02-04 12:24:13 +00:00
Cosimo Lupo
e20ccfcf9f
add unbuildPaintSweepGradient 2021-02-04 12:16:29 +00:00
Cosimo Lupo
22d290b06e
Merge remote-tracking branch 'origin/master' into colorLib-unbuilder 2021-02-04 12:09:30 +00:00
Cosimo Lupo
708cb9aef1
Merge pull request #2172 from fonttools/colr-sweep-gradient
COLRv1: add support for PaintSweepGradient
2021-02-04 11:47:34 +00:00
Cosimo Lupo
a3d13abcff
otData: fix typo, add comments 2021-02-04 11:32:22 +00:00
Just van Rossum
3ad56a40db
Merge pull request #2173 from justvanrossum/fix-vector-div
fix fontTools.misc.arrayTools.Vector() division
2021-02-03 20:55:08 +01:00
justvanrossum
f416a5cb17 fix Vector division 2021-02-03 20:24:04 +01:00
Cosimo Lupo
a7d145f027
update tests for PaintSweepGradient 2021-02-03 19:11:44 +00:00
Simon Cozens
45201f68a6
Merge pull request #2170 from simoncozens/delete-glyph
[feaLib] Allow deleting glyphs
2021-02-03 19:06:07 +00:00
Cosimo Lupo
93c23eaaf7
COLRv1: define new PaintSweepGradient, amend tests with new format numbers 2021-02-03 18:21:09 +00:00
Cosimo Lupo
8f66a1e813
COLRv1: add functions to un-build COLR otTables to raw dicts
This adds an unbuildColrV1 which does the inverse of colorLib.builder.buildColrV1.
Takes a LayerV1List and BaseGlypV1List and returns a map of base glyphs to raw data structures (list, dict, float, str, etc.).
Useful not only for debugging purpose, but also for implementing COLRv1 subsetting (where we need to drop whole chunks of paints which may be reused by multiple glyphs).
2021-02-03 16:47:59 +00:00
Simon Cozens
56df97b5f2 Prohibit non-functional "sub A B by NULL" 2021-02-03 14:16:57 +00:00
Simon Cozens
d1e85cb888 Allow 'sub X by NULL;' sequence to delete a glyph 2021-02-03 14:12:46 +00:00
Cosimo Lupo
728258d66f
Merge pull request #2166 from fonttools/fb-colr-glyphMap
fontBuilder: pass glyphMap to buildCOLR to sort base records by GID
2021-02-01 12:52:24 +00:00
Cosimo Lupo
8343468689
fontBuilder: pass through version and varStore parameter to buildCOLR 2021-02-01 11:59:24 +00:00
Cosimo Lupo
85c450b565
fontBuilder: pass glyphMap to buildCOLR to sort base records by GID
COLR Base glyph records must be sorted by glyph index. The buildCOLR
function has an optional glyphMap parameter that maps from glyph names
to glyph indices (as returned from TTFont.getReversedGlyphMap()).
FontBuilder knows all that so it should pass it on to colorLib.
2021-02-01 11:51:39 +00:00
Nikolaus Waxweiler
8612319487 Bump version: 4.19.1 → 4.19.2.dev0 2021-01-28 17:06:32 +00:00
Nikolaus Waxweiler
b0278cf846 Release 4.19.1 2021-01-28 17:06:32 +00:00
Nikolaus Waxweiler
c4027c0e67
Merge pull request #2161 from fonttools/fix-woff2-offcurve-overlap-flag
WOFF2: An off-curve should stay off even with flags
2021-01-28 16:58:42 +00:00
Nikolaus Waxweiler
8569a8435f
Update Tests/ttLib/woff2_test.py
Co-authored-by: Cosimo Lupo <cosimo@anthrotype.com>
2021-01-28 16:35:36 +00:00
Nikolaus Waxweiler
52e3e03ed9 An off-curve should stay off even with flags 2021-01-28 16:30:23 +00:00
Cosimo Lupo
822d3bf261
plistlib: remove unused 'type: ignore' comment to appease mypy 2021-01-25 17:42:19 +00:00
Cosimo Lupo
d47250dd15
Bump version: 4.19.0 → 4.19.1.dev0 2021-01-25 17:36:42 +00:00
Cosimo Lupo
f8283bda7e
Release 4.19.0 2021-01-25 17:36:42 +00:00
Cosimo Lupo
9ab1895b63
Update changelog [skip ci] 2021-01-25 17:36:01 +00:00
Cosimo Lupo
7db6b8aae5
Merge pull request #2155 from daltonmaag/add-verbose-error-for-classdefbuilder-add
Raise an exception when ClassDefBuilder attempts to add a duplicate glyph.
2021-01-25 17:19:21 +00:00
Tom Archer
be898ec6f9 Change ValueError to OpenTypeLibError 2021-01-20 14:30:49 +00:00
Cosimo Lupo
81fa5b5265
Merge pull request #2137 from fonttools/x-mac-encodings-errors
codecs: handle errors different from 'strict' for extended mac encodings
2021-01-20 11:21:43 +00:00
Cosimo Lupo
c9c30fa51d
Merge pull request #2153 from fonttools/paint-colr-layer-tree
COLRv1: support unlimited paints as 255-ary tree of PaintColrLayers
2021-01-20 11:20:26 +00:00
Tom Archer
9712407054 Change TypeError to ValueError 2021-01-20 11:19:43 +00:00
Tom Archer
7c6337facf Add exception and test 2021-01-19 17:57:53 +00:00
Nikolaus Waxweiler
8573af97b8 Merge pull request #2154 from fonttools/varlib-error-msg-script-dflt-langsys
[varLib] featureVars.addFeatureVariationsRaw: Raise legible error message when script is missing a dflt langsys
2021-01-19 17:31:19 +00:00
Nikolaus Waxweiler
6023bab627 Raise legible error message when script is missing a dflt langsys 2021-01-19 16:42:40 +00:00
Cosimo Lupo
7516e0d95d
builder_test: add test with len(paints) > 255 2021-01-18 17:35:48 +00:00
Cosimo Lupo
9d33afe04d
COLRv1: support unlimited paints as 255-ary tree of PaintColrLayers
Fixes https://github.com/googlefonts/nanoemoji/pull/225

E.g. BASKET noto-emoji U+1F9FA contains 364 layers
2021-01-18 17:33:21 +00:00
Cosimo Lupo
a8d366e3b2
Merge pull request #2148 from fonttools/colr-fix-c0-almost-inside-c1
COLRv1: avoid abrupt change after rounding c0 when too near c1's perimeter
2021-01-18 09:59:39 +00:00
Cosimo Lupo
a3247ea472
compute rounding (dx,dy) offset outside loop then simply do Circle.move() inside 2021-01-18 09:50:47 +00:00
Cosimo Lupo
c13b1cef84
determine direction to nudge pre-loop 2021-01-15 19:11:10 +00:00
Cosimo Lupo
c9055871d6
minor: rename local vars without _circle suffix 2021-01-15 18:17:08 +00:00
Cosimo Lupo
b465dcff75
rename function to round_start_circle_stable_containment
as suggested in https://github.com/fonttools/fonttools/pull/2148#discussion_r557656073
2021-01-15 17:37:11 +00:00
Cosimo Lupo
4f1102ac6e
add a Circle class, handle concentrical case, explain why 2 iterations are enough 2021-01-15 16:59:17 +00:00
Cosimo Lupo
4f886cc226
reword _is_circle_inside_circle parameters for better readability 2021-01-14 19:06:33 +00:00
Cosimo Lupo
c403dbe83a
minor: rename function, remove redundant one 2021-01-14 18:57:19 +00:00
Cosimo Lupo
7f0788ca25
use math.hypot() as per review
https://github.com/fonttools/fonttools/pull/2148#discussion_r557596711
2021-01-14 18:22:57 +00:00
Cosimo Lupo
db14e6375e
COLRv1: avoid abrupt change after rounding c0 when too near c1's perimeter
Fixes https://github.com/googlefonts/picosvg/issues/158

Also see https://github.com/googlefonts/colr-gradients-spec/issues/204
2021-01-14 17:13:22 +00:00
Nikolaus Waxweiler
9c0bc9e554
Merge pull request #2146 from fonttools/prune-cmap-format12
Subsetting: prune redundant format 12 cmaps
2021-01-13 17:20:06 +00:00