Behdad Esfahbod
bd67253118
Some more whitespace fixes from pep8 tool
2015-04-26 01:59:01 -04:00
Behdad Esfahbod
b9ac90a8f9
[GX] Add 'fvar' table support
...
I might change the table format in the future, but it's functional now.
2015-03-11 15:29:35 -07:00
Behdad Esfahbod
730bedd3d1
[AAT] Add support for 'feat' table
...
Reusing the otData machinery.
See discussion at:
https://github.com/behdad/fonttools/issues/178
https://github.com/behdad/fonttools/pull/180
2014-09-30 19:04:16 -04:00
Behdad Esfahbod
5dd64deacb
[otData] add ULong types
...
In preparation for implementing AAT tables (slowly).
2014-09-30 18:55:57 -04:00
Behdad Esfahbod
d65b587708
Minor
2014-06-05 17:58:15 -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
6ed2eb4092
Write LookupType as a comment
...
We compute LookupType from the type of the subtables, so write it out
as an informative comment in XML as opposed to an element.
2013-12-17 02:57:29 -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
d76fa68785
Allow specifying table type as converter
...
Needed for upcoming MATH table.
2013-12-09 00:40:24 -05:00
Behdad Esfahbod
3fa26d783f
py23 Use fixedToFloat() for fixed version numbers
2013-11-28 18:53:30 -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
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
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
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
cb4adf6828
Fix XML->ttf for fonts that have some missing anchors, etc
...
Eg. EBGaramond12-Regular.ttf. It has a base anchor missing.
Dropping the empty table from XML changes the size of the base
anchor array, which will then result in an assertion because
all bases should have the same array length.
Fixes many other broken fonts too.
2013-11-26 18:55:23 -05:00
Behdad Esfahbod
2f2fd9ca7c
Minor
2013-11-26 18:43:43 -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
e0c2e8e2af
Fixup extension / longoffset
2013-11-25 05:32:17 -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
fe67e3121e
Simplify ExtSubTable
2013-11-24 21:35:56 -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
7ef23a85ae
Add font.lazy
2013-11-24 19:03:18 -05:00
Behdad Esfahbod
c491f45eff
Create subReaders lazily
...
Should improve memory usage
2013-11-24 18:28:20 -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
7d130307e6
Simplify converter mapping for DeltaValue
2013-11-24 16:13:00 -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
ffc3cfeed1
Allow using binary / octal / hex numbers in XML
...
In OpenType Layout tables that is. Most (all) of the other
tables already use safeEval() which accepts these kinds of
things.
2013-11-23 20:18:24 -05:00
Behdad Esfahbod
a221a57ccd
Improve Version handling
...
Version is really just a major.minor, NOT a Fixed. But it has
been implemented as Fixed. We now:
1. Check that major is 1,
2. If minor is not 0 (only defined for GDEF so far), then
print the whole thing as hex in XML,
3. When reading the XML, accept hex,
4. In all four methods dealing with Version, support both
fixed version (ie. 1.0), and long version (ie. 0x00010000).
2013-11-23 19:45:29 -05:00
Behdad Esfahbod
0b18ef6111
Remove Fixed vs fixed32 inconsistency
2013-11-23 19:21:24 -05:00
Behdad Esfahbod
ea017bd66f
Remove USHORT vs uint16 inconsistency
2013-11-23 19:19:48 -05:00
Behdad Esfahbod
5962268b79
Remove unused "LONG" converter
...
LONG was replaced by Fixed long time ago.
2013-11-23 19:18:53 -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