400 Commits

Author SHA1 Message Date
Jens Kutilek
2aa0e9e524 Rename imports in _s_b_i_x.py 2014-09-19 16:21:23 +02:00
Jens Kutilek
c1378d345b Rename sbixBitmap to sbixGlyphData 2014-09-19 16:21:03 +02:00
Jens Kutilek
484fe4d11d Rename sbixBitmapSet to sbixStrike 2014-09-19 16:16:17 +02:00
Behdad Esfahbod
319643ade2 Fix up regression in promoting lookups to extensions
Was broken by 6ed2eb409231a7fe3e0c2a135f9a89796206f639

Fixes https://github.com/behdad/fonttools/issues/110
2014-02-20 16:31:15 -05:00
Behdad Esfahbod
a36c74e8b8 Add logic for keeping PUSHB/PUSHW distinction
And avoid merging consequent pushes.  No option to control this
externally right now, but the logic is there.

Part of https://github.com/behdad/fonttools/issues/92
2014-01-19 17:30:19 +08: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
42d305a824 Further adjustment 2013-12-17 05:10:30 -05:00
Behdad Esfahbod
fcc56e637a Choose most compact representation when writing PUSH instructions
Can use some testing...
2013-12-17 05:06:37 -05:00
Behdad Esfahbod
965c87fb4a When disassembling, merge multiple PUSH ops
Fonts typically have multiple consecutive PUSHB / PUSHW
operators.  Merge them in the disassembled output.

This, for now, generates worse assmebly because all PUSHB's
grouped with PUSHW's now generate as PUSHW.  Followup fix
will address that.
2013-12-17 04:19:14 -05:00
Behdad Esfahbod
ce84d3215e Generate PUSH mnemonic for PUSHB/NPUSHB/PUSHW/NPUSHW
Reduces XML noise while reenabling the optimization
during assembly.

Fixes https://github.com/behdad/fonttools/issues/73
2013-12-17 04:02:10 -05:00
Behdad Esfahbod
3714c78c92 When writing PUSH instructions, obey requested opcode
Previously fonttools was choosing between the optimal opcode
from PUSHB, NPUSHB, PUSHW, and NPUSHW.  We now respect
whatever was requested and err if the format doesn't support
the data.

Morevoer, if the number of numbers to push is more than 255,
we add multiple push instructions to push all the numbers.

Finally, add a new pseudo-opcode "PUSH" that automatically
chooses the best format.

This, by itself, reduces roundtrip noise by not optimizing
the bytecode as it was before.  In a followup commit I'll
change the bytecode disassembler to always produce PUSH
in the textual instructions instead of the four variants.
That way, we get both the optimization during assembling,
and reduced noise in XML.

Part of https://github.com/behdad/fonttools/issues/73
2013-12-17 04:00:01 -05:00
Behdad Esfahbod
e93e29125f Don't write Format for Coverage, ClassDef, Single/Alternate/LigatureSubst
The format values for those are automatically handled in
postRead/preWrite to choose optimal format.  As such, don't write them
in XML.  Reduces noise.

Part of https://github.com/behdad/fonttools/issues/73
2013-12-17 03:06:10 -05: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
ea82d6dfd1 Handle NULL coverage table in ligature substitute
Just to be in line with Single and Alternate subst.
2013-12-17 01:58:26 -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
43d7ac16b1 py23 Similar encoding fix in post table 2013-12-16 00:05:14 -05:00
Behdad Esfahbod
9041c2ddcd Actually add M_A_T_H_.py 2013-12-09 02:04:57 -05:00
Behdad Esfahbod
f952a22af7 Implement MATH table
Fixes https://github.com/behdad/fonttools/issues/67
2013-12-09 00:40:48 -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
Denis Jacquerye
871495aff5 Add support for FontForge time stamp table
Fixes https://github.com/behdad/fonttools/issues/56
2013-12-08 19:32:21 -05:00
Behdad Esfahbod
6d658cf0ea Minor 2013-12-07 16:06:10 -05:00
Behdad Esfahbod
b23b4cefda Fix ClassDef
Ouch.  Broke it in 63b257e677993295ee015e02b92ff438a5e91135.
2013-12-07 12:45:28 -05:00
Behdad Esfahbod
1a4f96b787 Remove total_ordering
Upon studying further, we don't need it.  Since we only expect
comparing objects of the same type, just having __lt__ is enough.
2013-12-07 12:17:32 -05:00
Khaled Hosny
9c573019d5 Fix compiling back Times New Roman font
This has been broken since f2c2b4d38bd7bba23db71936262db984e4b7aebb,
assigning a new object to a function argument will not change the
original one, so we need to return the modified list.
2013-12-07 12:08:09 -05:00
Behdad Esfahbod
273a90074a Return NotImplemented 2013-12-07 03:40:44 -05:00
Behdad Esfahbod
56da965344 Add @total_ordering to classes with __lt__ 2013-12-07 03:35:16 -05:00
Behdad Esfahbod
8ea6439d3b Implement __ne__ when __eq__ is defined 2013-12-06 22:25:48 -05:00
Behdad Esfahbod
98753abb91 Update table list for sbix 2013-12-06 19:55:29 -05:00
Behdad Esfahbod
de85e4599f 2to3 sbix code
This seems to work now.

At some point we should go back and clean up and merge datastructures
between the four different color font formats.
2013-12-06 19:53:28 -05:00
Behdad Esfahbod
1b8cde1b6f Fix imports 2013-12-06 19:41:49 -05:00
Behdad Esfahbod
4801a3ae39 Whitespace 2013-12-06 19:40:00 -05:00
Behdad Esfahbod
f1394f3fdd Initial sbix support from Jens Kutilek 2013-12-06 19:35:09 -05:00
Behdad Esfahbod
d0a85754fe Remove unused data 2013-12-06 17:56:28 -05:00
Behdad Esfahbod
1112495ae5 Simplify mac_epoch_diff 2013-12-06 17:56:09 -05:00
Behdad Esfahbod
65d3a02d16 Simplify date parsing 2013-12-06 17:47:14 -05:00
Behdad Esfahbod
b8e1afa809 Use struct format 'Q' to read/write 64bit integers 2013-12-06 17:26:09 -05:00
Behdad Esfahbod
5e36f854aa Remove redundant code 2013-12-06 17:16:57 -05:00
Behdad Esfahbod
650a38fffc Relax some warnings 2013-12-04 22:52:57 -05:00