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
Cosimo Lupo
1fbdbca41a
[OS/2] update fsFirstCharIndex and fsLastCharIndex upon compile;
...
add comment to XML output;
use all unicode cmap subtables, but set 0xFFFF as max value for USHORT
2015-05-09 10:17:12 +01:00
Sascha Brawer
5cda3d4e72
Minor fixes to reduce the number of code smells
2015-05-06 19:17:08 +02:00
Behdad Esfahbod
3d6932549c
Fix immediate decompiling of cmap subtables
...
This codepath never worked, and is never exercised during normal operations.
Found by landscape.io.
2015-04-26 03:01:25 -04:00
Behdad Esfahbod
f588727554
Fixup; ouch!
2015-04-26 02:06:36 -04:00
Behdad Esfahbod
b30e12ae00
More whitespace
2015-04-26 02:01:01 -04:00
Behdad Esfahbod
bd67253118
Some more whitespace fixes from pep8 tool
2015-04-26 01:59:01 -04:00
Behdad Esfahbod
5287b52d22
Whitespace
2015-04-26 00:49:36 -04:00
Behdad Esfahbod
cc072eca9f
Use utf_16_be instead of utf_16be
...
That's the canonical name.
https://github.com/behdad/fonttools/issues/236
2015-04-24 12:48:37 -07:00
Behdad Esfahbod
0ac019ca2c
Use native mac_romanian and mac_croatian encodings
...
Apparently they are implemented in Python, just miss aliases.
https://github.com/behdad/fonttools/issues/236
http://bugs.python.org/issue24043
2015-04-24 12:32:56 -07:00
Behdad Esfahbod
2df891f25c
Handle double-encoded UTF-16BE
...
Merge the logic with the marked-Mac-but-UTF-16BE logic.
Fixes https://github.com/behdad/fonttools/issues/249
2015-04-22 02:22:11 -07:00
Behdad Esfahbod
c4fb6459b0
Handle Mac-marked actual-UTF-16BE ASCII-only name
...
This seems to take care of quite a few of misencoded files I've found.
2015-04-22 02:15:51 -07:00
Behdad Esfahbod
2d443eeac2
Tighten check for ASCII in previous commit
2015-04-22 01:59:50 -07:00
Behdad Esfahbod
7e4092aba8
Implement heuristics for decoding odd-length UTF-16BE data in name table
...
Part of https://github.com/behdad/fonttools/issues/249
2015-04-22 01:55:43 -07:00
Behdad Esfahbod
abf7dc6568
If Unicode-compatible name failed to decode, write unicode="False"
2015-04-22 01:16:34 -07:00
Behdad Esfahbod
13d53f081c
Minor
2015-04-21 11:08:49 -07:00
Behdad Esfahbod
d73e707317
Always write encoding as "UTF-8" in XML output
...
Fixes https://github.com/behdad/fonttools/issues/246
2015-04-21 11:07:48 -07:00
Behdad Esfahbod
aa74114f1d
Use cannonical encoding ids
2015-04-20 18:21:46 -07:00
Behdad Esfahbod
702b94f00a
Use canonical Python encoding names
2015-04-19 04:24:55 -07:00
Behdad Esfahbod
5a18fc83e6
Add getEncoding() to cmap subtables
2015-04-19 03:50:55 -07:00
Behdad Esfahbod
e561b758c1
Move getEncoding into fontTools.misc.encodingTools
...
Logic developed as part of:
https://github.com/behdad/fonttools/pull/208
2015-04-19 03:36:20 -07:00
Behdad Esfahbod
6e01a6e350
Add Roman Croatian and Romanian encodings
...
Concludes https://github.com/behdad/fonttools/issues/236
2015-04-16 18:24:07 -07:00
Behdad Esfahbod
ba0a3b9abb
Revamp name table Unicode handling some more
...
Part of https://github.com/behdad/fonttools/issues/236
Now we fallback to ASCII for unknown encodings. Not sure if this might be a bad idea.
The main user-visible difference is that if there's an ASCII-only text in an unknown
encoding, we still "decode" it and use unicode="True" instead of unicode="False".
Or is assuming that any unsupported encoding is ASCII-compatible too intrusive?
2015-04-16 17:09:49 -07:00
Sascha Brawer
b82b50cbfb
Raise UnicodeDecodeError for structurally invalid names
...
This will make it impossible to process fonts with super-broken
name tables. But we do not handle arbitrary broken fonts anyway,
so this is arguably better than silently ignoring junk content.
Resolves a review comment in #235 .
In the unit test, replace calls of deprecated unittest.assertEquals()
by calls of unittest.assertEqual().
2015-04-16 16:32:30 -07:00
Behdad Esfahbod
4ba27843a9
Fix drawing of glyf's after numpy removal!
...
Should really start adding tests for these...
Fixes https://github.com/behdad/fonttools/issues/238
2015-04-16 03:26:06 -07:00
Behdad Esfahbod
eed0439c8b
Adjust name table to understand extended Mac East Asian encodings
...
Part of https://github.com/behdad/fonttools/issues/236
2015-04-16 03:18:20 -07:00
Behdad Esfahbod
a2d063c840
Implement mac-platform roman-encoding language-specific name table encodings
...
Part of https://github.com/behdad/fonttools/issues/236
2015-04-16 01:17:06 -07:00
Behdad Esfahbod
a310df0848
Implement more legacy Mac name table encodings
...
Based on https://github.com/behdad/fonttools/issues/236
2015-04-15 23:44:07 -07:00
Sascha Brawer
af944354d2
Emit XML even for names whose platform encoding is unsupported
...
When dumping the Macintosh Skia font to XML, the TTX tool crashed
with a Python exception. After this change, the font can be dumped
fine. This was caused by a name record with platformID=1 (Macintosh)
and platEncID=2 (Traditional Chinese).
2015-04-15 23:01:00 -07:00
Sascha Brawer
012049d7fb
Add unit tests for ltag table
...
Resolves #226 and #227 .
2015-04-15 10:56:28 -07:00
Sascha Brawer
dc8a66956a
Support 'ltag' table for IETF BCP-47 language tags
...
Resolves #226
2015-04-14 17:50:42 -07:00
Behdad Esfahbod
7c9ab300c2
Add standard imports to all python sources
...
Previously, the trivial files didn't have them.
2015-04-14 17:26:59 -07:00
Behdad Esfahbod
9db2ace931
Fix ttProgram test for Python3
2015-04-14 13:25:19 -07:00
Behdad Esfahbod
2702a5b879
Hook up ttProgram tests to doctest
2015-04-14 11:51:03 -07:00
Behdad Esfahbod
5cd4e51450
Update MetaTools/buildTableList.py for recent changes
2015-04-14 00:17:52 -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
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
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