mpl.mathtext.UnicodeFonts

class mpl.mathtext.UnicodeFonts(*args, **kwargs)[source]

An abstract base class for handling Unicode fonts.

While some reasonably complete Unicode fonts (such as DejaVu) may work in some situations, the only Unicode font I’m aware of with a complete set of math symbols is STIX.

This class will “fallback” on the Bakoma fonts when a required symbol can not be found in the font.

__init__(*args, **kwargs)[source]

Methods

__init__(*args, **kwargs)
destroy()
get_kern(font1, fontclass1, sym1, fontsize1, ...)
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)
get_underline_thickness(font, fontsize, dpi)
get_used_characters() Get the set of characters that were used in the math expression.
get_xheight(font, fontsize, dpi)
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.

Attributes

use_cmex