Sascha Brawer
513458f558
[GX] Test round-trip decompile/compile for glyph variations
...
Also, implement an __eq__ method on GlyphVariation so we can verify
whether the result of round-tripping actually equals the original input.
2015-06-08 23:00:02 +02:00
Sascha Brawer
5c58ba221a
[GX] Backport 'gvar' table handling to Python 2.6
...
In Python 2.6, there were no set literals like {1, 2, 3}.
Also, unittest had no assertSetEqual() and assertListEqual() methods.
2015-06-08 23:00:02 +02:00
Sascha Brawer
54866e9294
Minor changes for Python 3
2015-06-08 23:00:02 +02:00
Sascha Brawer
6d5049cb57
Minor changes towards supporting python3.
2015-06-08 23:00:02 +02:00
Sascha Brawer
e4377af3fd
Replace xrange() by range(), for python3
...
In Pyton 3, range() is implemented like xrange() in Python 2,
and there is no xrange() anymore. The savings from xrange() are
too small for us to really bother, so we choose to live inefficiently
on Python 2.
2015-06-08 23:00:02 +02:00
Sascha Brawer
9bb1ca02ba
[GX] Remove obsolete, unused helper method
2015-06-08 23:00:01 +02:00
Sascha Brawer
7d0f22e1e3
[GX] Temporarily disable code path for emitting shared points in 'gvar' tables
...
With this work-around, all of {Skia, BuffaloGalRegular, JamRegular}.ttf
can be round-tripped through TTX, and the resulting TrueType font
can be displayed by MacOS X 10.9.5 including glyph variations.
2015-06-08 23:00:01 +02:00
Sascha Brawer
b309a36157
[GX] Improve tests for compiling 'gvar' tables
2015-06-08 23:00:01 +02:00
Sascha Brawer
d5005c7f3e
[GX] Compile 'gvar' tables
2015-06-08 23:00:01 +02:00
Sascha Brawer
4930366117
[GX] Add randomized test for round-trip fidelity of 'gvar' delta encoding
2015-06-08 23:00:01 +02:00
Sascha Brawer
b85ff8ed31
[GX] Compile delta offsets for 'gvar' table to compact encoding
2015-06-08 23:00:01 +02:00
Sascha Brawer
94bf26eace
Minor
2015-06-08 23:00:00 +02:00
Sascha Brawer
054002225d
[GX] Test round-trip compilation of randomized 'gvar' points
2015-06-08 23:00:00 +02:00
Sascha Brawer
79e704807d
[GX] Add comment on when to use shared versus private point lists for 'gvar' tuples
2015-06-08 23:00:00 +02:00
Sascha Brawer
970c37e395
[GX] Compile sets of packed point numbers for 'gvar' table
...
Work in progress. Prints out various debug info that will be removed
in the final version.
2015-06-08 23:00:00 +02:00
Sascha Brawer
6976d8ed33
[GX] Omit 'gvar' tuples whose deltas are all zero
...
In the Apple Skia font, about 5% of all tuples are redundant
because all their delta offsets are (0, 0); these tuples can
be omitted without any visual loss. But in the BuffaloGalRegular
and JamRegular fonts, there are no such redundant tuples.
2015-06-08 23:00:00 +02:00
Sascha Brawer
362aadc8e7
Fix typo in name of test method
2015-06-08 23:00:00 +02:00
Sascha Brawer
303caee946
[GX] Rename decompileTuples_() to decompileGlyph_i()
...
For symmetry with compileGlyph_(), and because the name carries more meaning.
2015-06-08 23:00:00 +02:00
Sascha Brawer
936d079428
[GX] Fix default coordinate values for non-intermeditate 'gvar' tuples
2015-06-08 22:59:59 +02:00
Sascha Brawer
50a2ada262
[GX] Test compileGlyph() for 'gvar' table without actual variations
2015-06-08 22:59:59 +02:00
Sascha Brawer
86ecd4dac0
[GX] Build shared coordinate table when compiling 'gvar'
2015-06-08 22:59:59 +02:00
Sascha Brawer
21098228f0
[GX] Resurrect 'gvar' table from XML
2015-06-08 22:59:59 +02:00
Sascha Brawer
908bc15b74
[GX] Move decompilePoints() and decompileDeltas() into class GlyphVariation
2015-06-08 22:59:59 +02:00
Sascha Brawer
3f715e433e
[GX] Move helper methods for (de)compiling GlyphVariation into class GlyphVariation
...
Specifically, compileCoords(), decompileCoords(), compileCoord(), decompileCoord(),
and getTupleSize().
2015-06-08 22:59:59 +02:00
Sascha Brawer
19863123d6
[GX] Add methods compileCoord() and compileCoords()
2015-06-08 22:59:58 +02:00
Sascha Brawer
c7650e5cb1
[GX] In XML for 'gvar' table, rename glyphVariation to glyphVariations
...
It is a list of variations, not a single variation.
2015-06-08 22:59:58 +02:00
Sascha Brawer
a82affb34c
[GX] Move XML generation for GlyphVariations into separate method
2015-06-08 22:59:58 +02:00
Sascha Brawer
e0bd569a73
[GX] Align signature of decompileCoord() with that of similar methods
2015-06-08 22:59:58 +02:00
Sascha Brawer
5352ceb824
[GX] Handle intermediate coordinates in 'gvar' tuples
2015-06-08 22:59:58 +02:00
Sascha Brawer
343539d569
[GX] Write 'gvar' coordinates to XML
2015-06-08 22:59:58 +02:00
Sascha Brawer
50f3ca52da
[GX] Handle embedded coordinates of 'gvar' tuples
2015-06-08 22:59:57 +02:00
Sascha Brawer
ea071c3025
[GX] Decompile non-embedded 'gvar' tuple coordinates
2015-06-08 22:59:57 +02:00
Sascha Brawer
39622ed66d
[GX] Parse 'gvar' tuples and write them as XML
2015-06-08 22:59:57 +02:00
Sascha Brawer
5f317b2ed4
[GX] Decode packed point numbers
2015-06-08 22:59:57 +02:00
Sascha Brawer
1f650d7f72
Minor docfix
2015-06-08 22:59:57 +02:00
Sascha Brawer
1d90b77d2e
Parse tuple header in 'gvar' table
2015-06-08 22:59:57 +02:00
Sascha Brawer
3b32f25ebd
Use xrange() instead of range()
2015-06-08 22:59:56 +02:00
Sascha Brawer
9d7102fdfe
[GX] Implement decoding of packed deltas
2015-06-08 22:59:56 +02:00
Sascha Brawer
41c2081a5c
Fix unittest on 'gvar' shared coordinates
2015-06-08 22:59:56 +02:00
Sascha Brawer
37e9e04f0b
Avoid string copies when parsing 'gvar' table
2015-06-08 22:59:56 +02:00
Sascha Brawer
674fb52c37
Assemble offset table for 'gvar'
2015-06-08 22:59:56 +02:00
Sascha Brawer
56a4d3f9e3
[GX] Handle 'gvar' table with glyph variations
2015-06-08 22:59:56 +02:00
Behdad Esfahbod
8724513a67
[kern] Speedup compiling by 2x
...
By using font.getReverseGlyphMap().
2015-05-27 17:09:33 -07:00
Behdad Esfahbod
1d93f9099d
[kern] Make decompiling another 2x faster
...
By using font.getGlyphOrder()!
2015-05-27 17:05:09 -07:00
Behdad Esfahbod
4860a88243
[kern] Speed up decompiling by 4x
...
Mostly by not creating a new object in the hot loop.
2015-05-27 17:05:01 -07:00
Cosimo Lupo
c9ee926356
[sfnt] raise TTLibError if there aren't enough bytes to unpack header
...
Fixes https://github.com/behdad/fonttools/issues/239
2015-05-17 11:07:42 +01:00
Behdad Esfahbod
330406f3e6
Merge pull request #268 from anthrotype/sfnt_typo
...
[sfnt] fixed typo: 'checksum' -> 'checkSum'
2015-05-11 15:03:54 -07:00
Cosimo Lupo
4bbe6ef57f
[glyf] fixed 'noname'
2015-05-11 17:37:48 +01:00
Cosimo Lupo
73b9acb5a2
[sfnt] fixed typo: 'checksum' -> 'checkSum'
2015-05-11 17:35:52 +01:00
Behdad Esfahbod
ca451d8c74
Merge pull request #256 from anthrotype/os2_char_index
...
[OS/2] update fsFirstCharIndex and fsLastCharIndex upon compile
2015-05-09 11:12:47 -07:00