1555 Commits

Author SHA1 Message Date
Behdad Esfahbod
5cd4e51450 Update MetaTools/buildTableList.py for recent changes 2015-04-14 00:17:52 -07:00
Behdad Esfahbod
60f13a55df Merge pull request #225 from sansplomb/master
sorted vTables
2015-04-11 23:58:06 -07:00
sansplomb
a18416076c sorted vTables 2015-04-10 16:31:41 +02:00
Behdad Esfahbod
64a5103a77 Merge pull request #212 from vitalyvolkov/master
Handle the exception of IndexError when list item access is out of range
2015-04-08 14:33:23 -07:00
Behdad Esfahbod
f1ec43cefa [TravisCI] Test on pypy and pypy3 as well 2015-04-07 19:12:08 -07:00
Behdad Esfahbod
a38c3f577a Try fixing TravisCI build 2015-04-07 19:09:37 -07:00
Behdad Esfahbod
c0e7bb859f Add test to make sure supported table entries are added to git
Catches the vase where support for a table is added, but the .py
file is not added to git (like happened for feat and fvar tables).
2015-04-07 18:27:23 -07:00
Behdad Esfahbod
da900f656c Run module tests as modules 2015-04-07 18:27:23 -07:00
Behdad Esfahbod
f7861e5e58 Add a minimal Makefile that calls setup.py 2015-04-07 18:27:23 -07:00
Behdad Esfahbod
2aac2f0eeb Actually add the fvar table. Ouch! 2015-04-07 18:02:04 -07:00
Behdad Esfahbod
81750849fc Allow setting name entries to Unicode strings
Just convert to bytes if needed when compiling table.
2015-04-07 17:58:11 -07:00
Behdad Esfahbod
e3f531783a Don't modify name table object when compiling 2015-04-07 17:56:51 -07:00
Behdad Esfahbod
4458f363e3 [ttx] Write out name table entries as Unicode when possible
https://github.com/behdad/fonttools/issues/54

There's a new attribute named unicode that can choose whether the
text in the XML entry is to be interpretted as Unicode, or as the
target encoding.
2015-04-07 17:52:51 -07:00
Behdad Esfahbod
98aee5f11a Add getEncoding() to name table entries 2015-04-03 10:07:57 -07:00
Behdad Esfahbod
24264cb7f8 [subset] Fix chaos handling to be more inclusive
If a contextual lookup recurses twice on the same index, that index
most be marked chaotic for the second recursion.

Also, when a non-1-to-1 recursion happens, only mark glyph locations
after current to be chaotic, not everything.

I believe this fixes a bug that before we were not inclusive enough.
Now we might have introduced more false positives, but we are at least
correct.
2015-04-01 18:51:52 -07:00
Behdad Esfahbod
2a7007df7b [subset] Indent 2015-04-01 18:22:51 -07:00
Behdad Esfahbod
9ab1d2f968 [subset] Minor 2015-04-01 18:18:56 -07:00
Behdad Esfahbod
13d48da3a9 [subset] Avoid duplicate recursions in closure_glyphs() for contextuals
Speeds up NotoNastaliqUrdu from 50s to 1.8s.
2015-04-01 18:15:01 -07:00
Behdad Esfahbod
4a3dcd589e [subset] Whitespace 2015-04-01 17:51:54 -07:00
Behdad Esfahbod
22ffbba4b7 [subset] Further narrow down cur_glyphs in recursive contextuals
Improves NotoNastaliqDraft closure_glyphs() time from 60s to 50s.

This was originally introduced in 1d4fa13b4.  I'm fairly confident
new code is correct.
2015-04-01 17:45:55 -07:00
Behdad Esfahbod
c4d0400004 [subset] Speed up closure_glyphs() a bit
Was taking nine minutes on NotoNastaliqUrdu font.
With these changes it takes only(1) one minute now.

More coming.
2015-04-01 17:34:38 -07:00
Behdad Esfahbod
56cc4c151b Merge pull request #223 from anthrotype/woff_checksum
[sfnt] fix WOFF checksum adjustment calculation
2015-04-01 10:58:35 -07:00
Cosimo Lupo
4c4c65fac0 [sfnt] fix WOFF checksum adjustment calculation
Use 'origLength' and 'origChecksum', instead of 'length' and
'checksum', to calculate the checksum adjustment of WOFF.
2015-04-01 10:25:06 +01:00
Behdad Esfahbod
0bf67b50bd [glyf] Implement optimal glyph outline packing; disabled by default
Dynamic-Programming-based algorithm.  Previously we had a greedy
algorithm only.

