@@ -55,7 +55,7 @@ def _to_bool(s):
5555
5656def _sanity_check (fh ):
5757 """
58- Check if the file at least looks like AFM.
58+ Check if the file at least looks like AFM.
5959 If not, raise RuntimeError.
6060 """
6161
@@ -125,9 +125,9 @@ def _parse_header(fh):
125125 #print '%-s\t%-d line :: %-s' % ( fh.name, len(lst), line )
126126 key = lst [0 ]
127127 if len ( lst ) == 2 :
128- val = lst [1 ]
128+ val = lst [1 ]
129129 else :
130- val = ''
130+ val = ''
131131 #key, val = line.split(' ', 1)
132132 try : d [key ] = headerConverters [key ](val )
133133 except ValueError :
@@ -377,7 +377,7 @@ def get_str_bbox(self, s):
377377 Return the string bounding box
378378 """
379379 return self .get_str_bbox_and_descent (s )[:4 ]
380-
380+
381381 def get_name_char (self , c , isord = False ):
382382 """
383383 Get the name of the character, ie, ';' is 'semicolon'
@@ -401,7 +401,7 @@ def get_width_from_char_name(self, name):
401401 """
402402 wx , bbox = self ._metrics_by_name [name ]
403403 return wx
404-
404+
405405 def get_height_char (self , c , isord = False ):
406406 """
407407 Get the height of character c from the bounding box. This is
@@ -426,7 +426,7 @@ def get_kern_dist_from_name(self, name1, name2):
426426 """
427427 try : return self ._kern [ (name1 , name2 ) ]
428428 except : return 0
429-
429+
430430 def get_fontname (self ):
431431 "Return the font name, eg, Times-Roman"
432432 return self ._header ['FontName' ]
@@ -472,7 +472,7 @@ def get_vertical_stem_width(self):
472472 not specified in AFM file.
473473 """
474474 return self ._header .get ('StdVW' , None )
475-
475+
476476
477477if __name__ == '__main__' :
478478 #pathname = '/usr/local/lib/R/afm/'
@@ -482,6 +482,3 @@ def get_vertical_stem_width(self):
482482 fh = file (os .path .join (pathname ,fname ))
483483 afm = AFM (fh )
484484 w ,h = afm .string_width_height ('John Hunter is the Man!' )
485-
486-
487-
0 commit comments