@@ -396,8 +396,7 @@ def _read(self, file):
396
396
elif type == 3 : # end of file
397
397
break
398
398
else :
399
- raise RuntimeError ('Unknown segment type %d in pfb file' %
400
- type )
399
+ raise RuntimeError ('Unknown segment type %d in pfb file' % type )
401
400
402
401
return data
403
402
@@ -725,7 +724,7 @@ def transform(self, effects):
725
724
726
725
if 'slant' in effects :
727
726
slant = effects ['slant' ]
728
- fontname += '_Slant_%d' % int (1000 * slant )
727
+ fontname += f '_Slant_{ int (1000 * slant )} '
729
728
italicangle = round (
730
729
float (italicangle ) - np .arctan (slant ) / np .pi * 180 ,
731
730
5
@@ -734,21 +733,21 @@ def transform(self, effects):
734
733
735
734
if 'extend' in effects :
736
735
extend = effects ['extend' ]
737
- fontname += '_Extend_%d' % int (1000 * extend )
736
+ fontname += f '_Extend_{ int (1000 * extend )} '
738
737
modifier [0 , 0 ] = extend
739
738
740
739
newmatrix = np .dot (modifier , oldmatrix )
741
740
array [::2 ] = newmatrix [0 :3 , 0 ]
742
741
array [1 ::2 ] = newmatrix [0 :3 , 1 ]
743
742
fontmatrix = (
744
- '[%s]' % ' ' .join (_format_approx (x , 6 ) for x in array )
743
+ f"[ { ' ' .join (_format_approx (x , 6 ) for x in array )} ]"
745
744
)
746
745
replacements = (
747
- [(x , '/FontName/%s def' % fontname )
746
+ [(x , f '/FontName/{ fontname } def' )
748
747
for x in self ._pos ['FontName' ]]
749
- + [(x , '/ItalicAngle %a def' % italicangle )
748
+ + [(x , f '/ItalicAngle { italicangle } def' )
750
749
for x in self ._pos ['ItalicAngle' ]]
751
- + [(x , '/FontMatrix %s readonly def' % fontmatrix )
750
+ + [(x , f '/FontMatrix { fontmatrix } readonly def' )
752
751
for x in self ._pos ['FontMatrix' ]]
753
752
+ [(x , '' ) for x in self ._pos .get ('UniqueID' , [])]
754
753
)
0 commit comments