@@ -462,8 +462,8 @@ def __init__(self, filename):
462
462
self .fontNames = {} # maps filenames to internal font names
463
463
self .nextFont = 1 # next free internal font name
464
464
self .dviFontInfo = {} # information on dvi fonts
465
- self . type1Descriptors = {} # differently encoded Type-1 fonts may
466
- # share the same descriptor
465
+ # differently encoded Type-1 fonts may share the same descriptor
466
+ self . type1Descriptors = {}
467
467
self .used_characters = {}
468
468
469
469
self .alphaStates = {} # maps alpha values to graphics state objects
@@ -480,8 +480,7 @@ def __init__(self, filename):
480
480
481
481
self .paths = []
482
482
483
- self .pageAnnotations = [] # A list of annotations for the
484
- # current page
483
+ self .pageAnnotations = [] # A list of annotations for the current page
485
484
486
485
# The PDF spec recommends to include every procset
487
486
procsets = [Name (x )
@@ -769,7 +768,7 @@ def createType1Descriptor(self, t1font, fontfile):
769
768
'FontFamily' : t1font .prop ['FamilyName' ],
770
769
'StemV' : 50 , # TODO
771
770
# (see also revision 3874; but not all TeX distros have AFM files!)
772
- #'FontWeight': a number where 400 = Regular, 700 = Bold
771
+ # 'FontWeight': a number where 400 = Regular, 700 = Bold
773
772
}
774
773
775
774
self .writeObject (fontdescObject , descriptor )
@@ -1251,8 +1250,8 @@ def imageObject(self, image):
1251
1250
self .images [image ] = (name , ob )
1252
1251
return name
1253
1252
1254
- ## These two from backend_ps.py
1255
- ## TODO: alpha (SMask, p. 518 of pdf spec)
1253
+ # These two from backend_ps.py
1254
+ # TODO: alpha (SMask, p. 518 of pdf spec)
1256
1255
1257
1256
def _rgb (self , im ):
1258
1257
h , w , s = im .as_rgba_str ()
@@ -1710,10 +1709,8 @@ def draw_markers(self, gc, marker_path, marker_trans, path, trans,
1710
1709
simplify = False ):
1711
1710
if len (vertices ):
1712
1711
x , y = vertices [- 2 :]
1713
- if (x < 0 or
1714
- y < 0 or
1715
- x > self .file .width * 72 or
1716
- y > self .file .height * 72 ):
1712
+ if (x < 0 or y < 0 or
1713
+ x > self .file .width * 72 or y > self .file .height * 72 ):
1717
1714
continue
1718
1715
dx , dy = x - lastx , y - lasty
1719
1716
output (1 , 0 , 0 , 1 , dx , dy , Op .concat_matrix ,
@@ -1970,8 +1967,8 @@ def check_simple_method(s):
1970
1967
chunks [- 1 ][1 ].append (c )
1971
1968
else :
1972
1969
chunks .append ((char_type , [c ]))
1973
- use_simple_method = (len (chunks ) == 1
1974
- and chunks [- 1 ][0 ] == 1 )
1970
+ use_simple_method = (len (chunks ) == 1 and
1971
+ chunks [- 1 ][0 ] == 1 )
1975
1972
return use_simple_method , chunks
1976
1973
1977
1974
def draw_text_simple ():
@@ -2255,7 +2252,7 @@ def clip_cmd(self, cliprect, clippath):
2255
2252
cmds .extend (self .pop ())
2256
2253
# Unless we hit the right one, set the clip polygon
2257
2254
if ((self ._cliprect , self ._clippath ) != (cliprect , clippath ) or
2258
- self .parent is None ):
2255
+ self .parent is None ):
2259
2256
cmds .extend (self .push ())
2260
2257
if self ._cliprect != cliprect :
2261
2258
cmds .extend ([cliprect , Op .rectangle , Op .clip , Op .endpath ])
@@ -2417,8 +2414,8 @@ def close(self):
2417
2414
PDF file.
2418
2415
"""
2419
2416
self ._file .close ()
2420
- if (self .get_pagecount () == 0 and not self .keep_empty
2421
- and not self ._file .passed_in_file_object ):
2417
+ if (self .get_pagecount () == 0 and not self .keep_empty and
2418
+ not self ._file .passed_in_file_object ):
2422
2419
os .remove (self ._file .fh .name )
2423
2420
self ._file = None
2424
2421
0 commit comments