210 Commits

Author SHA1 Message Date
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
Behdad Esfahbod
7ed91eca1e py23 import in all nontrivial source files and unused import cleanup 2013-11-27 15:25:00 -05:00
Behdad Esfahbod
b774f9f684 2to3 --fix=types manual additions
Don't know why the tool didn't catch these.
2013-11-27 14:01:44 -05:00
Behdad Esfahbod
3ec6a25823 2to3 --fix=print with manual fixup 2013-11-27 04:57:33 -05:00
Behdad Esfahbod
ac1b435946 2to3 --fix=idioms 2013-11-27 04:15:34 -05:00
Behdad Esfahbod
97dea0a5d0 2to3 --fix=xrange 2013-11-27 03:34:48 -05:00
Behdad Esfahbod
3a9fd30180 2to3 equivalent to --fix=tuple_params
I hope I got this all right...
2013-11-27 03:30:21 -05:00
Behdad Esfahbod
cd5aad92f2 2to3 --fix=raise 2013-11-27 02:42:28 -05:00
Behdad Esfahbod
180ace6a5f 2to3 --fix=ne 2013-11-27 02:40:30 -05:00
Behdad Esfahbod
2b06aaa2a6 2to3 --fix=import 2013-11-27 02:34:11 -05:00
Behdad Esfahbod
bc5e1cb195 2to3 --fix=has_key 2013-11-27 02:33:03 -05:00
Behdad Esfahbod
66214cbe8c 2to3 --fix=apply 2013-11-27 02:18:18 -05:00
Behdad Esfahbod
3ac9e63fce Load / save FeatureParamSize decipoints values as float 2013-11-26 19:42:55 -05:00
Behdad Esfahbod
9e1bd2d0b4 Implement FeatureParams
All types of FeatureParams are correctly handled now.

The only thing not handled is broken fonts generated with the
old AFDKO that have their FeatureParams offset computed wrong.
I don't currently plan on handling those.

Fixes https://github.com/behdad/fonttools/issues/38
2013-11-26 19:23:08 -05:00
Behdad Esfahbod
1f0eed8459 Minor 2013-11-26 18:41:53 -05:00
Behdad Esfahbod
f4e61ae637 Undo making subReader lazy
Need this for upcoming FeatureParams implementation.
2013-11-26 17:37:03 -05:00
Behdad Esfahbod
79f734414c Further simplify OTTableReader/Writer 2013-11-26 17:07:37 -05:00
Behdad Esfahbod
67eded5efa Remove obsolete comment 2013-11-25 18:23:12 -05:00
Behdad Esfahbod
e0c2e8e2af Fixup extension / longoffset 2013-11-25 05:32:17 -05:00
Behdad Esfahbod
5b9cabcb9a Implement GDEF MarkGlyphSetsDef
Aka. "Mark filtering sets".

Fixes https://github.com/behdad/fonttools/issues/39
2013-11-25 04:01:56 -05:00
Behdad Esfahbod
6b6e9fae23 Rename repeatOffset to aux
To be used for other purposes soon.
2013-11-24 22:11:41 -05:00
Behdad Esfahbod
d58c38dc36 Seprate longOffset from ExtSubTable 2013-11-24 21:58:53 -05:00
Behdad Esfahbod
58acba2d02 Remove "optimization" re Extension lookups
Historically, Extension lookups were only decompiled upon access,
and decompiled Extension lookups were possibly copied verbatim to
output when compiling.  This discrepancy with all other table types
is confusing and undeed.  The possible time saving is not worth the
loss in possible optimization of table data.  Remove.
2013-11-24 20:08:05 -05:00
Behdad Esfahbod
bdc5a99846 Remove unused method 2013-11-24 19:59:07 -05:00
Behdad Esfahbod
c491f45eff Create subReaders lazily
Should improve memory usage
2013-11-24 18:28:20 -05:00
Behdad Esfahbod
e84f9fd1b5 Minor 2013-11-24 18:15:47 -05:00
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