176 Commits

Author SHA1 Message Date
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
dc7e6f3e55 2to3 --fix=repr 2013-11-27 02:44:56 -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
7ef23a85ae Add font.lazy 2013-11-24 19:03:18 -05:00
Behdad Esfahbod
3ebfea491e Move fontTools.ttLib.importXML to fontTools.misc.xmlReader
Better matches xmlWriter.
2013-11-24 19:00:59 -05:00
Behdad Esfahbod
38fdae6342 Use True/False instead of 1/0 2013-11-24 18:49:35 -05:00
Roozbeh Pournader
d7921e33d9 Improved support for minimal fonts (with no visible glyphs). 2013-10-08 21:29:22 -07:00
Behdad Esfahbod
805caae0d5 Merge pull request #5 from davelab6/master
New -q for Quiet mode
2013-10-01 15:36:55 -07:00
Behdad Esfahbod
f65033e277 Move xmlWriter into fontTools.misc
Trying to cleanup our footprint in the Python namespace.
2013-09-17 16:41:32 -04:00
Dave Crossland
d7efd5692c Make parsing XML quiet 2013-09-04 14:51:16 +01:00
Dave Crossland
85af40e7d8 Adding quiet mode to xmlImport 2013-09-04 13:30:21 +01:00
Behdad Esfahbod
c4af3964fb Revert "Make GlyphOrder object iterable"
This reverts commit e4a670cc7da93d3a12ba23d8cfefdeb0ec7be01f.

As Read Roberts wrote to me:

"you changed the definition of the GlyphOrder class to take a ttFont as
the argument for the __init__ function, rather than just the
tag, as before, I think so that the glyph order is defined when the
table is instantiated, rather than only when to/fromXML() is called

