Edit book: Font manager: Fix removing embedded font failing if @font-face rule has no src. Fixes #1847052 [Unable to remove font from font manager](https://bugs.launchpad.net/calibre/+bug/1847052)

This commit is contained in:
Kovid Goyal 2019-10-07 16:01:22 +05:30
parent 9ee5bc98c5
commit 696a93deea
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -91,7 +91,7 @@ def change_font_in_declaration(style, old_name, new_name=None):
def remove_embedded_font(container, sheet, rule, sheet_name):
src = getattr(rule.style.getProperty('src'), 'value')
src = getattr(rule.style.getProperty('src'), 'value', None)
if src is not None:
if src.startswith('url('):
src = src[4:-1]