Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove JavaFX-Font-Tweak #5330

Merged
merged 3 commits into from
Oct 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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