@@ -80,23 +80,22 @@ private String renderLatexToSvg(String latex) {
8080 var domImpl = org .apache .batik .dom .GenericDOMImplementation .getDOMImplementation ();
8181 var document = domImpl .createDocument ("http://www.w3.org/2000/svg" , "svg" , null );
8282 var svgGen = new org .apache .batik .svggen .SVGGraphics2D (document );
83+ svgGen .getGeneratorContext ().setEmbeddedFontsOn (true );
8384 svgGen .setSVGCanvasSize (new Dimension (icon .getIconWidth (), icon .getIconHeight ()));
8485
8586 Graphics2D g2 = (Graphics2D ) svgGen .create ();
8687 icon .paintIcon (null , g2 , 0 , 0 );
8788 g2 .dispose ();
8889
8990 StringWriter sw = new StringWriter ();
90- svgGen .stream (sw , true );
91+ svgGen .stream (sw , false );
9192 sw .flush ();
9293
9394 String svg = sw .toString ()
94- .replace ("font-family:'cmr10'" , "font-family:'Noto Sans Symbols', 'DejaVu Sans', sans-serif" )
95- .replace ("font-family:'cmmi10'" , "font-family:'Noto Sans Symbols', 'DejaVu Sans', sans-serif" )
96- .replace ("font-family:'cmsy10'" , "font-family:'Noto Sans Symbols', 'DejaVu Sans', sans-serif" )
97- .replace ("font-family:'cmex10'" , "font-family:'Noto Sans Symbols', 'DejaVu Sans', sans-serif" )
98- .replace ("−" , "-" )
99- .replace (";" , " " );
95+ .replace ("font-family:'cmr10'" , "font-family:'STIXGeneral','Latin Modern Math','DejaVu Sans',sans-serif" )
96+ .replace ("font-family:'cmmi10'" , "font-family:'STIXGeneral','Latin Modern Math','DejaVu Sans',sans-serif" )
97+ .replace ("font-family:'cmsy10'" , "font-family:'STIXGeneral','Latin Modern Math','DejaVu Sans',sans-serif" )
98+ .replace ("font-family:'cmex10'" , "font-family:'STIXGeneral','Latin Modern Math','DejaVu Sans',sans-serif" );
10099
101100 return svg ;
102101 } catch (Exception e ) {
0 commit comments