797 Commits

Author SHA1 Message Date
Sascha Brawer
9f287353f3 [CPAL] Support CPAL table version 1 2016-04-27 13:15:45 +02:00
Behdad Esfahbod
e391cdb787 [glyf] GlyphCoordinates: Implement __del__() 2016-04-27 01:14:08 -07:00
Behdad Esfahbod
e36b7069d9 [glyf] GlyphCoordinates: Upgrade to float in math ops if needed 2016-04-27 01:11:40 -07:00
Sascha Brawer
9e7e77bdf4 [CPAL] Share color records when possible 2016-04-26 17:40:00 +02:00
Sascha Brawer
15781e4183 Add unit tests for handling CPAL table 2016-04-26 11:53:09 +02:00
Miguel Sousa
cc5d6c96fa don't hardcode the table tags, rely on ttLib.getClassTag instead 2016-04-21 23:42:13 -07:00
Miguel Sousa
883ff5fbdc [sbix] correct __init__ method 2016-04-21 21:32:30 -07:00
Cosimo Lupo
d169acd10e Merge pull request #584 from miguelsousa/svg_init_fix
[SVG] correct __init__ method
2016-04-21 10:46:49 +01:00
Miguel Sousa
ce4af2a0a2 [SVG] correct __init__ method 2016-04-20 17:08:45 -07:00
Behdad Esfahbod
0ee799fb03 [glyf] Add math operators to GlyphCoordinates 2016-04-13 22:54:39 -07:00
Behdad Esfahbod
c4fe9c7c57 Before splitting subtables when overflow happens, try disabling table sharing
More bandaid for https://github.com/behdad/fonttools/issues/537
2016-04-13 16:34:14 -07:00
Behdad Esfahbod
4268e6345d Fix splitPairPos for TTFont loaded from XML
When loading from XML count variables are missing...

Fixes https://github.com/behdad/fonttools/issues/537#issuecomment-207849194
2016-04-13 16:17:05 -07:00
Miguel Sousa
b9fc0b84ed [SVG] Don't make <colorPalettes> element a requirement 2016-04-13 03:32:07 -07:00
Miguel Sousa
30c89b8a2f [SVG] Don't write <colorPalettes> element if it's empty 2016-04-13 03:31:01 -07:00
Miguel Sousa
ff06131e47 [SVG] Better handling of empty <colorPalettes> element 2016-04-13 02:28:20 -07:00
Behdad Esfahbod
d82401bb8d Fix SVG version-1 decompile
Untested.  We should add tests for these.
2016-04-10 17:20:10 -07:00
Cosimo Lupo
75ec34f8ab SVG: decompileEntryList method takes only one argument
I haven't tested if this works (but for sure it wasn't working before either)
2016-04-10 23:23:25 +01:00
Cosimo Lupo
afd3f6618c OS/2: 'global' is not needed
as no assignment is done, only append.
2016-04-10 23:13:59 +01:00
Behdad Esfahbod
c6facc99df When splitting a large class-kerning table, mark the old subtable as DontShare
Fixes https://github.com/behdad/fonttools/issues/537#issuecomment-196047070
2016-04-09 13:06:16 -07:00
Cosimo Lupo
4ac53ab8b8 add missing 'import sys'
A couple of modules were relying on the fact that the 'sys' module was being implicitly imported by 'from py23 import *'.
The 'py23.__all__' does not include 'sys'. I think it's better to always import 'sys' explicitly when needed.
2016-04-07 09:42:13 +01:00
Cosimo Lupo
e3f3f4f976 [_m_a_x_p] rename 'allXMaxIsLsb' variable to 'allXMinIsLsb' for clarity's sake
The previous 'allXMaxIsLsb' name was misleading.
The 'allXMinIsLsb' boolean variable cooresponds to the head table's Bit 1.
This is set whenever all glyphs have the bbox.xMin equal to the respective
left sidebearing (and therefore "left sidebearing point at x=0").
2016-04-05 16:17:38 +01:00
Sascha Brawer
13e862da72 [meta] Remove comments about intentionally deviating from Apple's spec
Today, Apple has kindly fixed a bug in the [specification of the
meta table](https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6meta.html).  The existing fonttools implementation matches the
revised specification.  Therefore, the comments about fonttools
intentionally deviating from Apple's spec can be removed.
2016-04-01 15:50:52 +02:00
Behdad Esfahbod
40198a2dec [gvar] Use array.array to decode deltas 2016-03-21 10:12:26 -07:00
Behdad Esfahbod
9987b7e14e [gvar] Use array.array to decode deltas 2016-03-21 10:12:26 -07:00
justvanrossum
ad386ee477 Keep Format attribute for OT subtables. This value may be ignored by the compiler but is useful for debugging. Part of fixing #92. 2016-03-21 12:12:05 +01:00
schriftgestalt
b09c5baa15 Disable optimisations when decompiling TrueType instructions 2016-03-20 22:26:22 +01:00
Behdad Esfahbod
e2299a16b0 [otBase] Minor
Part of fixing https://github.com/behdad/fonttools/issues/518
2016-03-12 20:42:16 -08:00
Behdad Esfahbod
407c246433 [otBase] Minor renamings
Part of fixing https://github.com/behdad/fonttools/issues/537
2016-03-12 20:42:13 -08:00
Behdad Esfahbod
c02ced3393 [otBase] Minor
Part of fixing https://github.com/behdad/fonttools/issues/537
2016-03-12 20:42:08 -08:00
Behdad Esfahbod
6b46d8e553 [otBase] Move code around
Part of fixing https://github.com/behdad/fonttools/issues/537
2016-03-12 20:42:05 -08:00
Behdad Esfahbod
4b94fd55cb Simplify overflow handling code
The code that is being removed is untested and does not seem to make
fixing an overflow any easier.  The fixer code just needs to know
which subtable caused the overflow and does not care about the item
within.  As such, no point in trying to find a "right" item.

