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

Skip to content

Commit 5969311

Browse files
Add test
1 parent 897a3ae commit 5969311

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

lib/matplotlib/tests/test_font_manager.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import os
22
import shutil
3+
import sys
34
import tempfile
45
import warnings
56

@@ -96,3 +97,20 @@ def test_hinting_factor(factor):
9697
# Check that hinting only changes text layout by a small (10%) amount.
9798
np.testing.assert_allclose(hinted_font.get_width_height(), expected,
9899
rtol=0.1)
100+
101+
102+
@pytest.mark.xfail(sys.platform != "win32",
103+
reason="Need Windows font to test against")
104+
def test_utf16m_sfnt():
105+
segoe_ui_semibold = None
106+
for f in fontManager.ttflist:
107+
# seguisbi = Microsoft Segoe UI Semibold
108+
if f.fname[-12:] == "seguisbi.ttf":
109+
segoe_ui_semibold = f
110+
break
111+
else:
112+
pytest.xfail(reason = "Couldn't find font to test against.")
113+
114+
# Check that we successfully read the "semibold" from the font's
115+
# sfnt table and set its weight accordingly
116+
assert segoe_ui_semibold.weight == "semibold"

0 commit comments

Comments
 (0)