Skip to content

Commit 211db6a

Browse files
committed
v1.91 Replace all KaTeX woff2 fonts with woff versions. This fixes the big delimiters problem. I hope that WebView in a later version of JavaFX will accept woff2 fonts and I can switch back. Add WebEngine debugging code from debugWebEngine branch.
1 parent a0df302 commit 211db6a

42 files changed

Lines changed: 30 additions & 3 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/fjwright/runreduce/REDUCEPanel.java

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,20 @@ public class REDUCEPanel extends BorderPane {
9090

9191
private boolean fmprintLoaded, hideNextOutput;
9292

93+
/*
94+
* JavaScript debugging support. See
95+
* https://stackoverflow.com/questions/28687640/javafx-8-webengine-how-to-get-console-log-from-javascript-to-system-out-in-ja
96+
*/
97+
public static class JSBridge {
98+
public void log(String message) {
99+
System.err.println(message);
100+
}
101+
}
102+
103+
// Maintain a strong reference to prevent garbage collection:
104+
// https://bugs.openjdk.java.net/browse/JDK-8154127
105+
private final JSBridge bridge = new JSBridge();
106+
93107
REDUCEPanel() {
94108
FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("REDUCEPanel.fxml"));
95109
fxmlLoader.setRoot(this);
@@ -119,6 +133,15 @@ public class REDUCEPanel extends BorderPane {
119133
webEngine.getLoadWorker().stateProperty().addListener(
120134
(ov, oldState, newState) -> {
121135
if (newState == State.SUCCEEDED) {
136+
// Begin debugging support
137+
JSObject window = (JSObject) webEngine.executeScript("window");
138+
window.setMember("bridge", bridge);
139+
webEngine.executeScript(
140+
"console.error=function(message){bridge.log('JS ERROR: '+message)};" +
141+
"console.info=function(message){bridge.log('JS INFO: '+message)};" +
142+
"console.log=function(message){bridge.log('JS LOG: '+message)};" +
143+
"console.warn=function(message){bridge.log('JS WARN: '+message)}");
144+
// End debugging support
122145
outputWebViewAvailable();
123146
}
124147
});
@@ -205,6 +228,10 @@ private void outputWebViewAvailable() {
205228
} else
206229
// Reset enabled status of controls:
207230
reduceStopped();
231+
232+
// DEBUGGING...
233+
// webEngine.executeScript("console.log('Body font size: ' + " +
234+
// "getComputedStyle(document.body, null).getPropertyValue('font-size'))");
208235
}
209236

210237
void clearDisplay() {
@@ -878,10 +905,10 @@ void updateMenus() {
878905
FRAME.outputHereMenuItem.setDisable(outputHereMenuItemDisabled);
879906
FRAME.shutFileMenuItem.setDisable(shutFileMenuItemDisabled);
880907
FRAME.shutLastMenuItem.setDisable(shutLastMenuItemDisabled);
881-
FRAME.loadPackagesMenuItem.setDisable(loadPackagesMenuItemDisabled);
882908
// REDUCE menu items:
883-
FRAME.stopREDUCEMenuItem.setDisable(stopREDUCEMenuItemDisabled);
884909
FRAME.runREDUCESubmenu.setDisable(runREDUCESubmenuDisabled);
910+
FRAME.stopREDUCEMenuItem.setDisable(stopREDUCEMenuItemDisabled);
911+
FRAME.loadPackagesMenuItem.setDisable(loadPackagesMenuItemDisabled);
885912
// View menu items:
886913
FRAME.boldPromptsCheckBox.setSelected(boldPromptsState);
887914
FRAME.setSelectedColouredIORadioButton(colouredIOState);

src/fjwright/runreduce/RunREDUCEFrame.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ private void sourceForgeMenuItemAction() {
644644
@FXML
645645
private void aboutMenuItemAction() {
646646
Alert alert = new Alert(Alert.AlertType.INFORMATION,
647-
"Version 1.9, September 2020\n" +
647+
"Version 1.91, September 2020\n" +
648648
"\u00A9 2020 Francis Wright");
649649
alert.getDialogPane().setMinHeight(Region.USE_PREF_SIZE);
650650
alert.initOwner(RunREDUCE.primaryStage);
36 KB
Binary file not shown.
-30.4 KB
Binary file not shown.
9.16 KB
Binary file not shown.
-8.2 KB
Binary file not shown.
Binary file not shown.
-8.05 KB
Binary file not shown.
15.8 KB
Binary file not shown.
-13.6 KB
Binary file not shown.

0 commit comments

Comments
 (0)