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)
| 91 | |
| 92 | |
| 93 | def 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 | |
| 112 | class GlyphMap: |
searching dependent graphs…