107 Commits

Author SHA1 Message Date
Behdad Esfahbod
8a17e925bf Revert "[ot] Deprecate, and add properties for, count values"
This reverts commit d8803873f6d4efbcb227867fe0ac6bca370597bc.

The commit wasn't fully correct as it was not installing properties
for counts in format-switching subtables.
2016-01-14 12:55:42 +00:00
Behdad Esfahbod
d8803873f6 [ot] Deprecate, and add properties for, count values
Part of fixing https://github.com/behdad/fonttools/issues/447

Our own modules still set the counts.  Will fix in subsequent
commits.
2016-01-14 12:33:09 +00:00
Behdad Esfahbod
6851f66d18 [ot] Instead of deleting unnecessary Format, set it to None
Fixes https://github.com/typesupply/compositor/issues/7
2016-01-14 10:47:48 +00:00
Behdad Esfahbod
e0d27461be [XML] Assume None where an attribute is missing
This is what the compile() does, so do the same in toXML(), such that
we can save to XML whatever can be saved to binary.  Eg. saving what
we read through XML!

Fixes https://github.com/behdad/fonttools/issues/298
Also relevant to https://github.com/behdad/fonttools/issues/447
2016-01-13 19:05:45 +00:00
Behdad Esfahbod
d992180f1a [otTables] Fix device names after f0eb7e98ca0642f17ac82433db8c957fffd6a9d3 2016-01-13 17:19:29 +00:00
Behdad Esfahbod
f0eb7e98ca [otTables] Don't create a subclass for equivalent types
Before, equivalent types, eg. otTables.BacktrackCoverage, etc,
where a subclass of their equivalent parent type, eg. otTables.Coverage
With this change, they are the same type.

The otBase and otConverters changes were needed to make the above
happen and still generate correct XML for SubTable type.
2016-01-13 16:44:52 +00:00
Behdad Esfahbod
6c4d14dbce Enable writing of Count values that are never set
This can happen with empty MarkMark / MarkBase tables.
2015-12-08 20:41:54 +01:00
Behdad Esfahbod
5133e3777e Undo accidentally commit changes 2015-12-07 15:15:51 +01:00
Behdad Esfahbod
c65c16d3f6 Fix previous commit
Humm, no idea how I had committed it locally before.
2015-12-07 12:05:24 +01:00
Sascha Brawer
d8d5ab2c29 Test OTTableReader.getSubReader()
Also removing unused stats collection. The need for setting up
an object to collect these (unused) stats made it hard to write
tests on code that called OTTableReader.getSubReader().
2015-10-18 00:09:32 +02:00
Sascha Brawer
582852119c Implement OTTableReader.readUShortArray()
There is currently only one single call site in the codebase,
but this function will be needed a lot for parsing `morx` and
other AAT tables.
2015-10-17 06:47:52 +02:00
Behdad Esfahbod
29cc978f43 Improve assertion message 2015-10-15 20:01:56 -03:00
Sascha Brawer
520918375f [otTables] Support uint8 type in otTables 2015-10-16 00:17:22 +02:00
Sascha Brawer
1288a58eb1 Test core functions of OTTableReader and OTTableWriter 2015-10-16 00:05:52 +02:00
Miguel Sousa
a7aef47695 fix "indentation contains mixed spaces and tabs" errors reported by Landscape 2015-08-09 00:33:50 -07:00
Cosimo Lupo
4bfbdc8852 [xmlReader] initialise OTTableWriter instance with self.longOffset = False
Fixes https://github.com/behdad/fonttools/issues/323
2015-07-24 15:55:58 +01:00
Behdad Esfahbod
c7187c3b20 Optimize reading array of GlyphIDs 2015-07-03 01:15:16 -07:00
Behdad Esfahbod
754a20d987 Implement lazy array for loading otData-driven arrays
Speeds up subsetting of GPOS table with many pairs by huge factor
(counted 5).
2015-07-02 18:00:41 -07:00
Behdad Esfahbod
aa9b3b6d43 [ot] Add readArray() and writeArray()
To be used soon to optimize partial / glyph array loading.
2015-07-02 15:01:15 -07:00
Behdad Esfahbod
64f1179230 Minor moving code around in prep for optimization work 2015-07-02 15:01:11 -07:00
Behdad Esfahbod
b30e12ae00 More whitespace 2015-04-26 02:01:01 -04:00
Behdad Esfahbod
bd67253118 Some more whitespace fixes from pep8 tool 2015-04-26 01:59:01 -04:00
Behdad Esfahbod
1ae29591ef from __future__ import absolute_import
Such that our Python 2 is closer to Python 3.

