Skip to content

Commit 0ebb071

Browse files
committed
Access mathtext parser with public API.
1 parent f944e28 commit 0ebb071

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/_mplcairo.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1469,8 +1469,8 @@ void GraphicsContextRenderer::draw_text(
14691469
// NOTE: This uses unhinted metrics for parsing/positioning but normal
14701470
// hinting for rendering, not sure whether this is a problem...
14711471
auto const& parse =
1472-
py::cast(this).attr("_text2path").attr("mathtext_parser").attr("parse")(
1473-
s, dpi_, prop);
1472+
py::module::import("matplotlib.mathtext").attr("MathTextParser")("path")
1473+
.attr("parse")(s, dpi_, prop);
14741474
auto mb = MathtextBackend{};
14751475
for (auto const& spec: parse.attr("glyphs")) {
14761476
// We must use the character's unicode index rather than the symbol name,

0 commit comments

Comments
 (0)