mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
5a4d164347
commit
1c7330d465
@ -26,7 +26,8 @@ class Fonts(object):
|
|||||||
def files_for_family(self, family, normalize=True):
|
def files_for_family(self, family, normalize=True):
|
||||||
'''
|
'''
|
||||||
Find all the variants in the font family `family`.
|
Find all the variants in the font family `family`.
|
||||||
Returns a dictionary of tuples. Each tuple is of the form (Full font name, path to font file).
|
Returns a dictionary of tuples. Each tuple is of the form (path to font
|
||||||
|
file, Full font name).
|
||||||
The keys of the dictionary depend on `normalize`. If `normalize` is `False`,
|
The keys of the dictionary depend on `normalize`. If `normalize` is `False`,
|
||||||
they are a tuple (slant, weight) otherwise they are strings from the set
|
they are a tuple (slant, weight) otherwise they are strings from the set
|
||||||
`('normal', 'bold', 'italic', 'bi', 'light', 'li')`
|
`('normal', 'bold', 'italic', 'bi', 'light', 'li')`
|
||||||
@ -40,7 +41,7 @@ class Fonts(object):
|
|||||||
pt = PersistentTemporaryFile('.'+ext)
|
pt = PersistentTemporaryFile('.'+ext)
|
||||||
pt.write(data)
|
pt.write(data)
|
||||||
pt.close()
|
pt.close()
|
||||||
ans[ft] = (name, pt.name)
|
ans[ft] = (pt.name, name)
|
||||||
return ans
|
return ans
|
||||||
return self.backend.files_for_family(family, normalize=normalize)
|
return self.backend.files_for_family(family, normalize=normalize)
|
||||||
|
|
||||||
|
@ -75,7 +75,8 @@ class FontConfig(Thread):
|
|||||||
def files_for_family(self, family, normalize=True):
|
def files_for_family(self, family, normalize=True):
|
||||||
'''
|
'''
|
||||||
Find all the variants in the font family `family`.
|
Find all the variants in the font family `family`.
|
||||||
Returns a dictionary of tuples. Each tuple is of the form (Full font name, path to font file).
|
Returns a dictionary of tuples. Each tuple is of the form (path to font
|
||||||
|
file, Full font name).
|
||||||
The keys of the dictionary depend on `normalize`. If `normalize` is `False`,
|
The keys of the dictionary depend on `normalize`. If `normalize` is `False`,
|
||||||
they are a tuple (slant, weight) otherwise they are strings from the set
|
they are a tuple (slant, weight) otherwise they are strings from the set
|
||||||
`('normal', 'bold', 'italic', 'bi', 'light', 'li')`
|
`('normal', 'bold', 'italic', 'bi', 'light', 'li')`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user