mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
E-book viewer: Handle quoted URLs inside @font-face rules
This commit is contained in:
parent
bf52bedeac
commit
5c9768c30c
@ -61,6 +61,11 @@ class FamilyMap(dict):
|
|||||||
src)))
|
src)))
|
||||||
if font_file not in self.added_fonts:
|
if font_file not in self.added_fonts:
|
||||||
self.added_fonts.add(font_file)
|
self.added_fonts.add(font_file)
|
||||||
|
if not os.path.exists(font_file):
|
||||||
|
from calibre.ebooks.oeb.base import urlunquote
|
||||||
|
ff = urlunquote(font_file, error_handling='replace')
|
||||||
|
if os.path.exists(ff):
|
||||||
|
font_file = ff
|
||||||
if os.path.exists(font_file):
|
if os.path.exists(font_file):
|
||||||
with open(font_file, 'rb') as f:
|
with open(font_file, 'rb') as f:
|
||||||
idx = QFontDatabase.addApplicationFontFromData(f.read())
|
idx = QFontDatabase.addApplicationFontFromData(f.read())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user