17.2 Procedures provided in the font module

The font module defines several procedures and variables for manipulating texts and fonts:

quotemeta( text)
quoting - Quote letters with special meanings in pychart so that text will display as-is when passed to canvas.show().

>>> font.quotemeta("foo/bar")
"foo//bar"

text_height( text)
Return the total height of the text and the length from the base point to the top of the text box.

text_width( text)
Return the width of the text in points.

get_dimension( text)
Return the bounding box of the text, assuming that the left-bottom corner of the first letter of the text is at (0, 0). This procedure ignores /h, /v, and /a directives when calculating the boundingbox; it just returns the alignment specifiers as a part of the return value. The return value is a tuple (width, height, halign, valign, angle).