55 Commits

Author SHA1 Message Date
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
ced737e249 Allow ligatures with one component only 2014-06-05 17:03:31 -04: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
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
f6502635b9 Minor 2013-12-17 05:59:05 -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
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
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
b23b4cefda Fix ClassDef
Ouch.  Broke it in 63b257e677993295ee015e02b92ff438a5e91135.
2013-12-07 12:45:28 -05:00
Behdad Esfahbod
650a38fffc Relax some warnings 2013-12-04 22:52:57 -05:00
Behdad Esfahbod
e06166b83a Fix SingleSubstFormat1 modulo math 2013-12-04 22:46:11 -05:00
Behdad Esfahbod
9a980a8d2d Minor 2013-12-04 22:00:31 -05:00
Behdad Esfahbod
43f6e36347 Simplify Coverage table postRead 2013-12-04 21:54:12 -05:00
Behdad Esfahbod
63b257e677 Handle out-of-range glyphIDs in ClassDef 2013-12-04 21:49:00 -05:00
Behdad Esfahbod
dc87372c88 Use True/False instead of 1/0 2013-12-04 21:28:50 -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
83e2f34194 Implement compiling to ClassDef Format=1 2013-12-02 03:06:44 -05:00
Behdad Esfahbod
b7fd2e1913 py23 Remove uses of __cmp__ and cmp() 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
7ed91eca1e py23 import in all nontrivial source files and unused import cleanup 2013-11-27 15:25:00 -05:00
Behdad Esfahbod
c2297cd41d 2to3 --fix=dict with manual cleanup 2013-11-27 14:01:45 -05:00
Behdad Esfahbod
e1d97b8277 2to3 replace use of module new 2013-11-27 14:01:44 -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
e5ca79699d 2to3 --fix=map with manual cleanup 2013-11-27 04:38:16 -05:00
Behdad Esfahbod
ac1b435946 2to3 --fix=idioms 2013-11-27 04:15:34 -05:00
Behdad Esfahbod
fa5f2e85ab 2to3 --fix=zip with manual cleanup 2013-11-27 04:13:15 -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
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
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
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
17700bf926 Handle and warn about out-of-order Coverage table entries
Apparently the SIL Gentium fonts have wrong sorting in Coverage
tables.  That's broken by the spec, but shapers still work with
such fonts.  So, we warn when reading, and when writing, such
out-of-order coverage tables.
2013-11-18 16:05:00 -05:00
Behdad Esfahbod
6e70667659 Support loading broken Coverage tables
Hit by Google Fonts's font "Cabin" for example and a handful
of others.
2013-11-15 17:00:38 -05:00
Behdad Esfahbod
183afe6408 Optimize Coverage.postRead() 2013-08-19 14:16:07 -04:00
jvr
e5b245fd07 added refactoring note
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@548 4cde692c-a291-49d1-8350-778aa11640f8
2008-03-09 21:43:19 +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
31ae380735 fixed problem with empty ClassDef, as well as added some more defenses for possible empty tables
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@484 4cde692c-a291-49d1-8350-778aa11640f8
2005-02-11 19:36:38 +00:00
jvr
1fae9b48d3 [ 637398 ] Failure while parsing OpenType file
Deal with empty Coverage table: it will be None so won't have a .glyphs
attribute.


git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@471 4cde692c-a291-49d1-8350-778aa11640f8
2004-09-25 10:31:29 +00:00
jvr
8e1d75b1a3 ReverseChainSingleSubst support from Yannis H. (must get that generate-otdata-from-the-docs working again)
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@459 4cde692c-a291-49d1-8350-778aa11640f8
2003-09-22 13:12:55 +00:00
jvr
27f108844e this should have been part of the previous path by some fixes from klchxbec
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@450 4cde692c-a291-49d1-8350-778aa11640f8
2003-09-11 07:11:35 +00:00
jvr
257fba7172 make sure Coverage instances have a 'glyphs' attribute
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@379 4cde692c-a291-49d1-8350-778aa11640f8
2003-01-03 20:54:31 +00:00
jvr
a138467da3 deal gracefully with empty coverage tables; fixes bug 611509
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@370 4cde692c-a291-49d1-8350-778aa11640f8
2002-09-24 20:50:57 +00:00
jvr
4845ba5fa5 whoops, reversed key and value
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@363 4cde692c-a291-49d1-8350-778aa11640f8
2002-09-13 12:04:13 +00:00
jvr
f2164abef3 added manual implementation of LigatureSubst to get nicer XML output
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@355 4cde692c-a291-49d1-8350-778aa11640f8
2002-09-12 21:48:03 +00:00
jvr
b2486125e9 added manual implementation of AlternateSubst to get nicer XML output
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@354 4cde692c-a291-49d1-8350-778aa11640f8
2002-09-12 21:21:58 +00:00
jvr
a1dfa2b77a added manual implementation of ClassDef to get nicer XML output as well as to get rid of GlyphID dependencies
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@353 4cde692c-a291-49d1-8350-778aa11640f8
2002-09-12 20:51:09 +00:00