2071 Commits

Author SHA1 Message Date
jvr
28afd331e1 initialize data to empty string instead of list
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@539 4cde692c-a291-49d1-8350-778aa11640f8
2008-03-04 15:34:54 +00:00
jvr
91ff4fdfda ar.typecode() doesn't exist in numpy, but then again, this was overkill
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@538 4cde692c-a291-49d1-8350-778aa11640f8
2008-03-04 15:34:22 +00:00
jvr
1b7d54fedc converted usage of Numeric to numpy
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@537 4cde692c-a291-49d1-8350-778aa11640f8
2008-03-04 15:25:27 +00:00
jvr
f5e9825454 note this file is deprecated
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@536 4cde692c-a291-49d1-8350-778aa11640f8
2008-03-04 15:04:09 +00:00
jvr
ccaf0376d6 removed some redundant imports
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@535 4cde692c-a291-49d1-8350-778aa11640f8
2008-03-04 15:02:45 +00:00
jvr
b018bf7120 the gasp portion of patch 1675210: support for ClearType
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@529 4cde692c-a291-49d1-8350-778aa11640f8
2008-03-01 16:43:24 +00:00
jvr
212ea14706 fixed oversight in sys.byteorder transition
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@528 4cde692c-a291-49d1-8350-778aa11640f8
2008-03-01 15:31:01 +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
2db352c748 - skip subtables of length zero
- minor tweak in cmap 4 logic
contributed by rroberts


git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@523 4cde692c-a291-49d1-8350-778aa11640f8
2008-02-29 14:43:49 +00:00
jvr
8633195104 fixed problem with private VTT table, found by Peter Bilak
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@522 4cde692c-a291-49d1-8350-778aa11640f8
2008-02-19 18:49:14 +00:00
pabs3
9728601b44 Fix 1762552: traceback on amd64 with DejaVuSans.ttf
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@514 4cde692c-a291-49d1-8350-778aa11640f8
2007-11-14 07:06:39 +00:00
jvr
4acb76de2e added 'support' for OS/2 version 4: can anyone verify this is correct? I can't seem to find an OS/2 v4 spec...
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@513 4cde692c-a291-49d1-8350-778aa11640f8
2007-10-22 09:31:02 +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
d299b55d14 patches from rroberts:
# 1) Switched to using Numeric module arrays rather than array modules arrays,
#  because of a memory leak in array.array when handling elements > 1 byte.
# 2) speed optimizations:
# -  For loops are collapsed when possible
# - the data for a subtable is parsed only if a mapping value is requested
# - if two subtables share the same data offset, then on
decompilation, they will
# share the same cmap dict, and not get decompiled twice. Same for compiling.
# - as before, two tables with the same contents will get compiled to a single
# data block in the font.
# 3) added  (self.platformID, self.platEncID) == (3, 10) to the list
of subtables that
# get Unicode comments.
# 4) allow item reference by GID as well as by name. I did this when
experimenting to see if using GID references only would speed the
compile; it didn't but it seemed useful enough to leave in.
# 5) Fixed compile to/from XML: for cmap type unknown ( aka cmap
format 10, in practice.)


git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@510 4cde692c-a291-49d1-8350-778aa11640f8
2006-10-21 13:54:30 +00:00
jvr
bc6e55b31e Speed optimizations from rroberts
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@508 4cde692c-a291-49d1-8350-778aa11640f8
2006-10-21 13:29:47 +00:00
jvr
4cc0051c08 Some non-official OT tables from rrboerts. He wrote:
There are also some new files, for SING glyphlet support, that you
may or may not want to add, because they are not in the OpenType spec.

M_E_T_A_.py # SING glyphlet meta data table. see
'http://partners.adobe.com/public/developer/opentype/gdk/topic.html"
S_I_N_G_.py # SING glyphlet basic info. See same web site as for META
data table.

G_M_A_P_.py # Summary of sing glyphlet info that has been stuck into
a parent font. Not documented anywhere yet.
G_P_K_G_.py # Opaque wrapper for SING glyphlet info; travels with
application document. Is also stuck into augmented parent font. Not
documented anywhere yet


