Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1e36916

Browse files
committed
DOC: fix linting errors in ftface_props example
1 parent 51c06c4 commit 1e36916

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

galleries/examples/misc/ftface_props.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,15 @@
3333
print("Style name: ", font.style_name) # face style name
3434
print("PS name: ", font.postscript_name) # the postscript name
3535
print("Num fixed: ", font.num_fixed_sizes) # number of embedded bitmaps
36-
print("Bbox: ", font.bbox) # the face global bounding box (xmin, ymin, xmax, ymax)
37-
print("EM: ", font.units_per_EM) # number of font units covered by the EM
36+
print("Bbox: ", font.bbox) # global bounding box (xmin, ymin, xmax, ymax)
37+
print("EM: ", font.units_per_EM) # font units per EM
3838
print("Ascender: ", font.ascender) # the ascender in 26.6 units
3939
print("Descender: ", font.descender) # the descender in 26.6 units
4040
print("Height: ", font.height) # the height in 26.6 units
41-
print("Max adv width: ", font.max_advance_width) # maximum horizontal cursor advance
41+
print("Max adv width: ", font.max_advance_width) # max horizontal advance
4242
print("Max adv height: ", font.max_advance_height) # same for vertical layout
43-
print("Underline pos: ", font.underline_position) # vertical position of the underline bar
44-
print("Underline thickness:", font.underline_thickness) # vertical thickness of the underline
43+
print("Underline pos: ", font.underline_position) # underline bar position
44+
print("Underline thickness:", font.underline_thickness) # underline thickness
4545

4646
for flag in ft.StyleFlags:
4747
name = flag.name.replace('_', ' ').title() + ':'
@@ -53,12 +53,12 @@
5353

5454
# Normalise all vertical metrics to units_per_EM so all y-values sit in [-1, 1].
5555
u = font.units_per_EM
56-
asc = font.ascender / u
57-
desc = font.descender / u
56+
asc = font.ascender / u
57+
desc = font.descender / u
5858
bbox_ymax = font.bbox[3] / u
5959
bbox_ymin = font.bbox[1] / u
60-
ul_pos = font.underline_position / u
61-
ul_thick = font.underline_thickness / u
60+
ul_pos = font.underline_position / u
61+
ul_thick = font.underline_thickness / u
6262

6363
fig, ax = plt.subplots(figsize=(8, 6))
6464

@@ -76,9 +76,9 @@
7676

7777
# Lines, rectangle and labels are all derived from these real glyph bounds.
7878
H_MARGIN = 0.05 # horizontal padding around glyph
79-
LINE_X0 = glyph_x0 - H_MARGIN # lines start here
80-
LINE_X1 = glyph_x1 + H_MARGIN # lines end here (always past glyph edge)
81-
LABEL_X = LINE_X1 + 0.08 # metric labels start here
79+
LINE_X0 = glyph_x0 - H_MARGIN # lines start here
80+
LINE_X1 = glyph_x1 + H_MARGIN # lines end here (always past glyph edge)
81+
LABEL_X = LINE_X1 + 0.08 # metric labels start here
8282

8383
metrics = [
8484
("bbox top (ymax)", bbox_ymax, "tab:green"),
@@ -93,7 +93,7 @@
9393
ax.plot([LINE_X0, LINE_X1], [y, y],
9494
color=color, linewidth=1.5, linestyle='--', alpha=0.9, zorder=2)
9595
# Nudge bbox-edge labels slightly away from the rectangle border.
96-
y_text = (y - 0.015 if "bbox top" in label else
96+
y_text = (y - 0.015 if "bbox top" in label else
9797
y + 0.015 if "bbox bottom" in label else y)
9898
ax.text(LABEL_X, y_text, label,
9999
color=color, va='center', ha='left',
@@ -131,4 +131,4 @@
131131
ax.legend(fontsize=8, loc='upper right', bbox_to_anchor=(1.02, 0.95), frameon=False)
132132
ax.axis('off')
133133
plt.tight_layout(pad=1.5)
134-
plt.show()
134+
plt.show()

0 commit comments

Comments
 (0)