1445 Commits

Author SHA1 Message Date
Sascha Brawer
5bd9ade399 [GX] Remove ‘fvar’ table definition from otTables.py
There now is a Python implementation of variation axes, because this
makes it (much) easier to build variable fonts from code. Therefore,
the definitions in otTables.py are not needed anymore.
2015-06-24 15:58:05 +02:00
Sascha Brawer
5772339f19 [GX] Minor: Address landscape.io complaints about ‘fvar’ handler 2015-06-24 15:53:02 +02:00
Sascha Brawer
53e7db624a [GX] Make it easier to construct ‘fvar’ tables from code
In the previous table-driven implementation, client code had to
know the internals of the ‘fvar’ structure for correctly adding
variation axes to a font. In the new implementation, clients
do not have to futz around with binary offsets (which makes it
more likely that tools build correct fonts).
2015-06-24 15:05:03 +02:00
Sascha Brawer
29328f20e5 Helper function to find a debug string for a name
Useful for generating XML comments when tables refer to name IDs.
For example, XML for a named instance in an ‘fvar’ table is easier
to read when it says <!-- Bold --> in addition to nameID="258".
2015-06-24 09:08:19 +02:00
Cosimo Lupo
55e4704043 [E_B_D_T_] make extfile 'bitmaps' directory in same location as output file 2015-06-23 11:51:30 +01:00
Cosimo Lupo
7fffdb8815 [ttx] don't create output file if action is 'ttList' 2015-06-23 11:15:56 +01:00
Behdad Esfahbod
c7b6d1943d Fix decompiling of cmap table
Previously, if a subtable's data was shared amongst two different encodings,
the second one being loaded was getting a cmap member assigned while retaining
its data item.  If we subset the cmap and then save that subtable, the original
unsubset data will be written out.  Fix, but removing data when assigning cmap.

Explains and obviates mystery hack in subsetter.
2015-06-22 19:14:09 -07:00
Behdad Esfahbod
6cfb4f1d4f Revert "[subset] Remove ancient hack that I can't reproduce needing anymore"
This reverts commit 72f72d3c3fff3eea38ae41b86a10a78d8460e09d.

