mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
3a5a616226
commit
7e50d7b6bf
@ -76,6 +76,14 @@ class FamilyMap(dict):
|
|||||||
family.encode('utf-8')
|
family.encode('utf-8')
|
||||||
|
|
||||||
def extract_fonts(opf, log):
|
def extract_fonts(opf, log):
|
||||||
|
'''
|
||||||
|
Extract embedded fonts from the ebook and add them explicitly to the Qt
|
||||||
|
font database to workaround https://bugs.webkit.org/show_bug.cgi?id=29433
|
||||||
|
|
||||||
|
Only works if the font-face and font-family rules are all contained in the
|
||||||
|
CSS files (Also processing the HTML files would be too much of a
|
||||||
|
performance hit, to do robustly).
|
||||||
|
'''
|
||||||
css_files = {}
|
css_files = {}
|
||||||
font_family_map = FamilyMap(log)
|
font_family_map = FamilyMap(log)
|
||||||
pat = re.compile(br'^\s*@font-face\s*{[^}]+}', re.M)
|
pat = re.compile(br'^\s*@font-face\s*{[^}]+}', re.M)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user