Skip to content

Commit 84ecd29

Browse files
jkseppanaitikgupta
authored andcommitted
flake8
1 parent 5d4405c commit 84ecd29

File tree

1 file changed

+15
-7
lines changed

1 file changed

+15
-7
lines changed

lib/matplotlib/backends/backend_pdf.py

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1196,15 +1196,21 @@ def embedTTFType42(font, characters, descriptor):
11961196
wObject = self.reserveObject('Type 0 widths')
11971197
toUnicodeMapObject = self.reserveObject('ToUnicode map')
11981198

1199-
print(f"SUBSET {filename} characters: {''.join(chr(c) for c in characters)}")
1200-
fontdata = self.getSubset(filename, ''.join(chr(c) for c in characters))
1201-
print(f'SUBSET {filename} {os.stat(filename).st_size} -> {len(fontdata)}')
1199+
print(f"SUBSET {filename} characters: "
1200+
f"{''.join(chr(c) for c in characters)}")
1201+
fontdata = self.getSubset(
1202+
filename,
1203+
''.join(chr(c) for c in characters)
1204+
)
1205+
print(f'SUBSET {filename} {os.stat(filename).st_size}'
1206+
f' ↦ {len(fontdata)}')
12021207

12031208
# reload the font object from the subset
1204-
# (all the necessary data could probably be obtained directly using fontLib.ttLib)
1209+
# (all the necessary data could probably be obtained directly
1210+
# using fontLib.ttLib)
12051211
with tempfile.NamedTemporaryFile(suffix='.ttf') as tmp:
12061212
tmp.write(fontdata)
1207-
tmp.seek(0,0)
1213+
tmp.seek(0, 0)
12081214
font = FT2Font(tmp.name)
12091215

12101216
cidFontDict = {
@@ -1352,9 +1358,11 @@ def embedTTFType42(font, characters, descriptor):
13521358

13531359
@classmethod
13541360
def getSubset(self, fontfile, characters):
1355-
"""Read TTF font from the given file and subset it for the given characters.
1361+
"""
1362+
Read TTF font from the given file and subset it for the given characters.
13561363
1357-
Returns a serialization of the subset font as bytes."""
1364+
Returns a serialization of the subset font as bytes.
1365+
"""
13581366

13591367
options = subset.Options(glyph_names=True, recommended_glyphs=True)
13601368
options.drop_tables += ['FFTM']

0 commit comments

Comments
 (0)