MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / font_as_file

Function font_as_file

lib/matplotlib/backends/_backend_pdf_ps.py:93–109  ·  view source on GitHub ↗

Convert a TTFont object into a file-like object. Parameters ---------- font : fontTools.ttLib.ttFont.TTFont A font object Returns ------- BytesIO A file object with the font saved into it

(font)

Source from the content-addressed store, hash-verified

91
92
93def font_as_file(font):
94 """
95 Convert a TTFont object into a file-like object.
96
97 Parameters
98 ----------
99 font : fontTools.ttLib.ttFont.TTFont
100 A font object
101
102 Returns
103 -------
104 BytesIO
105 A file object with the font saved into it
106 """
107 fh = BytesIO()
108 font.save(fh, reorderTables=False)
109 return fh
110
111
112class GlyphMap:

Callers 1

test_glyphs_subsetFunction · 0.90

Calls 1

saveMethod · 0.80

Tested by 1

test_glyphs_subsetFunction · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…