mpl.mathtext.Fonts¶
-
class
mpl.mathtext.Fonts(default_font_prop, mathtext_backend)[source]¶ An abstract base class for a system of fonts to use for mathtext.
The class must be able to take symbol keys and font file names and return the character metrics. It also delegates to a backend class to do the actual drawing.
Methods¶
__init__(default_font_prop, mathtext_backend) |
default_font_prop: A |
destroy() |
Fix any cyclical references before the object is about to be destroyed. |
get_kern(font1, fontclass1, sym1, fontsize1, ...) |
Get the kerning distance for font between sym1 and sym2. |
get_metrics(font, font_class, sym, fontsize, dpi) |
font: one of the TeX font names: |
get_results(box) |
Get the data needed by the backend to render the math expression. |
get_sized_alternatives_for_symbol(fontname, sym) |
Override if your font provides multiple sizes of the same symbol. |
get_underline_thickness(font, fontsize, dpi) |
Get the line thickness that matches the given font. |
get_used_characters() |
Get the set of characters that were used in the math expression. |
get_xheight(font, fontsize, dpi) |
Get the xheight for the given font and fontsize. |
render_glyph(ox, oy, facename, font_class, ...) |
Draw a glyph at |
render_rect_filled(x1, y1, x2, y2) |
Draw a filled rectangle from (x1, y1) to (x2, y2). |
set_canvas_size(w, h, d) |
Set the size of the buffer used to render the math expression. |