Fontlab Script not Terminating

Primary tabs

3 posts / 0 new
Last post
Ken Krugh's picture
Offline
Joined: 10 Apr 2007 - 9:05am
Fontlab Script not Terminating
0

I have this small Python script that, for some reason, won't seem to terminate. The 2nd file that it's writing does not complete unless I click the "Reset macro system" button on the macro palette.

Any ideas?

Thanks,
Ken

BearLeft = fl.glyph.GetBoundingRect().x
BearRight = fl.glyph.width - fl.glyph.GetBoundingRect().ur.x
if BearLeft >= 0 and BearRight >= 0:
print "This glyph does not have a negative bearing."
else:
finame=str("C:\Program Files\FontLab\Studio5\Macros\Bearings Fix Old Left.txt")
TheFile = open(finame, "w")
TheFile.write(str(BearLeft))
TheFile.close
finame=str("C:\Program Files\FontLab\Studio5\Macros\Bearings Fix Old Right.txt")
TheFile = open(finame, "w")
TheFile.write(str(BearRight))
TheFile.close

Andreas Eigendorf's picture
Joined: 2 Sep 2006 - 4:12am
0

You have to write TheFile.close() (with parentheses) in order to execute the close method of the file object.

Eigi

Ken Krugh's picture
Offline
Joined: 10 Apr 2007 - 9:05am
0

Yep, that fixed it! Thanks yet again!

Ken