New to Typophile? Accounts are free, and easy to set up.
I've reached the exaspiration point so I'm hoping someone can weigh in on this for me.
I have a python script that dumps out all the character names and unicodes but I'm getting an error using the isdigit() command.
I couldn't get the indents I have in the code to show here so I've used backslashes for each indent.
This smaller script works fine, in the line "unistr = str(f.glyphs.unicode)" if I change the "1" to a "0" I get the correct result:
#FLM: Testing Macro
f = fl.font
gcount = len(f)
unistr = str(f.glyphs.unicode)
-print "It is!"
-print "It isn't!"
However, doing nearly the same darn thing I'm getting an invalid syntax error. I'm at a loss.
#FLM: Writes marked glyph unicode numbers and names to a file
f = fl.font
finame=str("C:\Program Files\FontLab\Studio5\Macros\UnicodeAndNamesMarked_") + fname + str(".txt")
TheFile = open(finame, "w")
TheFile.write(f.family_name + " marked glyphs" + chr(10))
if f != None:
-gcount = len(f)
-for i in range(gcount):
---unistr = str(f.glyphs[i].unicode)
----TheFile.write(hex(unistr) + chr(9) + f.glyphs[i].name + chr(10))
----TheFile.write(unistr + chr(9) + f.glyphs[i].name + chr(10))
-print "There are no fonts opened"
print "Filename: " + finame