8000 FIX: make sure we check the kerning on the correct (parent) font · matplotlib/matplotlib@32582bb · GitHub
[go: up one dir, main page]

Skip to content

Commit 32582bb

Browse files
committed
FIX: make sure we check the kerning on the correct (parent) font
1 parent 0aac44d commit 32582bb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/matplotlib/_text_helpers.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,10 @@ def layout(string, font, *, kern_mode=KERNING_DEFAULT):
6363
# This has done the fallback logic
6464
font = char_to_font.get(char, base_font)
6565
glyph_idx = font.get_char_index(ord(char))
66-
kern = (font.get_kerning(prev_glyph_idx, glyph_idx, kern_mode) / 64
67-
if prev_glyph_idx is not None else 0.)
66+
kern = (
67+
base_font.get_kerning(prev_glyph_idx, glyph_idx, kern_mode) / 64
68+
if prev_glyph_idx is not None else 0.
69+
)
6870
x += kern
6971
glyph = font.load_glyph(glyph_idx, flags=LOAD_NO_HINTING)
7072
yield LayoutItem(font, char, glyph_idx, x, kern)

0 commit comments

Comments
 (0)
0