-
Bug
-
Resolution: Not an Issue
-
P5
-
None
-
1.4.0
-
generic
-
generic
Within JavaHelp attempts to change the default Font size are rejected. The following code is internal to the JHContentViewer (BasicContentViewer) and is not changing the font when executed. The first part is the old code and the latter is no code. Neither work.
Font newFont = (Font)event.getNewValue();
EditorKit ek = html.getEditorKit();
if (ek instanceof HTMLEditorKit) {
! String cssData = "body { font-family: " +
! newFont.getFamily() + " }";
HTMLEditorKit hek = (HTMLEditorKit) ek;
StyleSheet styles = hek.getStyleSheet();
try {
! styles.loadRules(new StringReader(cssData), null);
} catch (Exception ex) {
}
}
--- 283,296 ----
Font newFont = (Font)event.getNewValue();
EditorKit ek = html.getEditorKit();
if (ek instanceof HTMLEditorKit) {
! String cssData = "body { font: " +
! newFont.getSize() + "pt " + newFont.getFamily() +
! " }";
! System.out.println ("cssData="+ cssData + "\n");
HTMLEditorKit hek = (HTMLEditorKit) ek;
StyleSheet styles = hek.getStyleSheet();
try {
! styles.addRule(cssData);
} catch (Exception ex) {
}
}
Font newFont = (Font)event.getNewValue();
EditorKit ek = html.getEditorKit();
if (ek instanceof HTMLEditorKit) {
! String cssData = "body { font-family: " +
! newFont.getFamily() + " }";
HTMLEditorKit hek = (HTMLEditorKit) ek;
StyleSheet styles = hek.getStyleSheet();
try {
! styles.loadRules(new StringReader(cssData), null);
} catch (Exception ex) {
}
}
--- 283,296 ----
Font newFont = (Font)event.getNewValue();
EditorKit ek = html.getEditorKit();
if (ek instanceof HTMLEditorKit) {
! String cssData = "body { font: " +
! newFont.getSize() + "pt " + newFont.getFamily() +
! " }";
! System.out.println ("cssData="+ cssData + "\n");
HTMLEditorKit hek = (HTMLEditorKit) ek;
StyleSheet styles = hek.getStyleSheet();
try {
! styles.addRule(cssData);
} catch (Exception ex) {
}
}