1579 Commits

Author SHA1 Message Date
Cosimo Lupo
f2915e7480
Merge pull request #1706 from dscorbett/splitMultipleSubst
Fix MultipleSubst subtable overflows
2019-09-11 09:53:13 +02:00
Cosimo Lupo
272a156fc3
Merge pull request #1715 from simoncozens/hhea-aliases
[ttLib] Add aliases for renamed entries in hhea table
2019-09-10 16:24:13 +02:00
Cosimo Lupo
4e9fa7a44c
Merge pull request #1708 from madig/name-toStr-equal-toUnicode
name: Remove now unnecessary Python 2 code path
2019-09-10 16:22:54 +02:00
Cosimo Lupo
9938efbef5
Merge pull request #1712 from chrissimpkins/refactor-array-tofromstring
Refactor deprecated array tostring/fromstring methods to tobytes/frombytes
2019-09-10 16:22:04 +02:00
Simon Cozens
6e55f939e3 [ttLib] Add aliases for renamed entries in hhea table
Closes #1714
2019-09-05 12:38:45 +01:00
Chris Simpkins
791f619029 refactor array.tostring to array.tobytes
the array.tostring method is deprecated
2019-08-29 23:21:22 -04:00
Chris Simpkins
12814aa7b1 refactor array.fromstring to array.frombytes
fromstring is a deprecated array method
2019-08-29 22:58:42 -04:00
Nikolaus Waxweiler
811316cd3a Remove now unnecessary Python 2 code path 2019-08-27 15:54:29 +01:00
David Corbett
bb51167fba Fix MultipleSubst subtable overflows 2019-08-24 13:29:53 -04:00
Martin Hosken
52a8ff32d3 Fix Sill table output to pass OTS 2019-08-23 08:46:23 +07:00
Just van Rossum
0ea19f3bd3
[ttLib] allow the glyf table to be incomplete when dumping to XML (#1681)
[ttLib] Allow the glyf table to be incomplete (to not contain everything from the glyph order) when writing to XML. This partially addresses #684 in that it will allow the font Ambrosia.otb to be dumped with ttx (but not recompiled). Log a warning when a glyph is not present.
2019-08-15 18:46:14 +02:00
Nikolaus Waxweiler
01328213c7 Remove __future__ imports 2019-08-09 12:20:13 +01:00
Just van Rossum
5d6f08fd95
[ttLib] fix UnboundLocalError for empty loca/glyph tables (#1680)
* Rename last to pos, and next to nextPos
* make sure nextPos is initialized, to avoid UnboundLocalError on an empty glyf table, partially addressing #684
2019-08-03 13:42:37 +02:00
Cosimo Lupo
7ffd6a3d0f
instancer: minor changes following Evan's review 2019-07-31 16:31:38 +01:00
Cosimo Lupo
1726a4a1fc
Merge remote-tracking branch 'origin/master' into partial-instancer 2019-06-20 15:05:34 +01:00
Cosimo Lupo
84e9ea167a
woff2: allow to recompress woff2 while keeping flavorData
optionally modifying the list of transformed tables
2019-06-19 12:13:14 +01:00
Cosimo Lupo
1c369da8c9
woff2: fix typo 2019-06-19 11:47:32 +01:00
Cosimo Lupo
6ba7c3c9e2
woff2: initialize WOFF2FlavorData from existing WOFFFlavorData
Fixes #1650

A regression was introduced with 3.43.0 when doing pyftsubset --flavor=woff2
and the input font is WOFF 1.0, thus it has a non-None flavorData already
but doesn't define the transformTables attribute.
2019-06-19 11:44:40 +01:00
Cosimo Lupo
6f1d25497a
Merge remote-tracking branch 'origin/master' into partial-instancer 2019-06-18 18:45:47 +01:00
Cosimo Lupo
d21aa29824
instancer: fixes addressing Evan's comments
- changed getCoordWidth method to use all if-stmt, ordered by ret value (0, 1, 2).
- added more info to TypeError message in getCoordWidth method.
- in round/scaleDeltas, chained if statements in one line to avoid writing the loop twice.
2019-06-17 15:18:54 +01:00
Cosimo Lupo
a96d2dba73
woff2: add main() to call 'compress' and 'decompress' subcommands
$ fonttools ttLib.woff2 --help
2019-06-14 18:18:21 +01:00
Cosimo Lupo
65b0609be1
remove redundant table__g_l_y_f.getCoordinates method
just use getCoordinatesAndControls
2019-06-14 11:17:37 +01:00
Cosimo Lupo
18efee2c7b
TupleVariation: rename get{DeltaType,CoordWidth}; do not special-case scalar=0
we still need to branch between the case where coordinates are wrapped in (x, y) tuples or naked floats.
2019-06-14 11:03:38 +01:00
Cosimo Lupo
deaeb909a7
woff2: add support for hmtx transformation
no tests yet

fixup
2019-06-13 18:07:14 +01:00
Cosimo Lupo
0162446f4c
woff2: don't normalize glyf+loca if we aren't transforming them
Also, the TTFont.getGlyphOrder() automatically makes up a dummy
glyph order from the maxp.numGlyphs, we simply need to ensure
'maxp' is decompiled before 'glyf'.

When transforming glyf, the glyf.glyphOrder is guaranteed to
be present (as the glyf table has been already decompiled), so
we don't need to deal with it being missing or incorrect
(hence removed spurious tests).
2019-06-12 18:41:13 +01:00
Cosimo Lupo
c98b71af5c
woff2: add support for unstransformed glyf and loca tables
Fixes https://github.com/fonttools/fonttools/issues/1636
2019-06-11 15:12:27 +01:00
Cosimo Lupo
ff473515a2
g_l_y_f: use '==' instead of 'is' for comparing equality with int literals 2019-06-04 16:16:31 +01:00
Cosimo Lupo
e2c0acf1c2
Merge remote-tracking branch 'origin/master' into partial-instancer 2019-05-29 18:04:54 +01:00
schriftgestalt
47f8d06d9a fix sign of fsType 2019-05-23 17:40:01 +02:00
Cosimo Lupo
27a8ba480d
Merge remote-tracking branch 'origin/master' into partial-instancer 2019-05-15 13:09:19 -04:00
editkid
742ed88b07 Apply intRect to FontBBox to prevent type error 2019-05-09 23:13:15 +12:00
Cosimo Lupo
1041cf90ef
_g_l_y_f: don't return component flags in getCoordinatesAndControls
varLib._GetCoordinates (which this method is copied from) did not return such data either.

The problem with also including component flags in the returned controls
tuple is that different masters may happen to have different component
flags (e.g. if one master has USE_MY_METRICS, another doesn't).
2019-05-03 18:59:32 +01:00
Martin Hosken
ad60ce80a9 Minor fixlet for Sill table 2019-05-03 16:27:13 +07:00
Cosimo Lupo
465d85d3d6
Merge pull request #1597 from silnrsi/bugfix5
Fix unmasked bug from previous typo fix
2019-05-01 18:02:54 +02:00
Martin Hosken
2e7b021237 Fix unmasked bug from previous typo fix 2019-05-01 22:28:05 +07:00
Cosimo Lupo
7b5202cd79
glyf: only recalcBounds once in setCoordinates
glyph.recalcBounds is called unconditionally a few lines below within the same
setCoordinates method, just after setting the new glyph's coordinates.
We don't need to call recalcBounds twice.
Only empty glyphs with numberOfContours == 0 may not have xMin set.
recalcBounds ensure it's set to 0 for those.
2019-04-29 12:51:34 +02:00
Cosimo Lupo
91089b7a1b
glyf: support setting vmtx advance/tsb from phantom points 2019-04-29 12:51:34 +02:00
Cosimo Lupo
f74e82fec5
Merge remote-tracking branch 'origin/master' into partial-instancer 2019-04-29 12:47:37 +02:00
Cosimo Lupo
eb49e464a2
Merge pull request #1586 from silnrsi/bugfix4
Fix typo in silf table
2019-04-23 18:43:15 +02:00
Martin Hosken
5a97d0ace2 Fix typo in silf table 2019-04-23 23:24:25 +07:00
Cosimo Lupo
fe1fb45eff
Merge remote-tracking branch 'origin/master' into partial-instancer 2019-04-20 17:51:56 +01:00
Cosimo Lupo
5a7fe0556f
otTables: set CompCount in LigatureSubst.fromXML
https://github.com/fonttools/fonttools/issues/1584#issuecomment-485140779
2019-04-20 17:45:38 +01:00
Cosimo Lupo
71812bbb29
otBase: call populateDefaults() in BaseTTXConverter.fromXML
https://github.com/fonttools/fonttools/issues/1584

This will initialise to None all the missing fields for top-level OT tables like GPOS or GSUB after importing fromXML
2019-04-20 17:44:47 +01:00
Cosimo Lupo
125bd5186a
TupleVariation: rename {check,get}DeltaType; refactor __iadd__ 2019-04-12 17:01:39 +01:00
Cosimo Lupo
dc99925bee
instancer: always calculate inferred deltas upfront to simplify code
and instead of sumDeltas method, use in-place add operator.
2019-04-04 18:05:11 +01:00
Cosimo Lupo
f220d36df1
instancer: merge TupleVariations left with same axes after pinning
The instantiateTupleVariationStore function now groups TupleVariation
tables that have the same axes 'tents', then merges them into a single
TupleVariation by summing their deltas. The rounding to integer happens
after summing the scaled deltas as floats, to reduce off-by-one errors.

To be able to sum gvar TupleVariation, it needs to calculate the inferred
deltas so it now takes two optional lists (origCoords and endPts) that
are passed on to iup_delta function. These only make sense for gvar
type of TupleVariation, of course, and are unused for cvar tuples.

It also run iup_delta_optimize on the gvar deltas that are left after
partial instancing and whose inferred deltas had to be interpolated.
This can be disabled with --no-optimize CLI option.

Also added calcInferredDeltas and optimize methods to TupleVariation
class, which use functions from varLib.iup module, plus tests
that exercise them.
2019-04-04 15:11:23 +01:00
Cosimo Lupo
a571eee8d6
glyf: setCoordinates must not modify input coord parameter
make a copy instead
2019-04-04 14:15:37 +01:00
Cosimo Lupo
fb914c93c4
Merge remote-tracking branch 'origin/master' into partial-instancer 2019-04-04 14:15:14 +01:00
Cosimo Lupo
aef41419f2
gvar: log the glyph name if any exception is caught when decompiling deltas 2019-04-03 10:54:54 +01:00
Miguel Sousa
ddff29cb5d Fix DeprecationWarning: invalid escape sequence 2019-04-01 14:04:14 -07:00