git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@507 4cde692c-a291-49d1-8350-778aa11640f8
2006-10-21 13:27:25 +00:00
fcoiffie
3a3721cb1c In some bad fonts, kern table is incomplete (it only contains a version number). In this case, the code accept a table without kernTables.
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@504 4cde692c-a291-49d1-8350-778aa11640f8
2006-01-25 15:24:37 +00:00
fcoiffie
dc66e7e118 LTSH length can be different of numGlyphs as the table length must be 4-bytes aligned (assertion changed to (len(data) % numGlyphs) < 4)
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@503 4cde692c-a291-49d1-8350-778aa11640f8
2006-01-25 15:21:22 +00:00
fcoiffie
83f069d66c The dates are stored in 8-bytes fields (Microsoft reference document) but Macintosh dates are only coded with 4-bytes. In some fonts, these date fields are badly coded and 8-bytes are used. So, a ValueError occurs.
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@502 4cde692c-a291-49d1-8350-778aa11640f8
2006-01-25 15:12:14 +00:00
fcoiffie
04985bfdde Unsigned long data field must be packed with "L" instead of "l" (sometimes an OverflowError can occur)
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@501 4cde692c-a291-49d1-8350-778aa11640f8
2006-01-12 14:04:40 +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
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
7afc6b989c uh, and the other one
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@482 4cde692c-a291-49d1-8350-778aa11640f8
2005-01-24 10:18:58 +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
1ed5b4746d fixed 2.4 compat issue
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@480 4cde692c-a291-49d1-8350-778aa11640f8
2005-01-24 10:05:52 +00:00
jvr
f34c6f3937 fix for new 2.4 hex() behavior
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@478 4cde692c-a291-49d1-8350-778aa11640f8
2004-12-24 16:07:01 +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
427f9802bc make sure that a cmap subtable instance always has a language attr, so __cmp__ can't fail
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@473 4cde692c-a291-49d1-8350-778aa11640f8
2004-09-26 18:32:50 +00:00
jvr
fba0609d54 Fix for [ 808370 ] Dumping Legendum.otf fails on 'kern' table
Work around buggy kern table.


git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@472 4cde692c-a291-49d1-8350-778aa11640f8
2004-09-25 10:56:15 +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
266bf21dbe workaround for bug [ 766694 ] Error from invalid date
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@470 4cde692c-a291-49d1-8350-778aa11640f8
2004-09-25 10:01:12 +00:00
jvr
980fae897a bug #784690: simple workaround for buggy name table
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@469 4cde692c-a291-49d1-8350-778aa11640f8
2004-09-25 09:12:00 +00:00
jvr
a84b28d934 - Refactored XML writing, removed lots of code duplicaiton
- Only output unicode names as comments if we're in fact dealing with
  a unicode cmap subtable (and this is -- in theory -- independent of
  cmap format)


git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@468 4cde692c-a291-49d1-8350-778aa11640f8
2004-09-25 09:06:58 +00:00
jvr
0cd79a5642 Patch #845571 from Anthony Fok:
- better exception msg in loca table
- renamed "version" to "language" in cmap
- made cmap 12 work (untested by me)


git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@463 4cde692c-a291-49d1-8350-778aa11640f8
2004-09-25 07:30:47 +00:00
jvr
7718d95951 whoops, forgot one part os OS/2 version 3 support
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@462 4cde692c-a291-49d1-8350-778aa11640f8
2004-09-25 07:19:27 +00:00
jvr
30bcb12dcb added support for OS/2 table #3
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@461 4cde692c-a291-49d1-8350-778aa11640f8
2004-09-24 18:33:19 +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
df1f145e5a bug from the spec leaked into here; pointed out by Yannis H.
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@458 4cde692c-a291-49d1-8350-778aa11640f8
2003-09-22 07:09:33 +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
3a6aa2359e tweaked doc string
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@445 4cde692c-a291-49d1-8350-778aa11640f8
2003-09-02 19:23:13 +00:00
jvr
5aaeac3333 Ha, a reserved field got eaten. Noticed by Yannis Haralambous.
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@443 4cde692c-a291-49d1-8350-778aa11640f8
2003-09-01 15:09:29 +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
3430abf7ab whitespace nits
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@435 4cde692c-a291-49d1-8350-778aa11640f8
2003-08-28 18:14:33 +00:00
jvr
bafa66e665 Another patch from rroberts. He writes:
"""It adds full support for cmap format 2, which is what
the Adobe CJK fonts use for the Mac cmap subtable."""


git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@434 4cde692c-a291-49d1-8350-778aa11640f8
2003-08-28 18:04:23 +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
6d9e8e8831 document that this file is generated
git-svn-id: svn://svn.code.sf.net/p/fonttools/code/trunk@425 4cde692c-a291-49d1-8350-778aa11640f8
2003-08-25 21:19:09 +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