def getCharWidths(doc, xref, limit = <NUM_LIT>, idx = <NUM_LIT:0>):
fontinfo = CheckFontInfo(doc, xref)<EOL>if fontinfo is None:               <EOL><INDENT>name, ext, stype, _ = doc.extractFont(xref, info_only = True)<EOL>fontdict = {"<STR_LIT:name>": name, "<STR_LIT:type>": stype, "<STR_LIT>": ext}<EOL>if ext == "<STR_LIT>":<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if stype in ("<STR_LIT>", "<STR_LIT>", "<STR_LIT>"):<EOL><INDENT>simple = True<EOL><DEDENT>else:<EOL><INDENT>simple = False<EOL><DEDENT>if name in ("<STR_LIT>", "<STR_LIT>"):<EOL><INDENT>ordering = <NUM_LIT:0><EOL><DEDENT>elif name in ("<STR_LIT>", "<STR_LIT>"):<EOL><INDENT>ordering = <NUM_LIT:1><EOL><DEDENT>elif name in ("<STR_LIT>", "<STR_LIT>"):<EOL><INDENT>ordering = <NUM_LIT:2><EOL><DEDENT>elif name in ("<STR_LIT>", "<STR_LIT>"):<EOL><INDENT>ordering = <NUM_LIT:3><EOL><DEDENT>else:<EOL><INDENT>ordering = -<NUM_LIT:1><EOL><DEDENT>fontdict["<STR_LIT>"] = simple<EOL>if name == "<STR_LIT>":<EOL><INDENT>glyphs = zapf_glyphs<EOL><DEDENT>elif name == "<STR_LIT>":<EOL><INDENT>glyphs = symbol_glyphs<EOL><DEDENT>else:<EOL><INDENT>glyphs = None<EOL><DEDENT>fontdict["<STR_LIT>"] = glyphs<EOL>fontdict["<STR_LIT>"] = ordering<EOL>fontinfo = [xref, fontdict]<EOL>doc.FontInfos.append(fontinfo)<EOL><DEDENT>else:<EOL><INDENT>fontdict = fontinfo[<NUM_LIT:1>]<EOL>glyphs = fontdict["<STR_LIT>"]<EOL>simple = fontdict["<STR_LIT>"]<EOL>ordering = fontdict["<STR_LIT>"]<EOL><DEDENT>if glyphs is None:<EOL><INDENT>oldlimit = <NUM_LIT:0><EOL><DEDENT>else:<EOL><INDENT>oldlimit = len(glyphs)<EOL><DEDENT>mylimit = max(<NUM_LIT>, limit)<EOL>if mylimit <= oldlimit:<EOL><INDENT>return glyphs<EOL><DEDENT>if ordering < <NUM_LIT:0>:              <EOL><INDENT>glyphs = doc._getCharWidths(xref, fontdict["<STR_LIT:name>"],<EOL>fontdict["<STR_LIT>"],<EOL>fontdict["<STR_LIT>"],<EOL>mylimit, idx)<EOL><DEDENT>else:                         <EOL><INDENT>glyphs = None<EOL><DEDENT>fontdict["<STR_LIT>"] = glyphs<EOL>fontinfo[<NUM_LIT:1>] = fontdict<EOL>UpdateFontInfo(doc, fontinfo)<EOL>return glyphs<EOL>
Get list of glyph information of a font.

    Notes:
        Must be provided by its XREF number. If we already dealt with the
        font, it will be recorded in doc.FontInfos. Otherwise we insert an
        entry there.
        Finally we return the glyphs for the font. This is a list of
        (glyph, width) where glyph is an integer controlling the char
        appearance, and width is a float controlling the char's spacing:
        width * fontsize is the actual space.
        For 'simple' fonts, glyph == ord(char) will usually be true.
        Exceptions are 'Symbol' and 'ZapfDingbats'. We are providing data for these directly here.