Returns the offset of the baseline from the bottom of the image in pixels. *texstr* A valid mathtext string, e.g., r'IQ: $\\sigma_i=15$' *dpi* The dots-per-inch to render the text *fontsize* The font size in points
(self, texstr, dpi=120, fontsize=14)
| 3358 | return depth |
| 3359 | |
| 3360 | def get_depth(self, texstr, dpi=120, fontsize=14): |
| 3361 | """ |
| 3362 | Returns the offset of the baseline from the bottom of the |
| 3363 | image in pixels. |
| 3364 | |
| 3365 | *texstr* |
| 3366 | A valid mathtext string, e.g., r'IQ: $\\sigma_i=15$' |
| 3367 | |
| 3368 | *dpi* |
| 3369 | The dots-per-inch to render the text |
| 3370 | |
| 3371 | *fontsize* |
| 3372 | The font size in points |
| 3373 | """ |
| 3374 | assert self._output=="bitmap" |
| 3375 | prop = FontProperties(size=fontsize) |
| 3376 | ftimage, depth = self.parse(texstr, dpi=dpi, prop=prop) |
| 3377 | return depth |
| 3378 | |
| 3379 | def math_to_image(s, filename_or_obj, prop=None, dpi=None, format=None): |
| 3380 | """ |
no test coverage detected