10056 Commits

Author SHA1 Message Date
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
687a0e7ee3 Merge pull request #394 from anthrotype/psLib-py23
make t1Lib and psLib compatible with python 3
2015-10-24 08:48:48 +01:00
James Godfrey-Kittle
e85b975f3a Fix imports in t2CharStringPen
We don't need the array module here, and it looks like py23.* should
be imported everywhere.
2015-10-23 11:36:46 -07:00
James Godfrey-Kittle
82e53f020c Use Python3-compatible arguments for roundIntPoint 2015-10-23 11:23:21 -07:00
James Godfrey-Kittle
7b3ac62db7 Add pen which draws to Type 2 charstrings 2015-10-23 11:15:16 -07: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
894a52a90f Merge pull request #392 from anthrotype/no-buf-attr
[psLib] revert to using StringIO.StringIO; temporarily drop support for Python3
2015-10-21 13:18:30 +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
Behdad Esfahbod
f66585ca29 Strip items 2015-10-17 03:58:44 -03:00
Behdad Esfahbod
60782c5e92 Implement ligature subtitutions 2015-10-17 03:43:31 -03:00
Behdad Esfahbod
dffdd91aec Implement SingleSubst 2015-10-17 03:30:31 -03:00
Behdad Esfahbod
9a7746a545 Parse lookup flags 2015-10-17 03:01:08 -03:00
Behdad Esfahbod
4ed7a1d6ad Start parsing lookups 2015-10-17 02:55:00 -03:00
Behdad Esfahbod
c3ddaa9d23 Parse GSUB/GPOS ScriptList/FeatureList 2015-10-17 02:26:22 -03: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
3e90757f6e Initial commit 2015-10-17 00:47:12 -03: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
Cosimo Lupo
0b09d33d8a Merge pull request #383 from jamesgk/new-pen
Add pen which draws to TrueType glyphs
2015-10-06 21:26:57 +01: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
jamesgk
d0797e4f4b Add contributing and readme files 2015-10-05 18:14:26 -07:00
jamesgk
add9cf1d4d Add license. 2015-10-05 18:14:16 -07:00
jamesgk
10b1e9f500 More descriptive variable names. 2015-10-05 17:36:36 -07:00
jamesgk
2712c74b37 Add comments, fix comment formatting. 2015-10-05 16:01:11 -07:00
jamesgk
2c33e23bf3 Make "python setup.py install" actually work.
convert_curves is just a module (file), not a package (directory).
2015-10-05 15:58:58 -07:00
jamesgk
b1c4f96001 Don't allow this to be run as a script 2015-10-01 17:59:40 -07:00
jamesgk
c6c61105d8 Clean up stuff
There should be no changed functionality here. Just cleaning:
- Consistent variable naming style
- Consistent quote types for strings
- No lines over 80 characters
- At least some comment for every function
- Get rid of excessive error catching
2015-10-01 17:41:19 -07:00
jamesgk
a411cd2138 Handle segment.as_quadratic like replace_segments
Have a non-collection function for this, then a method of
SegmentCollection which uses that function.
2015-10-01 17:40:19 -07:00
jamesgk
72fef95dfd Return a report of conversion 2015-10-01 17:14:58 -07:00
jamesgk
a23b97e79c Take max N and max error as user inputs 2015-10-01 17:10:40 -07:00
jamesgk
e686d61aeb Initial commit 2015-10-01 17:09:28 -07:00