The problem with this is that the ttx.py compile function passes in a tag,
so compiling a font from an ttx file fails here, and in
xmlImport.startElementHandler(). I discovered this because a number of my
scripts use the same logic. What is the reason for this change? I have no
problem with changing the several FDK scripts that build a new TTF font
from scratch, to pass in the ttFont rather than a tag, but wanted to be
sure that this was necessary. The main issues are that when reading in an
entire TTX file, the table has to be instantiated before the data can be
provided, and the GylphOrder initialization is then different than  for
all the other tables"""

As such revert.  This means that GlyphOrder is again non-iterable.  Will
have to fix in some other way later.
2013-08-28 17:12:12 -04:00
Behdad Esfahbod
d8b32bf6e2 Minor import cleanup 2013-08-19 15:27:14 -04:00
Behdad Esfahbod
e4a670cc7d Make GlyphOrder object iterable 2013-08-19 14:17:11 -04:00
Behdad Esfahbod
400e9539fd Improve import handling
For example trying to run fontTools on Jython or PyPy fails
because they don't have a numpy module.  However, the error
is caught by the getTableModule() and instead DefaultTable
used for tables that use numpy in their implementation.  Fix
that.
2013-08-19 14:17:10 -04:00
Behdad Esfahbod
b0dc6dfc8b Add support for saving WOFF file format 2013-08-19 14:17:02 -04:00
Behdad Esfahbod
58d7416124 Add support for loading WOFF file format 2013-08-19 14:16:49 -04:00
Matt Fontaine
c33b0a22ef Add support for standard EBLC/EBDT embedded bitmaps 2013-08-19 14:15:46 -04:00
jvr
91bca42442 merging fixes & changes from delft-sprint-2012
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@611 4cde692c-a291-49d1-8350-778aa11640f8
2012-10-18 12:49:22 +00:00
pabs3
1344bc9b62 Fix typos: 'neccesary' should be 'necessary'.
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@581 4cde692c-a291-49d1-8350-778aa11640f8
2010-01-09 09:12:11 +00:00
pabs3
7e91e776c9 Apply remainder of #1675210: add support for TrueType Collection (TTC) files.
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@564 4cde692c-a291-49d1-8350-778aa11640f8
2009-02-22 08:55:00 +00:00
jvr
9be387c94f Use sys.byteorder, getting rid of ttLib.endian
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@527 4cde692c-a291-49d1-8350-778aa11640f8
2008-03-01 11:43:01 +00:00
jvr
2545f16b54 Make a hidden feature accessible: optionally ignore decompilation errors,
falling back to DefaultTable, retaining the binary data. It's a bit
dangerous to enable this by default, since it can lead to hiding other
errors or bugs (in the font or fonttools itself).


git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@524 4cde692c-a291-49d1-8350-778aa11640f8
2008-03-01 09:30:17 +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
2e4cc02ca3 BasePen should not fail if a base glyph does not exist in the glyph set; added get() method to _TTGlyphSet class
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@497 4cde692c-a291-49d1-8350-778aa11640f8
2005-03-08 09:50:56 +00:00
jvr
79c1316d65 fixed buglet in GlyphSet support code
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@481 4cde692c-a291-49d1-8350-778aa11640f8
2005-01-24 10:06:45 +00:00
jvr
28ae196229 Refactored and enhanced table order support:
- Rewrote sorting function, it was really quite buggy.
- Added reorderFontTables() functions, which reorders the
  tables in a font at the sfnt level.
- TTFont.save() will now by default rewrite the font in the
  optimized order. This is done through a temp file since
  our dependency checking logic gets in the way of writing
  the tables in a predefined order directly (if table A depends
  on B, table B will always be compiled and written first, so
  this prevents A from showing up in the file before B).

sfnt.py:
- removed closeStream option from SFNTWriter.close(); it's better
  done by the caller (TTFont).


git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@475 4cde692c-a291-49d1-8350-778aa11640f8
2004-11-16 10:37:59 +00:00
jvr
a4f6688ebe tweak & bugfix
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@474 4cde692c-a291-49d1-8350-778aa11640f8
2004-11-16 09:12:30 +00:00
jvr
1cff4cb190 workaround for buggy 2.2 mac support
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@436 4cde692c-a291-49d1-8350-778aa11640f8
2003-08-28 18:23:43 +00:00
jvr
d028b7be3c Set .width in _TTGlyph.__init__ after all: these are just this wrapper
objects, _TTGlyphSet doesn't cache them, so setting .width in .draw()
is confusing to say the least.


git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@430 4cde692c-a291-49d1-8350-778aa11640f8
2003-08-26 19:00:38 +00:00
jvr
6f8f5ded55 fixed AttributeError in _TTGlyphSet.keys()
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@428 4cde692c-a291-49d1-8350-778aa11640f8
2003-08-26 18:19:11 +00:00
jvr
1c9917bcf4 comment typo fix, reflow
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@422 4cde692c-a291-49d1-8350-778aa11640f8
2003-08-25 13:20:38 +00:00
jvr
8df8f6385e TTFont now has a getGlyphSet() method, which will return a generic
GlyphSet. A GlyphSet is simply a dict-like object mapping glyph names
to glyphs. The glyphs in a GlyphSet have a .draw(pen) method and a
.width attribute. This provides a generic interface for drawing glyphs
or extracting outlines, and works both for CFF-based fonts and TT fonts.

See also fontTools.pens.basePen for a description of what makes a Pen
a Pen.


git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@420 4cde692c-a291-49d1-8350-778aa11640f8
2003-08-25 13:15:50 +00:00
jvr
700df03131 - attempted to sort tables in order recommended by spec.
TODO: need to fix table dependency order to complete this.
  (Read: would you mind posting a bug report regarding this?)


git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@406 4cde692c-a291-49d1-8350-778aa11640f8
2003-08-22 19:44:08 +00:00
jvr
0bb3ba5222 some modernizations
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@401 4cde692c-a291-49d1-8350-778aa11640f8
2003-08-22 18:52:22 +00:00
jvr
6ab979caca some (modified) progress bar support
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@294 4cde692c-a291-49d1-8350-778aa11640f8
2002-07-23 16:44:25 +00:00
jvr
9da0f12dec make dynamic table import work when importing from a zip file (for py2exe)
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@277 4cde692c-a291-49d1-8350-778aa11640f8
2002-07-11 18:17:32 +00:00
jvr
d57c4346e5 It still wasn't right; I think the glyph order mess is now sufficiently cleaned up; at least compiling the result of ttdump -x glyf works again.
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@265 4cde692c-a291-49d1-8350-778aa11640f8
2002-05-25 15:28:48 +00:00
jvr
22f068929c make sure the glyph order is loaded when importing XML as the TTX file may not contain it (ttdump -t/ttcompile -i).
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@264 4cde692c-a291-49d1-8350-778aa11640f8
2002-05-25 14:56:29 +00:00
jvr
e5ae28e842 whoops, the new GlyphOrder table stuff broke ttdump -s
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@263 4cde692c-a291-49d1-8350-778aa11640f8
2002-05-25 08:22:22 +00:00
jvr
4e5af60930 CFF/T2 <-> XML roundtripping has begun!
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@254 4cde692c-a291-49d1-8350-778aa11640f8
2002-05-24 09:58:04 +00:00
jvr
0011bb6910 big change: the glyph order is now dumped as a separate table and not as part of glyf (which didn't make much sense to begin with, but can't work at all in the case of CFF...)
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@252 4cde692c-a291-49d1-8350-778aa11640f8
2002-05-23 09:42:45 +00:00
jvr
fe665777ea refactored saveXML() method
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@251 4cde692c-a291-49d1-8350-778aa11640f8
2002-05-22 20:15:10 +00:00
jvr
0ecc433736 ignore tables we don't have upon saving as XML: this is indispensible for batch processing
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@237 4cde692c-a291-49d1-8350-778aa11640f8
2002-05-15 07:50:06 +00:00
jvr
8307fa42cd a whole bunch of renames, purely stylistic
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@226 4cde692c-a291-49d1-8350-778aa11640f8
2002-05-13 16:21:51 +00:00