1476 Commits

Author SHA1 Message Date
Sascha Brawer
37a79a330c [feaLib] Fix generated LigatureSubst lookups 2015-10-27 22:53:50 +01:00
Behdad Esfahbod
d6e186d40f Simplify AlternateSubst slightly 2015-10-27 14:11:04 -07:00
Sascha Brawer
3f5e2ae820 [feaLib] Add expected output for chain substitution rules
Generated by running example 1 from the Feature File specification
section 5.f.i (Specifying a Chain Sub rule and marking sub-runs)
through AFDKO's makeotf tool, and then decompiling the resulting
GSUB table with ttx.

The actual test is commented out because the current version of feaLib
is not able to produce this output yet; marked with a TODO comment.
2015-10-27 20:36:56 +01:00
Sascha Brawer
dbefc71d23 [feaLib] Minor: Rename a test file, for consistency with other test caes
It is example 1 in section 5.f.i of the specification, and there
more examples in the same section. For consistency, use the same convention
as the other test cases.
2015-10-27 19:59:25 +01:00
Cosimo Lupo
f8e8ea6e7f [macRes] use tostr(s, encoding='mac-roman') for resource types and names 2015-10-26 14:38:20 +00:00
Cosimo Lupo
c4e05b48b3 [t1Lib_test] forgot to add unittest.main()
I use py.test ;)
2015-10-26 05:23:59 +00:00
Cosimo Lupo
2f212ac59a [macRes] add default value [] to self.get(resType)
ops!
2015-10-26 05:16:22 +00:00
Cosimo Lupo
620db1f9a3 [t1Lib_test] also test parsing LWFN (dumped to data fork) 2015-10-26 04:40:04 +00:00
Cosimo Lupo
4b9087c000 [t1Lib] add TestT1-Regular.lwfn to testdata 2015-10-26 04:40:04 +00:00
Cosimo Lupo
fb6efd0f23 [t1Lib] use macRes.ResourceReader to read 'POST' resources from LWFN;
add comment about Res.FSpCreateResFile being deprecated since OS X 10.5

(a resource file writer would be nice, by low priority)
2015-10-26 04:40:04 +00:00
Cosimo Lupo
f41838edfe [macUtils] use macRes.ResourceReader to read 'sfnt' resources 2015-10-26 04:40:04 +00:00
Cosimo Lupo
17e757300c [macRes_test] add tests for ResourceReader 2015-10-26 04:40:00 +00:00
Cosimo Lupo
db70dee031 [macRes] new module and ResourceReader to read Mac resource/data forks
inspired by Sascha Brawer's GNU Classpath Java implementation

https://gcc.gnu.org/viewvc/gcc/trunk/libjava/classpath/gnu/java/awt/font/opentype/MacResourceFork.java?view=co&content-type=text%2Fplain
2015-10-26 04:40:00 +00:00
Cosimo Lupo
363893d1fc [macCreatorType] try to use xattr module if installed
xattr is a Python wrapper for extended filesystem attributes, which works
with both Python 2 and 3: https://pypi.python.org/pypi/xattr
2015-10-26 03:49:31 +00:00
Cosimo Lupo
d7f6e1df00 [ttLib] remove 'haveMacSupport' flag, allow other platforms to read sfnt resources (from data fork)
On non-Mac filesystems the resource fork is absent.
2015-10-26 03:34:03 +00:00
Cosimo Lupo
8891e98920 remove MacOS-only misc/homeResFile.py module (no longer used) 2015-10-26 03:34:03 +00:00
Cosimo Lupo
e1e2178a52 [ttLib] drop support for pre-OSX "mac" platform
- only check for 'darwin' for 'haveMacSupport'
- remove 'makeSuitcase' arg from TTFont.save();
- don't setMacCreatorAndType
2015-10-25 14:42:43 +00:00
Cosimo Lupo
8279095b6f [t1Lib_test] add test cases for parsing and writing PS Type1 2015-10-22 19:55:34 +01:00
Cosimo Lupo
dfce582196 add test PS Type1 fonts in .pfa and .pfb format 2015-10-22 19:55:34 +01:00
Cosimo Lupo
6c51e3de97 [t1Lib] fix TypeError in writeOther func 2015-10-22 19:55:34 +01:00
Cosimo Lupo
aa7753cebf [t1Lib] add 'dohex' kwarg to saveAs (it only applies to 'OTHER' type (PFA)) 2015-10-22 19:55:34 +01:00
Cosimo Lupo
07042e7c88 [t1Lib] fix longToString function 2015-10-22 19:55:33 +01:00
Cosimo Lupo
6523449cc8 [t1Lib] mv t1Lib.py t1Lib/__init__.py 2015-10-22 19:55:33 +01:00
Cosimo Lupo
d0b6bdafa0 [psLib] make PSTokenizer indipendent StringIO-like object; fix issues with python3 (bytes vs unicode)
PSTokenizer is now an indipendent object behaving like a StringIO.StringIO: it has `read` and `close` methods, as well as `buf`, `pos` and `len` attributes.

The input data is a string of bytes, and the output tokens are ascii-decoded unicode strings.

