@@ -102,7 +102,7 @@ class TFMError(exceptions.Exception): pass
102102
103103class char_info_word :
104104 def __init__ (self , word ):
105- self .width_index = int ((word & 0xFF000000L ) >> 24 ) #make sign-safe
105+ self .width_index = int ((word & 0xFF000000 ) >> 24 ) #make sign-safe
106106 self .height_index = (word & 0x00F00000 ) >> 20
107107 self .depth_index = (word & 0x000F0000 ) >> 16
108108 self .italic_index = (word & 0x0000FC00 ) >> 10
@@ -135,10 +135,10 @@ def __init__(self, name, debug=0):
135135 self .ne <= 256 and
136136 self .lf == 6 + self .lh + (self .ec - self .bc + 1 )+ self .nw + self .nh + self .nd
137137 + self .ni + self .nl + self .nk + self .ne + self .np ):
138- raise TFMError , "error in TFM pre-header"
138+ raise TFMError ( "error in TFM pre-header" )
139139
140140 if debug :
141- print "lh=%d" % self .lh
141+ print ( "lh=%d" % self .lh )
142142
143143 #
144144 # read header
@@ -160,9 +160,9 @@ def __init__(self, name, debug=0):
160160 self .fontfamily = None
161161
162162 if debug :
163- print "(FAMILY %s)" % self .fontfamily
164- print "(CODINGSCHEME %s)" % self .charcoding
165- print "(DESINGSIZE R %f)" % 16.0 * self .designsize / 16777216L
163+ print ( "(FAMILY %s)" % self .fontfamily )
164+ print ( "(CODINGSCHEME %s)" % self .charcoding )
165+ print ( "(DESINGSIZE R %f)" % 16.0 * self .designsize / 16777216 )
166166
167167 if self .lh > 17 :
168168 self .sevenbitsave = self .file .readuchar ()
@@ -201,7 +201,7 @@ def __init__(self, name, debug=0):
201201
202202 if self .lh > 18 :
203203 # just ignore the rest
204- print self .file .read ((self .lh - 18 )* 4 )
204+ print ( self .file .read ((self .lh - 18 )* 4 ) )
205205
206206 #
207207 # read char_info
@@ -392,9 +392,9 @@ def readfontmap(filenames):
392392 if not (line == "" or line [0 ] in (" " , "%" , "*" , ";" , "#" )):
393393 try :
394394 fm = fontmapping (line )
395- except (RuntimeError , UnsupportedPSFragment ), e :
395+ except (RuntimeError , UnsupportedPSFragment ) as e :
396396 warnings .warn ("Ignoring line %i in mapping file '%s': %s" % (lineno , mappath , e ))
397- except UnsupportedFontFormat , e :
397+ except UnsupportedFontFormat as e :
398398 pass
399399 else :
400400 fontmap [fm .texname ] = fm
@@ -468,16 +468,16 @@ class fontinfo:
468468
469469 def __str__ (self ):
470470 return "font %s designed at %g TeX pts used at %g TeX pts" % (self .name ,
471- 16.0 * self .d / 16777216L ,
472- 16.0 * self .q / 16777216L )
471+ 16.0 * self .d / 16777216 ,
472+ 16.0 * self .q / 16777216 )
473473 __repr__ = __str__
474474
475475 def getsize_pt (self ):
476476 """ return size of font in (PS) points """
477- # The factor 16L/16777216L =2**(-20) converts a fix_word (here self.q)
477+ # The factor 16/16777216 =2**(-20) converts a fix_word (here self.q)
478478 # to the corresponding float. Furthermore, we have to convert from TeX
479479 # points to points, hence the factor 72/72.27.
480- return 16L * self .q / 16777216L * 72 / 72.27
480+ return 16 * self .q / 16777216 * 72 / 72.27
481481
482482 def _convert_tfm_to_dvi (self , length ):
483483 # doing the integer math with long integers will lead to different roundings
@@ -1269,7 +1269,7 @@ def __init__(self, filename, scale, tfmconv, pyxconv, fontmap, debug=0):
12691269 # of the virtual font itself. Note that realscale has
12701270 # to be a fix_word (like s)
12711271 # XXX: check rounding
1272- reals = int (round (self .scale * (16 * self .ds / 16777216L ) * s ))
1272+ reals = int (round (self .scale * (16 * self .ds / 16777216 ) * s ))
12731273
12741274 # print ("defining font %s -- VF scale: %g, VF design size: %d, relative font size: %d => real size: %d" %
12751275 # (fontname, self.scale, self.ds, s, reals)
0 commit comments