mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
E-book viewer: Handle font-face rules specify multiple families to be substituted
This commit is contained in:
parent
8bb493275e
commit
344141ff45
@ -139,11 +139,18 @@ class EbookIterator(object):
|
|||||||
if id != -1:
|
if id != -1:
|
||||||
families = [unicode(f) for f in QFontDatabase.applicationFontFamilies(id)]
|
families = [unicode(f) for f in QFontDatabase.applicationFontFamilies(id)]
|
||||||
if family:
|
if family:
|
||||||
family = family.group(1).strip().replace('"', '')
|
family = family.group(1)
|
||||||
bad_map[family] = families[0]
|
specified_families = [x.strip().replace('"',
|
||||||
if family not in families:
|
'').replace("'", '') for x in family.split(',')]
|
||||||
|
aliasing_ok = False
|
||||||
|
for f in specified_families:
|
||||||
|
bad_map[f] = families[0]
|
||||||
|
if not aliasing_ok and f in families:
|
||||||
|
aliasing_ok = True
|
||||||
|
|
||||||
|
if not aliasing_ok:
|
||||||
prints('WARNING: Family aliasing not fully supported.')
|
prints('WARNING: Family aliasing not fully supported.')
|
||||||
prints('\tDeclared family: %s not in actual families: %s'
|
prints('\tDeclared family: %r not in actual families: %r'
|
||||||
% (family, families))
|
% (family, families))
|
||||||
else:
|
else:
|
||||||
prints('Loaded embedded font:', repr(family))
|
prints('Loaded embedded font:', repr(family))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user