import requests from fontTools.ttLib import TTFont font_url = 'http://**********/a.woff' # 保存字体文件woff font_resp = requests.get(font_url) with open('a.woff', 'wb') as f: f.write(font_resp.content) # 将woff文件转成xml font = TTFont("a.woff") font.saveXML("a.xml") # 按序获取GlyphOrder节点name值 glyph_list = font.getGlyphOrder() # 获取字体坐标信息 uni7AA8可变 zb = font['glyf']['uni7AA8'].coordinates # 获取cmap节点code与name值映射 cmap_dict = font.getBestCmap()