Skip to content

Commit 50dea26

Browse files
committed
[commands] formatting updates / blacken source
1 parent 484a83e commit 50dea26

File tree

1 file changed

+21
-9
lines changed

1 file changed

+21
-9
lines changed

lib/fontline/commands.py

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def get_font_report(fontpath):
3636

3737
# Bit flag checks
3838
fsselection_bit6_mask = 1 << 6
39-
fsselection_bit6_set = (tt['OS/2'].fsSelection & fsselection_bit6_mask ) != 0
39+
fsselection_bit6_set = (tt["OS/2"].fsSelection & fsselection_bit6_mask) != 0
4040

4141
# Calculated values
4242
os2_typo_total_height = os2_typo_ascender + -(os2_typo_descender)
@@ -45,7 +45,9 @@ def get_font_report(fontpath):
4545

4646
hhea_btb_distance = hhea_total_height + hhea_linegap
4747
typo_btb_distance = os2_typo_total_height + os2_typo_linegap
48-
win_external_leading = hhea_linegap - ((os2_win_ascent + os2_win_descent) - (hhea_ascent - hhea_descent))
48+
win_external_leading = hhea_linegap - (
49+
(os2_win_ascent + os2_win_descent) - (hhea_ascent - hhea_descent)
50+
)
4951
if win_external_leading < 0:
5052
win_external_leading = 0
5153
win_btb_distance = os2_win_ascent + os2_win_descent + win_external_leading
@@ -86,20 +88,29 @@ def get_font_report(fontpath):
8688

8789
report.append("--- Ascent to Descent Calculations ---")
8890
report.append("[hhea] Ascent to Descent: {}".format(hhea_total_height))
89-
report.append("[OS/2] TypoAscender to TypoDescender: {}".format(os2_typo_total_height)
91+
report.append(
92+
"[OS/2] TypoAscender to TypoDescender: {}".format(os2_typo_total_height)
93+
)
94+
report.append(
95+
"[OS/2] WinAscent to WinDescent: {}".format(os2_win_total_height)
9096
)
91-
report.append("[OS/2] WinAscent to WinDescent: {}".format(os2_win_total_height))
9297
report.append("")
9398

9499
report.append("--- Delta Values ---")
95100
report.append(
96-
"[hhea] Ascent to [OS/2] TypoAscender: {}".format(hhea_ascent - os2_typo_ascender)
101+
"[hhea] Ascent to [OS/2] TypoAscender: {}".format(
102+
hhea_ascent - os2_typo_ascender
103+
)
97104
)
98105
report.append(
99-
"[hhea] Descent : [OS/2] TypoDescender: {}".format(os2_typo_descender - hhea_descent)
106+
"[hhea] Descent : [OS/2] TypoDescender: {}".format(
107+
os2_typo_descender - hhea_descent
108+
)
100109
)
101110
report.append(
102-
"[OS/2] WinAscent to [OS/2] TypoAscender: {}".format(os2_win_ascent - os2_typo_ascender)
111+
"[OS/2] WinAscent to [OS/2] TypoAscender: {}".format(
112+
os2_win_ascent - os2_typo_ascender
113+
)
103114
)
104115
report.append(
105116
"[OS/2] WinDescent to [OS/2] TypoDescender: {}".format(
@@ -112,14 +123,15 @@ def get_font_report(fontpath):
112123
report.append("typo metrics: {}".format(typo_btb_distance))
113124
report.append("win metrics: {}".format(win_btb_distance))
114125
report.append("")
115-
report.append("[OS/2] fsSelection USE_TYPO_METRICS bit set: {}".format(fsselection_bit6_set))
126+
report.append(
127+
"[OS/2] fsSelection USE_TYPO_METRICS bit set: {}".format(fsselection_bit6_set)
128+
)
116129
report.append("")
117130
report.append("--- Ratios ---")
118131
report.append("hhea metrics / UPM: {0:.3g}".format(hheaascdesc_to_upm))
119132
report.append("typo metrics / UPM: {0:.3g}".format(typo_to_upm))
120133
report.append("win metrics / UPM: {0:.3g}".format(winascdesc_to_upm))
121134

122-
123135
return "\n".join(report)
124136

125137

0 commit comments

Comments
 (0)