mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-22 10:26:06 +01:00
Spped up fonts_are_identical
This commit is contained in:
parent
e77df26174
commit
bdebe91156
1 changed files with 7 additions and 3 deletions
|
|
@ -775,10 +775,14 @@ def merge_cmaps(cmaps):
|
|||
|
||||
|
||||
def fonts_are_identical(fonts):
|
||||
sentinel = object()
|
||||
for key in ('ToUnicode', 'Data'):
|
||||
all_values = {f[key] for f in fonts}
|
||||
if len(all_values) > 1:
|
||||
return False
|
||||
prev_val = sentinel
|
||||
for f in fonts:
|
||||
val = f[key]
|
||||
if prev_val is not sentinel and prev_val != val:
|
||||
return False
|
||||
prev_val = val
|
||||
return True
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue