Skip to content

Commit

Permalink
Merge pull request #5330 from calixtus/remove_javafx_fontfix
Browse files Browse the repository at this point in the history
Remove JavaFX-Font-Tweak
  • Loading branch information
Siedlerchr authored Oct 14, 2019
2 parents 8bd6821 + 44d3978 commit 824b103
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 23 deletions.
11 changes: 0 additions & 11 deletions src/main/java/org/jabref/JabRefGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ public JabRefGUI(Stage mainStage, List<ParserResult> databases, boolean isBlank)
}

private void openWindow(Stage mainStage) {
applyFontRenderingTweak();

GUIGlobals.init();

LOGGER.debug("Initializing frame");
Expand Down Expand Up @@ -230,15 +228,6 @@ private boolean isLoaded(File fileToOpen) {
return false;
}

private void applyFontRenderingTweak() {
// On Linux, Java FX fonts look blurry per default. This can be improved by using a non-default rendering setting.
// See https://github.com/woky/javafx-hates-linux
if (Globals.prefs.getBoolean(JabRefPreferences.FX_FONT_RENDERING_TWEAK)) {
System.setProperty("prism.text", "t2k");
System.setProperty("prism.lcdtext", "true");
}
}

public static JabRefFrame getMainFrame() {
return mainFrame;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
class AppearancePrefsTab extends Pane implements PreferencesTab {

private final JabRefPreferences prefs;
private final CheckBox fontTweaksLAF;
private final TextField fontSize;
private final CheckBox overrideFonts;
private final DialogService dialogService;
Expand All @@ -46,7 +45,6 @@ public AppearancePrefsTab(DialogService dialogService, JabRefPreferences prefs)
fontSize = new TextField();
fontSize.setTextFormatter(ControlHelper.getIntegerTextFormatter());
Label fontSizeLabel = new Label(Localization.lang("Font size:"));
fontTweaksLAF = new CheckBox(Localization.lang("Tweak font rendering for entry editor on Linux"));

ToggleGroup themeGroup = new ToggleGroup();
lightTheme = new RadioButton("Light theme");
Expand Down Expand Up @@ -83,17 +81,12 @@ public Node getBuilder() {

@Override
public void setValues() {
fontTweaksLAF.setSelected(prefs.getBoolean(JabRefPreferences.FX_FONT_RENDERING_TWEAK));
overrideFonts.setSelected(prefs.getBoolean(JabRefPreferences.OVERRIDE_DEFAULT_FONT_SIZE));
fontSize.setText(String.valueOf(prefs.getInt(JabRefPreferences.MAIN_FONT_SIZE)));
}

@Override
public void storeSettings() {
// Java FX font rendering tweak
final boolean oldFxTweakValue = prefs.getBoolean(JabRefPreferences.FX_FONT_RENDERING_TWEAK);
prefs.putBoolean(JabRefPreferences.FX_FONT_RENDERING_TWEAK, fontTweaksLAF.isSelected());

final boolean oldOverrideDefaultFontSize = prefs.getBoolean(JabRefPreferences.OVERRIDE_DEFAULT_FONT_SIZE);
final int oldFontSize = prefs.getInt(JabRefPreferences.MAIN_FONT_SIZE);
prefs.putBoolean(JabRefPreferences.OVERRIDE_DEFAULT_FONT_SIZE, overrideFonts.isSelected());
Expand All @@ -111,8 +104,7 @@ public void storeSettings() {
}

boolean isRestartRequired =
(oldFxTweakValue != fontTweaksLAF.isSelected())
|| (oldOverrideDefaultFontSize != overrideFonts.isSelected())
(oldOverrideDefaultFontSize != overrideFonts.isSelected())
|| (oldFontSize != newFontSize)
|| isThemeChanged;
if (isRestartRequired) {
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/org/jabref/preferences/JabRefPreferences.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ public class JabRefPreferences implements PreferencesService {
public static final String LYXPIPE = "lyxpipe";
public static final String EXTERNAL_FILE_TYPES = "externalFileTypes";
public static final String FONT_FAMILY = "fontFamily";
public static final String FX_FONT_RENDERING_TWEAK = "fxFontRenderingTweak";
public static final String FX_THEME = "fxTheme";
public static final String LANGUAGE = "language";
public static final String NAMES_LAST_ONLY = "namesLastOnly";
Expand Down Expand Up @@ -471,7 +470,6 @@ private JabRefPreferences() {
defaults.put(EMACS_PATH, "emacsclient");
}

defaults.put(FX_FONT_RENDERING_TWEAK, OS.LINUX); //we turn this on per default on Linux
defaults.put(EMACS_ADDITIONAL_PARAMETERS, "-n -e");

defaults.put(PUSH_TO_APPLICATION, "TeXstudio");
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/l10n/JabRef_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -954,7 +954,6 @@ Upgrade\ external\ PDF/PS\ links\ to\ use\ the\ '%0'\ field.=Upgrade external PD
usage=usage
Use\ autocompletion=Use autocompletion

Tweak\ font\ rendering\ for\ entry\ editor\ on\ Linux=Tweak font rendering for entry editor on Linux
Use\ regular\ expression\ search=Use regular expression search

Username=Username
Expand Down

0 comments on commit 824b103

Please sign in to comment.