Khaled Hosny
323d0c85d1
fontBuilder: Allow varLib to use fresh CFF table
...
Make sure the CFF table generated by fontBuilder can be used by varLib
without having to compile and decompile the table first. This was
breaking in converting the CFF table to CFF2 due to some unset
attributes.
2020-02-22 13:51:45 +02:00
Cosimo Lupo
ee213a28f7
Bump version: 4.4.0 → 4.4.1.dev0
2020-02-18 15:25:12 +00:00
Cosimo Lupo
996f2ac1a5
Release 4.4.0
2020-02-18 15:25:11 +00:00
Cosimo Lupo
76d125b3e2
Update changelog [skip ci]
2020-02-18 15:24:14 +00:00
Cosimo Lupo
909be35e57
Merge pull request #1826 from anthrotype/colorLib
...
colorLib: add buildCOLR and buildCPAL
2020-02-18 15:11:41 +00:00
Cosimo Lupo
d9250ddcf5
fontBuilder: allow to build v1 from setupCPAL method
2020-02-17 18:35:15 +00:00
Cosimo Lupo
a0a4901a5e
colorLib_test: add tests for buildCPAL v1
2020-02-17 18:28:24 +00:00
Cosimo Lupo
bb46604ec2
colorLib: allow to build CPAL version=1
2020-02-17 18:25:45 +00:00
Cosimo Lupo
f60bcc2c5a
[CPAL] the absence of a color palette label nameID is 0xFFFF, not 0
2020-02-17 17:03:37 +00:00
Cosimo Lupo
7a2f68a317
colorLib: add type annotations
2020-02-17 12:11:53 +00:00
Cosimo Lupo
acfae6721b
add tests for buildCORL and buildCPAL
2020-02-17 12:11:53 +00:00
Cosimo Lupo
f8b9887f85
fontBuilder: add setupCOLR and setupCPAL methods
2020-02-17 12:11:52 +00:00
Cosimo Lupo
191a036f26
colorLib: add buildCOLR and buildCPAL
2020-02-17 12:11:51 +00:00
Cosimo Lupo
3826fc7d60
Merge pull request #1831 from anthrotype/scaled-component-anchor-pts
...
[glyf] fix getCoordinates for composite glyphs that use anchor points
2020-02-17 11:20:40 +00:00
Cosimo Lupo
8423e01a18
ufoLib: don't crash if UFO2 has openTypeHheaCaretOffset=0.0
...
validators are picky so give them integers when they want integers
2020-02-15 13:25:45 +00:00
Cosimo Lupo
183792c747
_g_l_y_f_test: add tests for Glyph.getCoordinates and GlyphComponent.to/fromXML
2020-02-13 18:08:38 +00:00
Cosimo Lupo
7c023c42af
[glyf] if comp uses anchors compute firstPt-secondPt offset after applying transform
...
Fixes https://github.com/fonttools/fonttools/issues/1556
When a component uses firstPt/secondPt reference anchor points instead of XY offsets,
and the component also has a transform, fonttools is incorrectly computing its bounding box.
This is because we are computing the translation offset between firstPt and secondPt before
applying the 2x2 scale/rotation/shear transform. By the time we do the translation, the
offset is now incorrect.
We need to compute the translation offset after we have applied the 2x2 transform.
2020-02-13 18:07:57 +00:00
Cosimo Lupo
d8d824011a
Merge pull request #1830 from anthrotype/scaled-comp-bbox
...
[ttGlyphPen] quantize component.transform to F2Dot14 to normalize bbox
2020-02-13 15:37:45 +00:00
Nikolaus Waxweiler
4be6aaf71c
Merge pull request #1821 from fonttools/varLib-wrap-exceptions
...
[varLib] Use proper exceptions for signalling input source errors
2020-02-13 15:24:22 +00:00
Nikolaus Waxweiler
3c12f51c23
Update NEWS.rst
2020-02-13 15:07:59 +00:00
Nikolaus Waxweiler
4320392eb5
merger: Convert input checking asserts into proper exceptions
2020-02-13 15:02:31 +00:00
Nikolaus Waxweiler
af0567f847
featureVars: Use new exceptions
2020-02-13 15:02:31 +00:00
Nikolaus Waxweiler
5b5c964b0f
cff: Use new exceptions
...
Aliases for the old errors will stay because the AFDKO and maybe others
use them.
2020-02-13 15:01:52 +00:00
Nikolaus Waxweiler
5a53d1d4ad
models: Use new exceptions where input is checked
2020-02-13 15:01:52 +00:00
Nikolaus Waxweiler
c5c30588b5
init: Convert input checking asserts into proper exceptions
...
Also fix the avar output mapping check to allow values greater than OR
EQUAL to the preceeding values.
2020-02-13 15:01:07 +00:00
Nikolaus Waxweiler
8f7a796bd3
init: Convert existing raised exceptions to new appropriate ones
2020-02-13 14:58:10 +00:00
Nikolaus Waxweiler
55bfa4e076
Introduce errors submodule
2020-02-13 14:58:10 +00:00
Nikolaus Waxweiler
5cda8381f9
[feaLib] Check that glyph names referenced in the feature file are part of the glyph set ( #1828 )
...
This checks that glyph names that appear in a feature file are actually
in the glyph set provided in glyphNames. If the set is empty, no check
is done. This preempts a KeyError later during saving of a TTFont object
and makes this case much more easily catchable.
Closes #1723 .
2020-02-13 14:47:29 +00:00
Cosimo Lupo
b6467b7e85
ttGlyphPen: quantize component.transform to F2Dot14 to fix issue with bbox
...
Fixes https://github.com/googlefonts/fontmake/issues/558
When drawing a composite glyph with a scaled component using the TTGlyphPen, the bounding
box coordinates may change depending on whether one computes them *before* compiling or
*after* decompiling. Before compiling, component.transform holds double precision floats,
but after compiling and decompiling, these are necessarily clamped to F2Dot14 fixed precision.
The TTGlyphPen needs to quantize transform floats to F2Dot14 so that the values don't
change after compilation.
Without this change, it may happen that round-tripping fonts through ttx (which by default
recalcBBoxes) will produce different bounding boxes for composite glyphs that have
scaled or transformed components.
2020-02-13 13:49:01 +00:00
Cosimo Lupo
e35228603d
Merge pull request #1829 from anthrotype/empty-glyf
...
[glyf] compile empty table as 1 null byte to make OTS and Windows happy
2020-02-12 14:52:23 +00:00
Cosimo Lupo
cf0567d8a5
subset_test: test subsetting font to empty glyf table
2020-02-12 14:25:25 +00:00
Cosimo Lupo
92e770ea16
_g_l_y_f_test: add tests for compiling/decompiling empty glyf table
2020-02-12 14:25:25 +00:00
Cosimo Lupo
9c7ceadc0e
[glyf] compile empty table as 1 null byte to make OTS and Windows happy
...
Fixes #899
See https://github.com/khaledhosny/ots/issues/52#issuecomment-289369267
2020-02-12 14:25:25 +00:00
Nikolaus Waxweiler
a10dd80c32
Merge pull request #1827 from fonttools/varLib-fill-in-mapped-location
...
[varLib] Fill in the forward-mapped location
2020-02-12 13:09:33 +00:00
Nikolaus Waxweiler
578aa16a36
Add NEWS entry
2020-02-12 12:55:07 +00:00
Cosimo Lupo
16bff17483
head: when checking for extra padding at end of table, must compare bytes, not str
2020-02-12 12:53:09 +00:00
Cosimo Lupo
d2026bd651
WIP: otData: define draft COLRv1 structures
...
https://docs.google.com/document/d/1EPndWsdMK_M135FOIxQZ--dHpH727rXEBvLZqgIzZvs/edit#
2020-02-11 16:33:38 +00:00
Nikolaus Waxweiler
eb77a3be22
[varLib] Fill in the forward-mapped location
2020-02-11 15:45:49 +00:00
Cosimo Lupo
29422a49f3
C_O_L_R_: further simplify decompile
2020-02-11 13:46:45 +00:00
Cosimo Lupo
fb92f228af
C_O_L_R_: simplify toXML
2020-02-11 13:30:20 +00:00
Cosimo Lupo
423274e444
C_O_L_R_test: use ttLib class's decompile/compile methods
2020-02-10 13:47:20 +00:00
Cosimo Lupo
67c97f214a
C_O_L_R_: use OTTableReader and Writer instead of struct to decompile/compile
...
But keep the existing C_O_L_R_ table interface for backward compatibility.
2020-02-10 13:45:44 +00:00
Nikolaus Waxweiler
eaeef05bf0
Update Cython module, remove its internal error ( #189 )
...
Update Cython module, remove its internal error from the public errors module
2020-02-07 13:23:43 +00:00
Nikolaus Waxweiler
3cbd848322
Merge pull request #188 from daltonmaag/errors-refactor
...
Order exceptions hierarchically
2020-02-07 12:34:39 +00:00
Nikolaus Waxweiler
d53583932a
Order exceptions hierarchically
2020-02-07 11:39:37 +00:00
Cosimo Lupo
d4a5e1bf3e
Add C_O_L_R_test.py to check basic compile/decompile of otTables.COLR
2020-02-04 17:15:39 +00:00
Cosimo Lupo
8e48c57a00
otTables: initialize a CountReference for LayerRecordCount in COLR.preWrite
2020-02-04 17:14:52 +00:00
Cosimo Lupo
b32a1072b5
otBase: propagate pre-initialized CountReferences so nested subtable see them
2020-02-04 17:14:12 +00:00
Cosimo Lupo
145bcd62bd
otTables: add COLR subclass to decompile LayerRecordCount before the rest
2020-02-04 17:03:40 +00:00
Cosimo Lupo
e56c0ee1a4
otConverters: BaseGlyphRecordCount and LayerRecordCount are 'propagated' counts
...
ie. they count things inside nested sub-tables
2020-02-04 17:01:31 +00:00