MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / test_ft2font_set_size

Function test_ft2font_set_size

lib/matplotlib/tests/test_ft2font.py:241–252  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

239
240
241def test_ft2font_set_size():
242 file = fm.findfont('DejaVu Sans')
243 font = ft2font.FT2Font(file)
244 font.set_size(12, 72)
245 font.set_text('ABabCDcd')
246 orig = font.get_width_height()
247 font.set_size(24, 72)
248 font.set_text('ABabCDcd')
249 assert font.get_width_height() == tuple(pytest.approx(2 * x, 1e-1) for x in orig)
250 font.set_size(12, 144)
251 font.set_text('ABabCDcd')
252 assert font.get_width_height() == tuple(pytest.approx(2 * x, 1e-1) for x in orig)
253
254
255def test_ft2font_features():

Callers

nothing calls this directly

Calls 4

findfontMethod · 0.80
get_width_heightMethod · 0.80
set_sizeMethod · 0.45
set_textMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…