In fact, leaving item as is, is more useful in debugging overflows
as it reflects which item's offset actually overflowed.

Part of fixing https://github.com/behdad/fonttools/issues/537
2016-03-12 20:11:34 -08:00
Behdad Esfahbod
c1080d9796 Implement splitting PairPosFormat2 in case of overflow
Part of fixing https://github.com/behdad/fonttools/issues/537
2016-03-12 18:17:37 -08:00
Cosimo Lupo
d82a31dd57 return NotImplemented from __ne__ if __eq__ returns NotImplemented
otherwise `not NotImplemented` (always False) is returned from __ne__ when `type(self) != type(other)`, leading to illogic results like:

>>> from fontTools.ttLib.tables.DefaultTable import DefaultTable
>>> t = DefaultTable('test')
>>> t == 0
False
>>> t != 0
False

The latter of course should return True.
2016-03-11 15:10:50 +00:00
Cosimo Lupo
35c46aa0e2 [ttProgram] add __eq__ and __ne__ methods to Program class 2016-03-11 15:10:50 +00:00
Behdad Esfahbod
a0d6ab6a07 [ttLib] Fix bug in OTLOffsetOverflowError generation
Part of fixing https://github.com/behdad/fonttools/issues/537

Now on to fixing the actualy overflow.
2016-03-04 06:06:33 -08:00
Behdad Esfahbod
bf28ca10d7 [EBLC] Decompile and release copies of data early
Apparently string slices are not as smart as I was hoping for.
Slicing a looong (say, 1MB) string and holding onto it is not a
good idea if done thousands of times.  So, do fewer slicings and
decompile subtables immediately instead of holding onto data.

This makes me want to rethink the kind of data structures we use
for lazy processing.

Fixes https://github.com/behdad/fonttools/issues/317
2016-03-02 11:31:20 +09:00
Behdad Esfahbod
7aed5c3ca9 GlyphCoordinates: add test for non-integer transform() 2016-02-24 13:01:09 +09:00
Behdad Esfahbod
87b1c0f403 GlyphCoordinates: Fix translating by non-integer 2016-02-24 12:58:32 +09:00
Behdad Esfahbod
d0552c994c GlyphCoordinates: add failing test for translating non-integer 2016-02-24 12:57:18 +09:00
Behdad Esfahbod
26621d548f GlyphCoordinates: return early from _checkFloat(), if already float 2016-02-24 12:52:38 +09:00
Sascha Brawer
655fb4a856 Skip names whose offset+length points outside the string table
Resolves https://github.com/behdad/fonttools/issues/525
2016-02-16 14:39:44 +01:00
Behdad Esfahbod
d87d6aa39e [ot] Make sure GSUB/GPOS top arrays don't share bytes
Fixes https://github.com/behdad/fonttools/issues/518
Fixes https://github.com/behdad/fonttools/issues/372
2016-02-10 18:00:48 +07:00
Behdad Esfahbod
1085d8973d [ot] Minor 2016-02-10 17:28:56 +07:00
Behdad Esfahbod
0baeb5921b [otBase] Shuffle 2016-02-10 17:26:53 +07:00
Behdad Esfahbod
f65fc6f872 [otBase] Simplify _doneWriting() slightly
Should have NO functional change.
2016-02-10 17:03:46 +07:00
Dave Crossland
17007a36d6 otBase.py log level adjustment
Change log level of 'Attempting to fix OTLOffsetOverflowError' from warning to debug to close #499
2016-02-02 10:06:10 -05:00
Behdad Esfahbod
b6a78d5664 Simplify fix for https://github.com/behdad/fonttools/pull/498 2016-02-02 11:52:24 +08:00
Cosimo Lupo
ed29a07670 [O_S_2f_2] skip updateFirstAndLastCharIndex if cmap table class is DefaultTable
Fixes https://github.com/behdad/fonttools/issues/497
2016-02-01 18:04:39 +00:00
Cosimo Lupo
e40dffd86d [_c_m_a_p] don't set self.data = headerdata + data inside cmap_format_14.compile
self.data is usually set by decompileHeader as "the data after the header"; while here
it also included `headerdata`. This produced corrupt data if the compile method was called
again, as the header data is added again to self.data.

Moreover, in none of the subtable classes' `compile` methods, the re-compiled data is
stored in self.data, so we shall not do that for format 14 either.

Fixes #389
2016-01-31 21:00:11 +00:00
Cosimo Lupo
48db539c44 [ttProgram] replace print with logger 2016-01-27 19:02:48 +00:00