26 Commits

Author SHA1 Message Date
Just van Rossum
b00c50b502 Remove false Python 2 remark 2023-08-04 07:37:59 +02:00
Just van Rossum
2808d995b2 Fix several issues exposed by the fonts posted in #3238
- fix when /Private follows /CharStrings instead of vv
- fix expected ND and PD values
- handle the case where lenIV is not 4 (writing)
- write /Subrs properly, not just the "standard 5"
2023-08-03 16:39:10 +02:00
Nikolaus Waxweiler
d584daa8fd Blacken code 2022-12-13 11:26:36 +00:00
derwind
b437417b71
Added the ability to recreate the PS stream (#2504)
* added the ability to recreate the PS stream

This fixes #2503
2022-02-10 15:53:12 +01:00
Khaled Hosny
232b2ccbc4 Move the rest of py23 module to textTools
Change all imports to use textTools module, except the test_py23.py test
which is kept until we decide to remove the module (if ever).
2021-08-20 01:29:45 +02:00
Just van Rossum
5fc65d7168
Misc py23 cleanups (#2243)
* Replaced all from ...py23 import * with explicit name imports, or removed completely when possible.
* Replaced tounicode() with tostr()
* Changed all BytesIO ans StringIO imports to from io import ..., replaced all UnicodeIO with StringIO.
* Replaced all unichr() with chr()
* Misc minor tweaks and fixes
2021-03-29 11:45:58 +02:00
Nikolaus Waxweiler
01328213c7 Remove __future__ imports 2019-08-09 12:20:13 +01:00
Bailey Parker
e9802c50bb
Fixes style 2019-08-01 01:08:25 -04:00
Bailey Parker
6f4e44f13d
Fixes #1675 - T1 eexec end finding spec compliance
The T1 spec (https://www-cdf.fnal.gov/offline/PostScript/T1_SPEC.PDF) on
page 14 says that:

> The text encrypted by eexec must be followed by 512 ASCII zeros. There may be
> white space characters (blank, tab, carriage return or line feed)
> interspersed among these zeros.

  * Add a failing test case with white space characters interspersed
    among the trailing zeros after the eexec

  * Fix eexec end finding so that it passes this new test case
2019-08-01 00:02:12 -04:00
Just van Rossum
327b05d8c0
[designspaceLib] [t1Lib] [misc.macRes] fix some cases where pathlib.Path objects were not accepted (#1421)
* fix two cases where pathlib.Path objects were not accepted

* make macRes reader accept os.PathLike objects

* use __fspath__ explicitly to support os.PathLike paths

* use __fspath__ explicitly to support os.PathLike paths

* convert tmpdir to str

* only test pathlib.Path on Python 3.6 and up
2018-12-30 12:07:05 +01:00
Mickaël Schoentgen
52e855e4a4 Use the 'with' context manager when dealing with files 2018-10-01 08:42:45 +02:00
Cosimo Lupo
c5c161c055
t1Lib: add 'kind' argument to T1Font constructor
fixes issue introduced with last commit
b1fd6fbbcd

t1Lib_test.py::test_parse_lwfn was relying on 'path' being None.
2018-04-13 12:55:24 +02:00
Cosimo Lupo
b1fd6fbbcd
t1Lib: make 'path' argument required 2018-04-12 15:21:25 +02:00
justvanrossum
52ea50f4bc allow an encoding to be specified when parsing a Type 1 font 2018-04-12 14:39:44 +02:00
Cosimo Lupo
78ad48eaf3
Move all *_test.py modules and test data to external Tests/ folder 2017-01-16 09:14:12 +00:00
Cosimo Lupo
49bcbb916b
consistently do sys.exit(unittest.main()) in all test modules
So that when run as scrips they report test failures with exit code

Follow up on b7bb391033ef3255c90134da3d7aef50d2d5326d
2017-01-11 13:05:35 +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
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
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