(I removed "__main__" as it was using a non-py23 EasyDialogs module)

See https://github.com/behdad/fonttools/issues/393.

Related to https://github.com/behdad/fonttools/issues/391.
2015-10-22 19:55:33 +01:00
Cosimo Lupo
e7fb2cf879 [t1Lib] convert str to bytes 2015-10-22 19:54:53 +01:00
Cosimo Lupo
1c2fe9c37c [eexec] use bytes instead of str; add doctests to encrypt and decrypt functions 2015-10-22 19:54:53 +01:00
Cosimo Lupo
08d134a8ee [t1Lib] mention in docstring that the module is python2 only -- for now. 2015-10-21 13:15:05 +01:00
Cosimo Lupo
565d36c511 [psLib] revert to StringIO.StringIO; temporarily drop support for py3
Reverts commit bf0e336d316518115a7b47da4f721bb8a009b3e1
Fixes https://github.com/behdad/fonttools/issues/391

...though only temporarily.
2015-10-21 13:14:48 +01:00
Sascha Brawer
d8d5ab2c29 Test OTTableReader.getSubReader()
Also removing unused stats collection. The need for setting up
an object to collect these (unused) stats made it hard to write
tests on code that called OTTableReader.getSubReader().
2015-10-18 00:09:32 +02:00
Sascha Brawer
582852119c Implement OTTableReader.readUShortArray()
There is currently only one single call site in the codebase,
but this function will be needed a lot for parsing `morx` and
other AAT tables.
2015-10-17 06:47:52 +02:00
Behdad Esfahbod
29cc978f43 Improve assertion message 2015-10-15 20:01:56 -03:00
Sascha Brawer
520918375f [otTables] Support uint8 type in otTables 2015-10-16 00:17:22 +02:00
Sascha Brawer
1288a58eb1 Test core functions of OTTableReader and OTTableWriter 2015-10-16 00:05:52 +02:00
Sascha Brawer
b5e29cca9a [GSUB] Parse old-syntax MultipleSubst that has no index attribute
Apparently, earlier versions of TTX had produced XML whose
MultipleSubst.Sequence element came without an index attribute.
Resolves https://github.com/behdad/fonttools/issues/385
2015-10-13 17:44:53 +02:00
James Godfrey-Kittle
8b4c3b7892 Add assertion and comments to ttGlyphPen 2015-10-06 09:14:04 -07:00
James Godfrey-Kittle
b916c5bb93 ttGlyphPen: handle qcurves with no on-curve points 2015-10-06 09:12:15 -07:00
James Godfrey-Kittle
b0c03b86d6 Add pen which draws to TrueType glyphs. 2015-10-01 15:12:20 -07:00
Sascha Brawer
c5d6c6f58a Merge pull request #381 from anthrotype/trak
[trak] add AAT 'trak' table support
2015-10-01 14:43:43 +02:00
Cosimo Lupo
12bde8e97a [_n_a_m_e_test] use toUnicode() instead of built-in str() for py2 compat
NameRecord.__str__ returns a unicode string, but on Python2 the built-in str()
expects a bytestring, therefore it raises

UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128)

We should probably change that as well.
2015-10-01 11:41:46 +01:00
Cosimo Lupo
898199f2bc [_n_a_m_e_test] add test_setName test case 2015-10-01 10:12:29 +01:00
Cosimo Lupo
a0a400d9c1 [name] add setName method to table__n_a_m_e
If the referenced name record already exists, the string is modified in place.
If it doesn't exist, a new record is created with the given IDs and string.
2015-10-01 10:11:48 +01:00
Cosimo Lupo
d20dec29db [trak] remove redundant if-else block
If nTracks == 0, nSizes is also == 0, the `else` part is sufficient.
There's a limit case when nTracks can be > 0, and nSizes == 0, but it's
unlikely or useless.
2015-10-01 09:29:04 +01:00
Cosimo Lupo
4f5419fdec [ttLib] add _t_r_a_k to list of available tables 2015-09-30 20:19:35 +01:00
Cosimo Lupo
380104c228 [_t_r_a_k_test] add tests for trak table 2015-09-30 20:19:35 +01:00
Cosimo Lupo
cb36478d4b [testTools] add getXML function to get the XMLWriter content as string 2015-09-30 20:19:35 +01:00
Cosimo Lupo
4eb134f5e4 [trak] add AAT 'trak' table support 2015-09-30 20:16:47 +01:00
Sascha Brawer
a596845801 [ltag] Use tobytes() instead of string.encode("ascii")
Addresses review comment 7f70a79fc8 (commitcomment-13471742)
2015-09-28 17:25:01 +02:00
Sascha Brawer
75e4053e39 [feaLib] Handle references to named lookup blocks 2015-09-28 16:49:17 +02:00
Sascha Brawer
3182162cbe Merge pull request #379 from moyogo/meta
meta table: 'dlng' and 'slng' data is text
2015-09-25 08:12:20 +02:00
moyogo
2917e34dcb meta: test 'dlng' and 'slng' 2015-09-24 17:03:40 +01:00