This broken subsetting of cmap, as privately reported by Adam to me.
Investigating some more.  I think I actually know what's going on.
2015-06-22 19:13:50 -07:00
Sascha Brawer
b3cda9ea22 Minor: Remove unused imports in ‘avar’ parser 2015-06-21 12:13:51 +02:00
Sascha Brawer
cd3c28ab2d [GX] Support 'avar' table 2015-06-20 00:13:01 +02:00
Behdad Esfahbod
ca83ef2bf9 Merge pull request #277 from anthrotype/misspelling
[OS/2] fix misspellings 'usMaxContext', 'usFirstCharIndex', 'usLastCh…
2015-06-18 10:36:03 -07:00
Behdad Esfahbod
090c9b15fa Merge pull request #293 from anthrotype/fix_make_all
[setup.py] monkeypatch py_compile to halt compilation on syntax errors
2015-06-16 23:07:03 -07:00
Behdad Esfahbod
a7e1524d2a Merge pull request #278 from anthrotype/timestamp
[ttx] use TTX mtime for 'modified' (default), optionally "--recalc-timestamp"
2015-06-16 15:12:12 -07:00
Cosimo Lupo
679fe8965f [encodingTools] fix typo 2015-06-16 22:44:57 +01:00
Cosimo Lupo
eae49fd67c [ttx] use TTX file modification time for the font 'modified' (default) 2015-06-16 22:44:57 +01:00
Cosimo Lupo
262f0e9017 [timeTools] add timestampSinceEpoch function 2015-06-16 22:44:57 +01:00
Behdad Esfahbod
82b19a0d08 Merge pull request #279 from anthrotype/racecondition
[ttx] 'touch' output file to avoid race condition in choosing file names
2015-06-15 15:36:30 -07:00
Cosimo Lupo
72481f5050 [merge] fix TabError: inconsistent use of tabs and spaces in indentation 2015-06-14 19:45:20 +01:00
Cosimo Lupo
5052950f81 [OS/2] fix misspelled attributes, and keep them using property decorators 2015-06-13 23:19:18 +01:00
Cosimo Lupo
1d510c61a2 [ttx] 'touch' output file to avoid race condition in choosing file names
Fixes https://github.com/behdad/fonttools/issues/45
2015-06-13 22:42:10 +01:00
Behdad Esfahbod
6df41da4ff Use timestampNow() in merge.py 2015-06-12 16:11:31 -07:00
Behdad Esfahbod
72f72d3c3f [subset] Remove ancient hack that I can't reproduce needing anymore 2015-06-12 15:27:47 -07:00
Behdad Esfahbod
e7fe5b4db8 [subset] Minor log 2015-06-12 15:23:10 -07:00
Behdad Esfahbod
6406fcade0 [subset] Fix format 14 subsetting with glyphs_requested 2015-06-12 15:18:43 -07:00
Behdad Esfahbod
d39d231982 [subset] Use frozensets where appropriate
Note that this fixes a bug where a copy was not being made
when glyphs_cmaped was assigned.  Fortunately that value
wasn't used for a lot of things.
2015-06-12 15:11:36 -07:00
Behdad Esfahbod
108c5853ea Fixup 6c83fe4846c711123c38654e5eb83d0a595d56ea
Ouch!
2015-06-12 15:04:37 -07:00
Behdad Esfahbod
215a8990d4 [subset] Speed up cmap format 14 closure
Previously, closing cmap glyphs over NotoSansCJKjp-Thin.otf was
taking 24s.  Now it takes under 1s.
2015-06-12 14:54:36 -07:00
Behdad Esfahbod
1135d9b1df [subset] Minor 2015-06-12 14:46:08 -07:00
Behdad Esfahbod
c1b407726d [subset] Speed up NotoNastaliq again
Back to 5s again, by memoizing more broadly.
2015-06-12 14:40:18 -07:00
Behdad Esfahbod
b6aace1c94 [subset] Fix up glyph closure
Followup fix from 13d48da3a91e7ac005f31b0f4dbca01cae7adbd7

When avoiding redoing the same lookup, we should only do that within
each run over all lookups.

Fixes issue where closing glyphs over NotoNastaliq was unreliable and
returning different results (which was caused by items in our frozenset's
being walked over in different orders).

Slows down closing over NotoNastaliq from 5s to 16s.  Speedup fixes coming
soon.
2015-06-12 14:11:03 -07:00
Behdad Esfahbod
a3ab65b184 [subset] Whitespace 2015-06-12 14:05:46 -07:00
Sascha Brawer
2e6522c619 Re-generated table list now that ‘gvar’ is a supported table
Change was auto-generated by MetaTools/buildTableList.py
2015-06-12 22:25:14 +02:00
Behdad Esfahbod
fd39e88d2d Merge pull request #291 from brawer/gvar
[GX] Remove work-arounds for Python 2.6 from ‘gvar’ tests
2015-06-12 11:23:25 -07:00
Behdad Esfahbod
6c83fe4846 Really fix SingleSubst delta math
I had broken this in e06166b83aa82582dab2e011520b1a77f72aa9f9.

Fix that, and other issues.  Since I made that last commit, it has
become clear that SingleSubst works by adding delta and then doing
module 65536.

HarfBuzz was updated for this in 2011:
commit 52ebdff49d13f239efc886de935d47be9860f6e5
Author: Behdad Esfahbod <behdad@behdad.org>
Date:   Tue Sep 27 12:38:16 2011 -0400

    Fix GSUB lookuptype 1 subtype 1 delta wrapping
