MCPcopy
hub / github.com/matplotlib/matplotlib / _prepare_font

Method _prepare_font

lib/matplotlib/backends/backend_agg.py:304–312  ·  view source on GitHub ↗

Get the `.FT2Font` for *font_prop*, clear its buffer, and set its size.

(self, font_prop)

Source from the content-addressed store, hash-verified

302 return self.width, self.height
303
304 def _prepare_font(self, font_prop):
305 """
306 Get the `.FT2Font` for *font_prop*, clear its buffer, and set its size.
307 """
308 font = get_font(_fontManager._find_fonts_by_props(font_prop))
309 font.clear()
310 size = font_prop.get_size_in_points()
311 font.set_size(size, self.dpi)
312 return font
313
314 def points_to_pixels(self, points):
315 # docstring inherited

Callers 2

draw_textMethod · 0.95

Calls 4

get_fontFunction · 0.90
_find_fonts_by_propsMethod · 0.80
clearMethod · 0.45
set_sizeMethod · 0.45

Tested by

no test coverage detected