Unfortunately the savings are truly negligible.  In the order of ~20
bytes for each of the Roboto faces, less so for Noto fonts.  Even on
a 20MB font, it produced less than 100 bytes saving compared to our
greedy packing.  Either I made a huge mistake, or this is so not worth
it.  Anyway, the code is there, but disabled.
2015-03-30 16:47:49 -07:00
Behdad Esfahbod
4e616d2f7f Accept MS Symbol cmap tables as Unicode-compatible
Apparently these days these tables are used to encode symbols in
PUA, so they are still Unicode-compatible...

This follows a similar change in fontconfig.
2015-03-30 16:47:48 -07:00
Behdad Esfahbod
cd1bc34f89 Simplify glyf packing a bit more 2015-03-30 16:47:48 -07:00
Behdad Esfahbod
c72058623b Minor 2015-03-30 16:47:48 -07:00
Behdad Esfahbod
630284e31a Minor 2015-03-30 16:47:48 -07:00
Behdad Esfahbod
0679a7691d Move glyf coordinate delta packing into new function 2015-03-30 16:47:47 -07:00
Behdad Esfahbod
a40b20d0e0 Minor shuffling of glyf compression code 2015-03-30 16:47:47 -07:00
Behdad Esfahbod
a9632a376b Merge pull request #219 from anthrotype/bytesjoin
[_n_a_m_e] fix "can't concat bytes to str" error in python 3
2015-03-20 12:42:53 -07:00
Cosimo Lupo
743e990b5c [_n_a_m_e] fix "can't concat bytes to str" error in py3 2015-03-19 18:11:19 +00:00
Behdad Esfahbod
c511745b2e Work around a Jython bug:
>>> import array; array.array("f", array.array("b", [1,2,3]))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: can only extend with array of same kind

>>> import array; array.array("f", list(array.array("b", [1,2,3])))
array('f', [1.0, 2.0, 3.0])
2015-03-17 15:32:57 -07:00
Behdad Esfahbod
b9ac90a8f9 [GX] Add 'fvar' table support
I might change the table format in the future, but it's functional now.
2015-03-11 15:29:35 -07:00
Behdad Esfahbod
61cda14c1b Actually add _f_e_a_t.py
Ouch!
2015-03-11 12:31:44 -07:00
Behdad Esfahbod
467a0369e4 Fix test on Python 2.6 2015-03-03 16:05:25 -08:00
Behdad Esfahbod
1296c7457e Make tests pass with Python3
In python3, str(float) is noisy.  Always format floats using "%g".
2015-03-03 15:54:37 -08:00
Behdad Esfahbod
e5b78aa212 Fix run-tests.sh to run on dash
$(()) is more portable than let, who knew...
2015-03-03 11:31:22 -08:00
Behdad Esfahbod
e02b9ea05b Fix tests to return failures 2015-03-03 10:47:40 -08:00
Behdad Esfahbod
47cd66e43b Make run-tests.sh call doctest module directly
This makes it fail correctly.  Also, run doctest in verbose mode.
2015-03-03 10:47:20 -08:00
Behdad Esfahbod
f439e7b07d Really fix test runner this time
Still doesn't work as we don't return failure from the Python fails
if doctests fail.  But the test runner script is correct now.
2015-03-03 10:39:55 -08:00
Behdad Esfahbod
a0befdc025 Make run-tests.sh fail if any tests failed! 2015-03-03 10:16:01 -08:00
Behdad Esfahbod
f192400039 Fix checks; add run-tests.sh 2015-03-03 09:57:41 -08:00
Behdad Esfahbod
b8fdab95f6 [TravisCI] Fix build (hopefully); run tests 2015-03-03 09:52:47 -08:00
Behdad Esfahbod
822b3f630e [TravisCI] make install explicit 2015-03-03 09:21:30 -08:00
Behdad Esfahbod
f5a6c2f1de Add TravisCI settings 2015-03-03 09:14:54 -08:00
Behdad Esfahbod
612c70dada [SVG] Support gzip-compressed SVG tables
Set font['SVG '].compressed=True to enable.  Here's a snippet to convert a
WOFF-compressed SVG+OpenType font to a compressed SVG+OpenType non-WOFF font:

from fontTools.ttLib import TTFont
font = TTFont("NotoColorEmojiSvg.woff")
font['SVG '].compressed=True
font.flavor=None
font.save("NotoColorEmojiSvgCompressed.ttf")
2015-03-02 15:41:57 -08:00
Behdad Esfahbod
b1f46be65c Minor 2015-03-02 15:22:39 -08:00
Behdad Esfahbod
9fc8ac0559 Whitespace 2015-03-02 13:05:29 -08:00
Behdad Esfahbod
5a7ec608c8 Fix SVG doc length calculations
Patch from Doug Felt.
2015-02-23 14:03:06 -08:00