mirror of
https://github.com/gryf/ebook-converter.git
synced 2026-04-19 20:53:35 +02:00
Removed iteritems and itervalues, which are redundant
This commit is contained in:
@@ -6,7 +6,6 @@ from ebook_converter.utils.fonts.sfnt.errors import UnsupportedFont, NoGlyphs
|
||||
from ebook_converter.utils.fonts.sfnt.cff.dict_data import TopDict, PrivateDict
|
||||
from ebook_converter.utils.fonts.sfnt.cff.constants import (cff_standard_strings,
|
||||
STANDARD_CHARSETS)
|
||||
from ebook_converter.polyglot.builtins import iteritems, itervalues
|
||||
|
||||
|
||||
__license__ = 'GPL v3'
|
||||
@@ -195,8 +194,8 @@ class CFFTable(UnknownTable):
|
||||
# Map codes from the cmap table to glyph names, this will be used to
|
||||
# reconstruct character_map for the subset font
|
||||
charset_map = {code:self.cff.charset.safe_lookup(glyph_id) for code,
|
||||
glyph_id in iteritems(character_map)}
|
||||
charset = set(itervalues(charset_map))
|
||||
glyph_id in character_map.items()}
|
||||
charset = set(charset_map.values())
|
||||
charset.discard(None)
|
||||
if not charset and character_map:
|
||||
raise NoGlyphs('This font has no glyphs for the specified characters')
|
||||
@@ -207,7 +206,7 @@ class CFFTable(UnknownTable):
|
||||
|
||||
# Rebuild character_map with the glyph ids from the subset font
|
||||
character_map.clear()
|
||||
for code, charname in iteritems(charset_map):
|
||||
for code, charname in charset_map.items():
|
||||
glyph_id = s.charname_map.get(charname, None)
|
||||
if glyph_id:
|
||||
character_map[code] = glyph_id
|
||||
|
||||
Reference in New Issue
Block a user