2015-06-12 10:27:04 -07:00
Sascha Brawer
2a44b81d64 [GX] Remove work-arounds for Python 2.6 from ‘gvar’ tests 2015-06-12 11:37:42 +02:00
Behdad Esfahbod
37e6e6a380 Use dict comprehension now that we don't support Python 2.6 2015-06-11 17:05:15 -07:00
Behdad Esfahbod
bd9375ae8e Use set literals 2015-06-11 13:42:38 -07:00
Behdad Esfahbod
b50b6f23c3 Merge pull request #258 from brawer/gvar
[GX] Support 'gvar' table
2015-06-10 11:28:40 -07:00
Sascha Brawer
7f6d2af45a [GX] Optimize ‘gvar’ tables for tuples affecting all points in a glyph
After this change, round-tripping through TTX shrinks the size of all
our test fonts. Specifically, Skia.ttf shrinks from 478K to 473K,
JamRegular.ttf from 113K to 107K, and BuffaloGalRegular from 67K to 61K.
2015-06-10 11:19:06 +02:00
Cosimo Lupo
b1bd77f9f6 fix xmlWriter and _l_t_a_g tests failing on Windows because of \r\n 2015-06-10 10:17:05 +01:00
Sascha Brawer
4bbc1f7e83 [GX] In ‘gvar’ code, rename numPoints to numPointsInGlyph
This make the code easier to understand, especially since there
is a diffence between numPointsInGlyph, numPointsInRun and
numPointsInData.

Also, we now pass numPointsInGlyph to compilePoints() to later
enable an optimization where numPointsInData == numPointsInGlyph.
However, this change does not yet make that optimization.
2015-06-10 10:54:08 +02:00
Sascha Brawer
ca6126ea67 [GX] Fix ‘gvar’ unittest on Python 2.6
unittest.TestCase.assertSetEqual() was added in Python 2.7,
so we default to assertEqual() on Python 2.6.
2015-06-10 10:09:28 +02:00
Sascha Brawer
f121b070f7 [GX] Emit correct number of points for long ‘gvar’ tuples
Before this change, the compilePoints() routine would wrongly clear
the most-significant bit of the lower byte in its binary output.

An example glyph affected by this bug was “perthousand.oldstyle” in
the version of Skia.ttf that Apple ships with MacOS X Yosemite 10.10.3.

Although the broken code path was exercised in the unit tests, the
length of the test input just happened to have the affected bit clear,
which is why this bug did not get caught by the previous test cases.
2015-06-10 09:46:18 +02:00
Sascha Brawer
1426431c2f [GX] Minor: Removed unneeded variable in “gvar” handling code 2015-06-09 15:17:58 +02:00
Sascha Brawer
1d211ff058 [GX] Removed unused function argument in ‘gvar’ handling code 2015-06-09 15:08:01 +02:00
Sascha Brawer
e39c2957de [GX] Fix some minor lint warnings by landscape.io 2015-06-09 14:04:33 +02:00
Sascha Brawer
624b2b7529 [GX] In ‘gvar’ tuples, treat (0,0) different from unspecified entries
After this change, MacOS Yosemite 10.3.3 renders the Oslash glyph
of Skia.ttf with the exact same outline before and after round-tripping
the font through TTX.  Before this change, the outlines were slightly
different after round-tripping through TTX.

In my initial reading of the “gvar” specification, I had assumed
that (0,0) entries had no significance. However, that is not
how the current MacOS implementation interprets it.
2015-06-09 12:41:40 +02:00
Behdad Esfahbod
8963f3bbed Simplify fixedToFloat() a bit more 2015-06-08 17:26:59 -07:00
Sascha Brawer
64d8411c1c Remove work-around for https://github.com/behdad/fonttools/issues/286 2015-06-08 23:03:17 +02:00
Sascha Brawer
cd8af14991 [GX] Leave 'gvar' coordinates unchanged when round-tripping through TTX
Before this change, a rounding issue in fixedToFloat() would sometimes
change 'gvar' coordinate values when round-tripping Skia.ttf through TTX.
This change works around https://github.com/behdad/fonttools/issues/286.
2015-06-08 23:00:03 +02:00