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

Skip to content

Commit 02dee87

Browse files
committed
Add unit test for AFM kerning
1 parent 35148a1 commit 02dee87

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

lib/matplotlib/tests/test_text.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,3 +95,13 @@ def test_antialiasing():
9595
# test cleanup will do it for us. In fact, if we do it here, it
9696
# will turn antialiasing back off before the images are actually
9797
# rendered.
98+
99+
100+
def test_afm_kerning():
101+
from matplotlib.afm import AFM
102+
from matplotlib.font_manager import findfont
103+
104+
fn = findfont("Helvetica", fontext="afm")
105+
with open(fn, 'rb') as fh:
106+
afm = AFM(fh)
107+
assert afm.string_width_height('VAVAVAVAVAVA') == (7174.0, 718)

0 commit comments

Comments
 (0)