|
1384 | 1384 | }, |
1385 | 1385 | // Needed for client-side export to work |
1386 | 1386 | SVG: { |
| 1387 | + font: (urlParams['math-font'] != null) ? |
| 1388 | + decodeURIComponent(urlParams['math-font']) : |
| 1389 | + 'TeX', |
1387 | 1390 | useFontCache: false |
1388 | 1391 | }, |
1389 | 1392 | // Ignores math in in-place editor |
|
4520 | 4523 | if (this.themes != null && this.defaultThemeName == 'darkTheme') |
4521 | 4524 | { |
4522 | 4525 | temp = this.stylesheet; |
4523 | | - this.stylesheet = this.getDefaultStylesheet() |
| 4526 | + this.stylesheet = this.getDefaultStylesheet(); |
| 4527 | + // LATER: Fix math export in dark mode by fetching text nodes before |
| 4528 | + // calling refresh and changing the font color in-place |
4524 | 4529 | this.refresh(); |
4525 | 4530 | } |
4526 | 4531 |
|
|
5639 | 5644 | // Workaround to match available paper size in actual print output |
5640 | 5645 | printScale *= 0.75; |
5641 | 5646 |
|
| 5647 | + // Disables dark mode while printing |
| 5648 | + var darkStylesheet = null; |
| 5649 | + |
| 5650 | + if (graph.themes != null && graph.defaultThemeName == 'darkTheme') |
| 5651 | + { |
| 5652 | + darkStylesheet = graph.stylesheet; |
| 5653 | + graph.stylesheet = graph.getDefaultStylesheet() |
| 5654 | + graph.refresh(); |
| 5655 | + } |
| 5656 | + |
5642 | 5657 | function printGraph(thisGraph, pv, forcePageBreaks) |
5643 | 5658 | { |
5644 | 5659 | // Workaround for CSS transforms affecting the print output |
|
5882 | 5897 |
|
5883 | 5898 | if (tempGraph == null) |
5884 | 5899 | { |
5885 | | - tempGraph = editorUi.createTemporaryGraph(graph.getStylesheet()); |
| 5900 | + tempGraph = editorUi.createTemporaryGraph(graph.stylesheet);//getStylesheet()); |
5886 | 5901 |
|
5887 | 5902 | // Restores graph settings that are relevant for printing |
5888 | 5903 | var pageVisible = true; |
|
5973 | 5988 | doc.writeln('TeX: {'); |
5974 | 5989 | doc.writeln('extensions: ["AMSmath.js", "AMSsymbols.js", "noErrors.js", "noUndefined.js"]'); |
5975 | 5990 | doc.writeln('},'); |
| 5991 | + doc.writeln('SVG: {'); |
| 5992 | + doc.writeln('font: "' + ((urlParams['math-font'] != null) ? |
| 5993 | + decodeURIComponent(urlParams['math-font']) : |
| 5994 | + 'TeX') + '"'); |
| 5995 | + doc.writeln('},'); |
5976 | 5996 | doc.writeln('tex2jax: {'); |
5977 | 5997 | doc.writeln('ignoreClass: "geDisableMathJax"'); |
5978 | 5998 | doc.writeln('},'); |
|
6000 | 6020 | PrintDialog.printPreview(pv); |
6001 | 6021 | } |
6002 | 6022 | } |
| 6023 | + |
| 6024 | + // Restores dark mode |
| 6025 | + if (darkStylesheet != null) |
| 6026 | + { |
| 6027 | + graph.stylesheet = darkStylesheet; |
| 6028 | + graph.refresh(); |
| 6029 | + } |
6003 | 6030 | }; |
6004 | 6031 |
|
6005 | 6032 | var cancelBtn = mxUtils.button(mxResources.get('cancel'), function() |
|
0 commit comments