From 1ff00b10c3f94578852650633d9ce238561ecb36 Mon Sep 17 00:00:00 2001 From: rocky Date: Mon, 29 Mar 2021 05:27:57 -0400 Subject: [PATCH] mglyph -> mtext broke some images --- mathics/builtin/graphics.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/mathics/builtin/graphics.py b/mathics/builtin/graphics.py index c07f60794b..24245a1c82 100644 --- a/mathics/builtin/graphics.py +++ b/mathics/builtin/graphics.py @@ -3226,14 +3226,15 @@ def boxes_to_xml(self, leaves=None, **options): svg, ) - return ( - '' - % ( + # mglyph, which is what we have been using, is bad because MathML standard changed. + # metext does not work beacause the way in which we produce the svg images is also based on this outdated mglyph behaviour. + # format = "" + template = '' + return template % ( int(width), int(height), base64.b64encode(svg_xml.encode("utf8")).decode("utf8"), ) - ) def axis_ticks(self, xmin, xmax): def round_to_zero(value):