Part of https://github.com/behdad/fonttools/issues/77
2014-01-14 15:07:50 +08:00
Behdad Esfahbod
95f795f40a Move offset overflow fixing logic where it belongs 2013-12-20 21:52:28 -05:00
Behdad Esfahbod
b76d6ff14a [merge] Remove BaseTable.__hash__ need 2013-12-20 20:24:27 -05:00
Behdad Esfahbod
398770d51c [merge] Map GSUB/GPOS feature / lookup indices properly 2013-12-19 15:30:24 -05:00
Behdad Esfahbod
ee6340f475 Only track one parent per Writer
We were not using the extra parents anyway.
2013-12-17 06:31:37 -05:00
Behdad Esfahbod
ab0ca1bd6b Minor simplification 2013-12-17 06:19:15 -05:00
Behdad Esfahbod
6188b5b5f0 Remove unused variable 2013-12-17 06:11:41 -05:00
Behdad Esfahbod
dea08f2ba1 Minor optimization 2013-12-17 06:04:28 -05:00
Behdad Esfahbod
f6502635b9 Minor 2013-12-17 05:59:05 -05:00
Behdad Esfahbod
9e482332ba Fix subtable-split logic
Though, the split logic isn't implemented for GPOS, so I have not
been successful in actually exercising it so far.
2013-12-17 05:46:51 -05:00
Behdad Esfahbod
5fec22bfcd Compute correct LookupType when compiling font
Also ensures that all subtables of a lookup have the same
lookup type.
2013-12-17 02:42:18 -05:00
Behdad Esfahbod
dafdb2933a Further optimize table loading
Again, both faster and more memory efficient
2013-12-17 00:58:02 -05:00
Behdad Esfahbod
b4070bd629 Minor optimization of table loading
Is both faster and more memory efficient.
2013-12-17 00:44:33 -05:00
Behdad Esfahbod
d76fa68785 Allow specifying table type as converter
Needed for upcoming MATH table.
2013-12-09 00:40:24 -05:00
Behdad Esfahbod
6bfee2cde5 Simplify Count writing
Needed for MATH table.
2013-12-09 00:35:15 -05:00
Behdad Esfahbod
273a90074a Return NotImplemented 2013-12-07 03:40:44 -05:00
Behdad Esfahbod
8ea6439d3b Implement __ne__ when __eq__ is defined 2013-12-06 22:25:48 -05:00
Behdad Esfahbod
9e6ef94b55 Use "is None" instead of "== None"
The latter hits the __eq__ method and can fail because we now
do not allow comparing objects of different types.

For example, was failing subsetting Andika-R.ttf.
2013-12-04 16:35:10 -05:00
Behdad Esfahbod
e388db566b py23 Use new-style classes
Such that we get the same semantics in both Python 2 and 3.
2013-11-28 18:53:30 -05:00
Behdad Esfahbod
c0a9d697f6 Simplify read/writeUint24() 2013-11-28 17:32:44 -05:00
Behdad Esfahbod
18316aa769 ps23 More bytes fixes. All ''join()'s fixed 2013-11-28 17:32:43 -05:00
Behdad Esfahbod
821572c9a9 py23 Add bytesjoin() 2013-11-28 17:32:43 -05:00
Behdad Esfahbod
b7fd2e1913 py23 Remove uses of __cmp__ and cmp() 2013-11-28 17:32:42 -05:00
Behdad Esfahbod
960280bbd6 py23 Use more Tag() 2013-11-28 17:32:42 -05:00
Behdad Esfahbod
319c5fd10e py23 introduce byteord() and use it 2013-11-28 17:32:42 -05:00
Behdad Esfahbod
32c10eecff py23 from __future__ import division and adjust divisions 2013-11-28 17:32:42 -05:00
Behdad Esfahbod
30e691edd0 py23 from __future__ import print_function 2013-11-27 17:27:45 -05:00
Behdad Esfahbod
b7a2d797a4 py23 Use bytechr() instead of chr() 2013-11-27 15:25:00 -05:00