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.
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.
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
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
- 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
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
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
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