Skip to content

Commit d48376a

Browse files
committed
PEP8 formatting / blacken source
1 parent 81720ad commit d48376a

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

lib/fontline/commands.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,13 @@ def get_font_report(fontpath):
4141
report.append("")
4242

4343
report.append("--- Ascent to Descent Calculations ---")
44-
report.append("[hhea] Ascent to Descent: {}".format(metrics.hhea_total_height))
4544
report.append(
46-
"[OS/2] TypoAscender to TypoDescender: {}".format(metrics.os2_typo_total_height)
45+
"[hhea] Ascent to Descent: {}".format(metrics.hhea_total_height)
46+
)
47+
report.append(
48+
"[OS/2] TypoAscender to TypoDescender: {}".format(
49+
metrics.os2_typo_total_height
50+
)
4751
)
4852
report.append(
4953
"[OS/2] WinAscent to WinDescent: {}".format(metrics.os2_win_total_height)
@@ -78,7 +82,9 @@ def get_font_report(fontpath):
7882
report.append("win metrics: {}".format(metrics.win_btb_distance))
7983
report.append("")
8084
report.append(
81-
"[OS/2] fsSelection USE_TYPO_METRICS bit set: {}".format(metrics.fsselection_bit7_set)
85+
"[OS/2] fsSelection USE_TYPO_METRICS bit set: {}".format(
86+
metrics.fsselection_bit7_set
87+
)
8288
)
8389
report.append("")
8490
report.append("--- Ratios ---")

lib/fontline/metrics.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ def __init__(self, tt, filepath):
88
self.tt = tt
99
self.filepath = filepath
1010
self.sha1 = get_sha1(self.filepath)
11-
namerecord_list = tt["name"].names
1211
# Version string
1312
self.version = ""
1413
for needle in tt["name"].names:
@@ -38,7 +37,9 @@ def __init__(self, tt, filepath):
3837

3938
# Bit flag checks
4039
self.fsselection_bit7_mask = 1 << 7
41-
self.fsselection_bit7_set = (tt["OS/2"].fsSelection & self.fsselection_bit7_mask) != 0
40+
self.fsselection_bit7_set = (
41+
tt["OS/2"].fsSelection & self.fsselection_bit7_mask
42+
) != 0
4243

4344
# Calculated values
4445
self.os2_typo_total_height = self.os2_typo_ascender - self.os2_typo_descender
@@ -48,14 +49,15 @@ def __init__(self, tt, filepath):
4849
self.hhea_btb_distance = self.hhea_total_height + self.hhea_linegap
4950
self.typo_btb_distance = self.os2_typo_total_height + self.os2_typo_linegap
5051
self.win_external_leading = self.hhea_linegap - (
51-
(self.os2_win_ascent + self.os2_win_descent) - (self.hhea_ascent - self.hhea_descent)
52+
(self.os2_win_ascent + self.os2_win_descent)
53+
- (self.hhea_ascent - self.hhea_descent)
5254
)
5355
if self.win_external_leading < 0:
5456
self.win_external_leading = 0
55-
self.win_btb_distance = self.os2_win_ascent + self.os2_win_descent + self.win_external_leading
57+
self.win_btb_distance = (
58+
self.os2_win_ascent + self.os2_win_descent + self.win_external_leading
59+
)
5660

5761
self.typo_to_upm = 1.0 * self.typo_btb_distance / self.units_per_em
5862
self.winascdesc_to_upm = 1.0 * self.win_btb_distance / self.units_per_em
5963
self.hheaascdesc_to_upm = 1.0 * self.hhea_btb_distance / self.units_per_em
60-
61-

0 commit comments

Comments
 (0)