def pixlen(text, widthlist, fontsize):
pl = <NUM_LIT:0.0><EOL>for t in text:<EOL><INDENT>pl += widthlist[ord(t)]<EOL><DEDENT>return pl * fontsize<EOL>
Calculate the length of text in pixels, given a list of (font-specific)
    glyph widths and the fontsize. Parameter 'widthlist' should have been
    created by 'doc._getCharWidths()'.