Paul Linnerud
df429df9ec
TSIC Support for Visual TrueType
...
TSIC is a source table for Visual TrueType to maintain sources for the cvar variation table.
2018-08-22 16:48:42 -07:00
Behdad Esfahbod
05f95f0f58
[otBase] Try ExtensionLookup if other offset-overflow methods fail
...
If offset overflow happens other than between Lookup and SubTable, or
within SubTable, then we don't know how to fix it currently. Now we
try to put that lookup in an Extension lookup anyway, since that will
isolate it and sharing with other lookups won't happen, hopefully
avoiding the overflow.
This is really a bandaid... What we want is the 99proof branch to
be finished and replace our current packing algorithm.
Fixes https://github.com/fonttools/fonttools/issues/1296
2018-07-25 11:06:44 -07:00
Behdad Esfahbod
642cb03296
Remove unused line of code
2018-07-25 11:06:44 -07:00
Cosimo Lupo
6e8e431dee
otTables: try to fix MarkBasePos subtable overflows
...
Fixes https://github.com/googlei18n/fontmake/issues/450
2018-07-19 17:52:00 +01:00
Cosimo Lupo
2798bf6d1f
otTables: print subtable type when can't split in fixSubTableOverFlows
2018-07-19 17:50:43 +01:00
bgermann
d438f15118
Add missing import
2018-06-28 14:07:14 +02:00
Cosimo Lupo
d570fc038a
use otRound when rounding visual coordinates or deltas
...
So we now round towards +Infinity in:
- floatToFixed (which fully examplify that quotes from OT spec)
- psCharStrings: when packing floats as fixed 16.16
- t2CharStringPen: when rounding coordinates and advance widths
- subset: when rounding advance widths to compute average
- TupleVariation: rounding gvar deltas
- _g_l_y_f: when rounding coordinates: both in GlyphComponent.{x,y}
and for GlyphCoordinates.toInt()
- _h_m_t_x: for rounding horiz/vert metrics
- varLib: rounding horiz metrics and deltas
2018-06-14 17:40:11 +01:00
Cosimo Lupo
846941c8ef
[glyf] ensure GlyphCoordinates never overflow
...
in _checkFloat (used whenever we're about to update the inner array) we check whether the value exceeds a short integer, and if so we convert the array to floats.
Also, we make sure we call __setitem__ (which in turn calls _checkFloat) instead of updating the inner array directly in the rest of the math methods.
2018-06-07 12:53:42 +01:00
Cosimo Lupo
ca92b172f5
ttFont: allow to build glyph order without post nor cmap, just maxp.numGlyphs
...
could be useful to read in incomplete sfnt fonts e.g. containing only GPOS or GSUB tables
and a bare maxp table with the numGlyphs
2018-05-06 15:33:18 +01:00
Jens Kutilek
ae4472860f
No need to use .keys()
2018-05-04 13:37:59 +02:00
Jens Kutilek
4a16d1839d
Add __len__ method to TTFont._TTGlyphSet
2018-05-04 13:12:18 +02:00
Behdad Esfahbod
795f2f95fb
[otBase] Fix sharing of tables referred to by different offset sizes
...
When an offset refers to a table, we keep the size of the offset to
the referred-to table. When sharing tables, we were ignoring this,
which could result in a long offset being written out as a short, or
vice versa. Fix it by not sharing such tables. This is not optimal
but fixes the bug.
Bug has been there forever.
2018-04-25 20:57:19 -07:00
Behdad Esfahbod
95838bd4df
[otBase] If decoding tables fails, append breadcrumb to exception
2018-04-25 15:53:43 -07:00
Cosimo Lupo
dde854d285
Allow decompiling bad ClassDef tables with invalid format
...
Fixes https://github.com/fonttools/fonttools/issues/1235
2018-04-13 12:58:29 +02:00
Andy Zickler
1e2ee8e15e
Add context guard to ttfont
2018-04-03 18:08:52 -04:00
Cosimo Lupo
6b6c34ab1a
otTables: fix IndexError while pruning of HVAR pre-write
2018-04-03 10:28:27 +01:00
Behdad Esfahbod
d3a6a4e9e4
Don't fail during ValueRecord copy if src has more items
...
We drop hinting by simply changing ValueFormat, without cleaning
up the actual ValueRecords. This was causing failure at this assert
if font was subsetted without hinting and then passed to mutator.
2018-03-26 12:54:57 -07:00
Cosimo Lupo
e02055e070
[sfnt] TTCTag is a str
...
https://github.com/fonttools/fonttools/issues/1207
2018-03-06 10:46:01 +01:00
Cosimo Lupo
d46444acb4
[glyf] use . to separate glyph name from table tag in -g mode
2018-03-01 11:57:45 +00:00
Cosimo Lupo
6473cc9349
add more tests for userNameToFilename function
...
plus minor whitespace
2018-02-28 12:26:52 +00:00
Cosimo Lupo
232e2b8467
Revert "Merge pull request #1130 from anthrotype/temp-revert-split-glyphs"
...
This reverts commit 060f856f92e0fb2d8e60f6be080c89c08528bacb, reversing
changes made to 1e42224af741fac73e20f7193d8115cfda7d3594.
2018-02-28 11:24:19 +00:00
Behdad Esfahbod
54fd71f73c
[varLib/subset] Fix subsetting of GPOS variation data
...
Was not picking up ValueRecord Device objects. Ouch!
2018-02-27 18:52:07 -08:00
Chris Simpkins
5f36f03311
[ttFont] fixes xmlWriter import error in _saveXML method with ttx split tables requests
2018-02-21 12:33:01 -05:00
Behdad Esfahbod
073227bbb0
[varLib.varStore] Start implementing a VarStore optimizer
...
Commandline takes varfont and optimizes its GDEF VarStore.
2018-02-20 20:58:18 -08:00
Behdad Esfahbod
38a0ffb815
Accept old version of HVAR XML
...
21cbab8ce9 (commitcomment-27649836)
2018-02-20 17:42:49 -08:00
Behdad Esfahbod
ef5c9cb2ab
Fix pruning of HVAR pre-write
2018-02-18 22:59:43 -08:00
Behdad Esfahbod
21cbab8ce9
Fix read/write of VarIdxMap to use glyph names
...
Was relying on glyph IDs. Ouch.
2018-02-18 22:33:32 -08:00
Behdad Esfahbod
67814fd3b3
[subset] Prune GDEF VarStore
...
Mostly fixes https://github.com/fonttools/fonttools/issues/1179
2018-02-18 19:20:00 -08:00
Cosimo Lupo
e7494cba5b
[sfnt] restore backward compat with 'numFonts' on SFNTReader instance
...
Fixes #1181
2018-02-16 18:15:52 +00:00
Cosimo Lupo
5682693a3e
[ttCollection] don't seek(0) when writing to possibly unseekable strems
...
see 0daed6eb59 (r27608260)
2018-02-16 18:02:05 +00:00
Behdad Esfahbod
87aa1d229e
[aat] Remove wrong assumption
...
Fixes https://github.com/fonttools/fonttools/issues/1055
2018-02-07 12:35:39 -05:00
Behdad Esfahbod
4fec016862
[cff] Fix calcBound when seac-like components happen in endchar
...
I'm also unimpressed by the copy-pasted bounds logic in hhea and vhea,
and the fact that that's coded in there instead of calling a function
on CFF / glyf tables respectively.
2018-01-26 17:41:53 -08:00
Behdad Esfahbod
c99a731adb
[ttc] Implement saveXML()
2018-01-25 17:50:03 -08:00
Behdad Esfahbod
f82128f25d
Kill progress argument
...
Fixes https://github.com/fonttools/fonttools/issues/1008
Doesn't touch xmlReader / xmlWriter modules.
2018-01-25 17:30:23 -08:00
Behdad Esfahbod
370368d8c2
[ttc] Implement table sharing in save()
2018-01-25 17:08:30 -08:00
Behdad Esfahbod
fb77bd0b0c
[ttc] Don't close file, we need it if lazy reading
2018-01-25 16:55:40 -08:00
Behdad Esfahbod
de54c280cc
[ttc] Fix saving
2018-01-25 16:48:13 -08:00
Behdad Esfahbod
0daed6eb59
[ttc] Implement TTCollection.save()
...
Doesn't share tables currently.
2018-01-25 15:33:30 -08:00
Behdad Esfahbod
bd06ecce7c
[ttc] Towards saving TTCs, prep work
2018-01-25 15:08:31 -08:00
Behdad Esfahbod
764e27556d
[ttc] Move tag check
2018-01-25 14:50:46 -08:00
Cosimo Lupo
1c5e892894
revert closeStream to try fix failing pypy tests
...
reverts commit 28cf254c
2018-01-24 15:41:19 -08:00
Behdad Esfahbod
49b6004040
Move TTFont into fontTools.ttLib.ttFont
...
Users can still import TTFont from fontTools.ttLib. It was for
cleaning up only.
2018-01-23 16:12:46 -08:00
Behdad Esfahbod
76ba3b423f
[ttc] Move to fontTools.ttLib.ttCollection
...
TTCollection can still be imported from fontTools.ttLib.
2018-01-23 15:46:51 -08:00
Behdad Esfahbod
28cf254c24
[TTFont] Remove explicit closeStream
...
Not needed. Python takes care of closing files for us just fine.
2018-01-23 14:22:19 -08:00
Behdad Esfahbod
759c021aab
[sfnt] Minor
2018-01-23 13:49:49 -08:00
Behdad Esfahbod
3635926341
[ttc] Drop tableCache from SFNTReader
...
We just need it in TTFont layer itself.
2018-01-23 13:44:56 -08:00
Behdad Esfahbod
1c25445e7b
[ttc] Remove hash hack
2018-01-23 13:44:56 -08:00
Behdad Esfahbod
c2d5d87a7c
[ttc] Implement minimal list-like methods
2018-01-23 13:44:56 -08:00
Behdad Esfahbod
22c971aa99
[ttc] Implement object-sharing in TTC loading if sharedTables=True
2018-01-23 13:44:56 -08:00
Behdad Esfahbod
233e46ca38
[ttc] Add fontTools.ttLib.TTCollection()
...
Opens TTC files, no object sharing.
2018-01-23 13:44:56 -08:00