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
4c3fbd2600
Minor
2015-04-23 16:28:30 -07:00
Behdad Esfahbod
ffd2e35371
[subset] Add note re --desubroutinize resulting in smaller WOFF/WOFF2
2015-04-22 16:02:59 -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
Sascha Brawer
dfe0b85b9d
Test that XMLWriter keeps capitalization of passed encoding
...
Unit test for #246
2015-04-21 11:01:01 -07:00
Behdad Esfahbod
aa74114f1d
Use cannonical encoding ids
2015-04-20 18:21:46 -07:00
Behdad Esfahbod
5580c60b64
Fix build
2015-04-20 18:20:04 -07:00
Behdad Esfahbod
00c89aa9cf
Preserve case and other detail of XML encoding passed in
...
Part of fixing https://github.com/behdad/fonttools/issues/246
Or, should I alsways write "UTF-8" for the sake of consistency?
I think I actually like doing that.
2015-04-20 18:04:47 -07:00
Behdad Esfahbod
9d37988235
Make makeOutputFilename's overwrite argument optional
...
6d7f3bf840 (commitcomment-10807720)
2015-04-20 11:50:37 -07:00
Behdad Esfahbod
9f8742306c
Minor
2015-04-20 10:00:18 -07:00
Behdad Esfahbod
fc7d3b52ed
Upgrade Mac East Asian encodings to native implementation if available
...
Fixes https://github.com/behdad/fonttools/issues/236
2015-04-19 04:52:25 -07:00
Behdad Esfahbod
42fbc21069
Fix x_mac Chinese names
2015-04-19 04:46:12 -07:00
Behdad Esfahbod
11b93b8491
Use canonical name of Wansung: euc_kr
2015-04-19 04:36:52 -07:00
Behdad Esfahbod
5036a39e3f
Normalize encoding name for lookup
2015-04-19 04:28:22 -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
12c3f6ecd4
Docstring
2015-04-19 03:20:02 -07:00
Cosimo Lupo
1b58b828af
[bezierTools] fix bug in splitLine function
...
The function was returning wrong values when the two points are
vertically aligned and the split 'isHorizontal':
Fixes https://github.com/behdad/fonttools/issues/241
2015-04-19 03:10:59 -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
schriftgestalt
6d7f3bf840
[ttx] Add -f option to overwrite output file(s)
...
Fixes https://github.com/behdad/fonttools/pull/208
2015-04-16 17:55:22 -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
Behdad Esfahbod
f419f572db
Add TODO
2015-04-16 16:35:51 -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
3f36721d87
Really fix python 2.6 build this time
2015-04-16 14:12:59 -07:00
Behdad Esfahbod
c9402c1685
Fix test on Python 2.6
2015-04-16 13:40:35 -07:00
Behdad Esfahbod
eefeb258ef
Fix codecs end check
...
There was a bug before Python 3.4 where an extra byte was included
in e.end when the error callback was called. That hided a bug in
the code.
Fixes build with Python 3.4+
2015-04-16 13:31:08 -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
9d6d50e829
Add codecs for mac-extended East Asian encodings
...
Part of https://github.com/behdad/fonttools/issues/236
To be used in name table soon.
2015-04-16 03:10:18 -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
Behdad Esfahbod
3619126d26
Use os.linesep for line separator in xmlWriter
2015-04-15 17:41:30 -07:00
Sascha Brawer
012049d7fb
Add unit tests for ltag table
...
Resolves #226 and #227 .
2015-04-15 10:56:28 -07:00
Behdad Esfahbod
034ed355de
Fix bytes/unicode detection
...
https://github.com/behdad/fonttools/pull/233
2015-04-15 10:44:39 -07:00
Behdad Esfahbod
8b0152f0a1
Fix XMLWriter to take sinks that accept both bytes() and unicodes()
...
Fix xmlWriter_test with python3 as well.
2015-04-14 19:07:34 -07:00
Sascha Brawer
2ac42ad3ec
Support unittests in addition to doctests
...
The Python libraries come with two ways of writing unittests:
module unittest, and module doctest. In some cases, unittest
is more natural (less cumbersome) than doctest.
Wrote tests on xmlWriter for illustration.
2015-04-14 17:52:17 -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