32 Commits

Author SHA1 Message Date
Behdad Esfahbod
0fac7fe320 Remove unused parameter 2013-11-24 18:15:47 -05:00
Behdad Esfahbod
ee27eb8517 Only propagate counts that are used in sub-tables 2013-11-24 18:15:47 -05:00
Behdad Esfahbod
2edc2da303 Use tableDict for DeltaValue lookbacks
Was abusing the set/getCount machinery before.
2013-11-24 17:10:55 -05:00
Behdad Esfahbod
078b36325d Instead of countVars, pass down tableDict
This is the tableDict of current struct being loaded.  This does NOT
get propagated down.

Currently unused.
2013-11-24 17:08:06 -05:00
Behdad Esfahbod
7981704a0a Move countVars into reader/writer objects
The countVars arguments are all unused now.  Cleanup coming.
2013-11-24 16:59:42 -05:00
Behdad Esfahbod
6f9b64f296 Fixup 41caf2d for DeltaValue tables
Not that I can find any fonts having these... Had to construct one
to test.
2013-11-24 16:09:57 -05:00
Behdad Esfahbod
24f978ccc6 Fixup 41caf2d
Lexical binding...

Fixes https://github.com/behdad/fonttools/issues/40
2013-11-24 15:09:49 -05:00
Behdad Esfahbod
601bb94afc Minor
Followup for 6e556aafc3be5ccf48a01d8113313abd2a633ba6.
2013-11-23 20:20:39 -05:00
Behdad Esfahbod
3879cf9439 Use slots for OTTableReader
Slight performance gain even.
2013-11-22 19:34:57 -05:00
Behdad Esfahbod
6e556aafc3 Make ValueRecordFactory() immutable
Gives another 3% speedup.
2013-11-22 19:34:46 -05:00
Behdad Esfahbod
41caf2dea1 Remove tableStack in favor of countVars
We only needed tableStack to look back for counts.  So, just store
counts.  Gives ~8 speedup for large fonts I tested.  We are not
faster than not loading fonts lazily without this patch, so the
laziness patch combined with this doesn't have a net negative
performance impact anymore.
2013-11-22 19:13:14 -05:00
Behdad Esfahbod
0585b64f70 Minor 2013-11-22 16:46:03 -05:00
Behdad Esfahbod
d01c44a59b When lazy-loading tables, copy ValueFormat
Otherwise it may be overwritten before we use it.
2013-11-22 15:21:41 -05:00
Behdad Esfahbod
f50d0dff86 Load all OpenType sub-structures lazily
Huge win for subsetter and anyone else who doesn't need the entire
tables.  Subsetting a huge font (eg. NotoSans-Regular.ttf) to a
small set (say, main Cyrillic characters) is something like six
times faster now.  Bulk of time was being spent in blowing up the
GPOS kerning pairs and attach points.  Now we don't load those if
they won't be in the final subset.

Slight slowdown for usecases that need the entire table.
2013-11-20 19:07:08 -05:00
Behdad Esfahbod
5988cc32cb Make BaseTable a new-style object 2013-11-19 17:40:46 -05:00
Behdad Esfahbod
0ba7aa7ab5 Make __cmp__() functions stable 2013-10-28 12:07:15 +01:00
Behdad Esfahbod
96b321c8ae Fix comparison to arbitrary objects 2013-08-19 14:17:11 -04:00
Matt Fontaine
65499c1042 Minor improvement to TableStack
Push/pop on the end side, which should be faster.
2013-08-19 14:16:06 -04:00
jvr
ce47e0d978 minor fix: one zero too many in assert
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@547 4cde692c-a291-49d1-8350-778aa11640f8
2008-03-09 20:48:45 +00:00
jvr
1c73452692 fixed some comment typos
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@545 4cde692c-a291-49d1-8350-778aa11640f8
2008-03-09 20:13:16 +00:00
jvr
823f8cd15f Misc patches from rroberts:
fontTools/ttx.py
  # support virtual GIDs, support handling some GSUB offset overflows.

fontTools/ttlib/__init__.py
# 1) make getReverseGlyphMap  a public function; I find a reverse map
to often be useful
# 2) support virtual glyphs, e.g. references to GID's that are not in the font.
# Added the TTFont argument allowVID (default 0) to turn this off and on;
# added the arg requireReal ( default 0) so as to get the obvious
default behaviour when
# allowVID is 0 or 1, but to allow requiring a true GID when allowVID is 1.

fontTools/ttlib/tables/otBase.py
fontTools/ttlib/tables/otConverters.py
fontTools/ttlib/tables/otData.py
fontTools/ttlib/tables/otTables.py
# 1) speed optimization
# - collapse for loops
# - do not decompile extension lookups until a record is requested
from within the lookup.
# 2) handling offset overflows
# 3) support of extension lookups
# 4) Fixed FetauresParam converter class def so as to survive a font
that has this offset non-NULL.
# This fixes a stack dump.
# The data will now just get ignored


git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@511 4cde692c-a291-49d1-8350-778aa11640f8
2006-10-21 14:12:38 +00:00
jvr
3a6aa2359e tweaked doc string
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@445 4cde692c-a291-49d1-8350-778aa11640f8
2003-09-02 19:23:13 +00:00
jvr
52966bb144 minor refactoring
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@340 4cde692c-a291-49d1-8350-778aa11640f8
2002-09-12 16:45:48 +00:00
jvr
f7ef96ccca refactored slightly to make later specializations easier
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@330 4cde692c-a291-49d1-8350-778aa11640f8
2002-09-10 19:26:38 +00:00
jvr
4105ca0b95 reordered/regrouped some methods for clarity
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@288 4cde692c-a291-49d1-8350-778aa11640f8
2002-07-23 08:43:03 +00:00
jvr
8e48312f88 don't use __len__ for arbitrary length method
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@287 4cde692c-a291-49d1-8350-778aa11640f8
2002-07-23 08:19:38 +00:00
jvr
24d79cb026 duh, I don't even _need_ to track referers with the current scheme
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@285 4cde692c-a291-49d1-8350-778aa11640f8
2002-07-22 22:39:10 +00:00
jvr
f8f2a36927 minor changes
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@284 4cde692c-a291-49d1-8350-778aa11640f8
2002-07-22 22:22:47 +00:00
jvr
cfadfd0096 completely revamped optimization strategy: now even _shrinks_ certain Adobe and MS OTL tables.
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@283 4cde692c-a291-49d1-8350-778aa11640f8
2002-07-22 22:13:57 +00:00
jvr
e69caf8771 more cosmetics
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@227 4cde692c-a291-49d1-8350-778aa11640f8
2002-05-13 18:08:19 +00:00
jvr
64b5c80e80 results of morning-after code review, added some doc strings, etc.
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@210 4cde692c-a291-49d1-8350-778aa11640f8
2002-05-11 10:21:36 +00:00
jvr
d4d151390d Completely revamped OT support; this time it works and is complete. XML output is not yet as pretty as can be.
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@208 4cde692c-a291-49d1-8350-778aa11640f8
2002-05-11 00:59:27 +00:00