mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Code to get font names from sfnt container object
This commit is contained in:
parent
23c65a4de9
commit
01666d4fff
@ -106,6 +106,13 @@ class Sfnt(object):
|
|||||||
ans[tag] = len(self[tag])
|
ans[tag] = len(self[tag])
|
||||||
return ans
|
return ans
|
||||||
|
|
||||||
|
def get_all_font_names(self):
|
||||||
|
name_table = self.get(b'name')
|
||||||
|
if name_table is None:
|
||||||
|
return {}
|
||||||
|
from calibre.utils.fonts.metadata import get_font_names2
|
||||||
|
return get_font_names2(name_table.raw, raw_is_table=True)
|
||||||
|
|
||||||
def __call__(self, stream=None):
|
def __call__(self, stream=None):
|
||||||
stream = BytesIO() if stream is None else stream
|
stream = BytesIO() if stream is None else stream
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user