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
Behdad Esfahbod
524b62a1b2
Add fontTools.ttLib.sfnt.readTTCHeader()
2018-01-23 13:44:56 -08:00
Cosimo Lupo
f62f79eb23
otConverters: don't write XML comment if NameID value is 0 == NULL
...
Fixes https://github.com/fonttools/fonttools/issues/1151
2018-01-19 13:25:59 +00:00
Cosimo Lupo
bc0480e19e
[sbix] fix TypeError when += str and bytes
...
Fixes #1145
There's probably more... we'll see once we have some data from chromacheck fonts to proper test this with
2018-01-11 20:15:58 +00:00
Cosimo Lupo
c42749466a
[S_V_G_] fix dumping toXML SVG tables containing colorPalettes
...
As reported by glukfonts in
https://github.com/fonttools/fonttools/issues/1124
2018-01-03 15:40:35 +00:00
Cosimo Lupo
56a84ae905
Temporarily revert PR #1035 bamidei/split_g_l_y_f_to_one_per_file
...
The split-glyf-to-one-glyph-per-file feature is only partially implemented,
as it was discussed here:
https://github.com/fonttools/fonttools/issues/153#issuecomment-346677171
I need to cut a bugfix release today, but I don't want to ship this as is.
I prefer to temporarily rever, tag a release from master branch, then
revert it again to its present state so that bamidei can complete his
work.
---
Revert "[glyf] make splitGlyphs output more compact"
This reverts commit d08d635a93289982b028aacd3b9039fbe742f3e8.
Revert "more whitespace"
This reverts commit bd030f61c6b360fd360632bbc6c19abb057c9a24.
Revert "minor whitespace"
This reverts commit f2a8c787b13b92ae0e0f61477e584316144747c7.
Revert "Merge pull request #1035 from bamidei/split_g_l_y_f_to_one_per_file"
This reverts commit 17b89d9dde7691dbbb6815efba92eff446af62ac, reversing
changes made to b8482d9666f08d3603ee93d3ca52931550f715fc.
2017-12-18 12:00:43 +00:00
Cosimo Lupo
1e42224af7
[cmap] when compiling format6 subtable, don't assume gid0 is always called '.notdef'
2017-12-15 13:56:48 +00:00
Behdad Esfahbod
1aafae816d
Allow decompiling fonts with bad Coverage format number
2017-12-14 19:03:54 -08:00