FL Output window not long enough ?

ttmt's picture

Hi all

I wrote this simple macro that opens two fonts and compares the side bearings. It prints the side bearings to the output window and marks the glyphs that have different side bearings.

My problem is the output window will print all the text but there isn't enough room to fit it all in. When the output has finished the start of the output has been cut off.

How can I save all the output ?


from robofab.world import OpenFont
lightFont = OpenFont(None)
boldFont = OpenFont(None)
#
#
glyphs =['dollar','quotedblright','quotesinglbase','Euro','underscore','dotlessi','section','ampersand','lessequal','degree','asciitilde','summation','bracketleft','asciicircum','greaterequal','ordmasculine',
'mu','paragraph','backslash','currency','product','fi','fl','comma','guillemotright','greater','cedilla','logicalnot','exclamdown','endash','germandbls','quoteright','commaaccent','parenleft',
'quoteleft','notequal','radical','ring','Delta','f_t','florin','Omega','quotedbl','Thorn','multiply','grave','lozenge','questiondown','perthousand','copyright','yen','circumflex','bar',
'dotaccent','ordfeminine','braceleft','macron','Oslash','quotedblleft','exclam','equal','eth','hyphen','period','colon','ae','trademark','cent','pi','breve','guillemotleft','braceright','numbersign',
'brokenbar','periodcentered','sterling','emdash','plusminus','less','tilde','oslash','acute','OE','parenright','AE','quotesingle','slash','ellipsis','guilsinglright','t_t','caron','oe',
'guilsinglleft','plus','dagger','integral','hungarumlaut','question','registered','dieresis','ogonek','semicolon','quotedblbase','at','daggerdbl','percent','bracketright','approxequal','asterisk',
'bullet','thorn',
'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',
'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z',
'a.smcp','b.smcp','c.smcp','d.smcp','e.smcp','f.smcp','g.smcp','h.smcp','i.smcp','j.smcp','k.smcp','l.smcp',
'm.smcp','n.smcp','o.smcp','p.smcp','q.smcp','r.smcp','s.smcp','t.smcp','u.smcp','v.smcp','w.smcp','x.smcp',
'y.smcp','z.smcp',]

print lightFont.info.fullName,"/",boldFont.info.fullName
print " "

markCol = 10

for g in glyphs:
print lightFont[g].leftMargin,"-",g,"-",lightFont[g].rightMargin
print boldFont[g].leftMargin,"-",g,"-",boldFont[g].rightMargin
print lightFont[g].leftMargin - boldFont[g].leftMargin,"----",lightFont[g].rightMargin - boldFont[g].rightMargin
if lightFont[g].leftMargin != boldFont[g].leftMargin or lightFont[g].rightMargin != boldFont[g].rightMargin:
boldFont[g].mark = markCol
print "------------------"
print " "

Jens Kutilek's picture

You could save the output to a text file instead of printing it into the output window:

http://docs.python.org/tutorial/inputoutput.html#reading-and-writing-files

ttmt's picture

Thanks Jens that looks perfect

Syndicate content Syndicate content