-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Improvement for Java FX font rendering on Linux #3305
Improvement for Java FX font rendering on Linux #3305
Conversation
… FX font rendering engine. This improves the Entry Editor on Linux.
I would have provided localization, but it seems this is done on Windows and when I run
|
Are you sure that the screenshots are correctly named? I find http://i.imgur.com/BsFhpmk.png way better, however you state that font tweaking is OFF in this version. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the contribution! The code looks really good, I just have one suggestion for refactoring.
Also, I could't yet test the changes under Linux, as I'm on travel atm.
Concerning the localizationUpdate: It would be great if you managed to incorporate the updates into this Pull Request, as our continuous testing toolchain complains due to missing translations.
If you don't manage, I can also do that for you. In this case you would give me push access to your fork of JabRef.
prefs.put(JabRefPreferences.WIN_LOOK_AND_FEEL, classNamesLAF.getSelectedItem().toString()); | ||
if ((customLAF.isSelected() == useDefaultLAF) || !currentLAF.equals(classNamesLAF.getSelectedItem().toString())) { | ||
if ((customLAF.isSelected() == useDefaultLAF) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you extract this into a private method named something like isRestartRequired
?
Regarding the line endings, check out this post which explains the configs: |
First, @Siedlerchr: thanks for the link. I will look into it. For this PR, I will fix the line endings manually, but maybe it is possible to put something like @lynyus I will do the refactoring and include the localization.
Yes, I'm very sure, but I admit that I might be very pedantic about something like this as I'm working in image processing. However, I'm happy to give a demonstration: First, a screenshot from the swing text. which render OK (not as great as in OSX or Windows, but hey, it's Linux): You see that the antialiasing creates colors around the characters. Now, close your eyes almost completely to create a blurred impression. You'll notice that despite the color-antialiasing, the font appears consistent meaning no character sticks out. Let's take a small portion from the FX fonts in the bottom No matter how hard you will try, the vertical lines of the I, H, and the first vertical of the M feel too heavy compared to the extremely thin and sharp last vertical line of the M. When working, these things give the Entry Editor font a very inconsistent feeling. Let's look at the same portion with the FX-tweak turned on. Not completely awesome, but definitely closer to the swing fonts. I hope that proves my case and I dearly hope that it will work as good on other Linux systems. |
…t and bundled them into one single, general dialog "Some appearance settings you changed require to restart JabRef." This prevents the issue that in the worst case the user is flooded with 3 dialogs saying basically the same: Settings changed, do a restart. Added localization for the font tweak setting
… fix-FxFontRenderingOnLinux
Thanks for the explanation. I see the same effects that you explain when I zoom in, it is just that the screenshots without the tweaks look somehow clearer and more harmonic to read. What do you think, @JabRef/developers? |
@lynyus Let me be a visitor for while :) I'm happy if I can help and I'm using JabRef regularly, but I'm not sure how much time I have beside my other stuff. I'm fine with making a PR for the moment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The font with the tweak on definitely looks more clear, but also a bit lighter (which is ok for me).
I like the screenshots with the tweaks. Pro tip: One can drop images directly into the text boxes and GitHub uploads it transparently. No need for external hosters as stackoverflow does. |
|
||
// 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)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't we just enable this for Linux by default then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I think it is okay like this. Giving the Users the possibility to opt out is a good thing here, as all screens are different and maybe some users prefer the heavier font over the lighter one (to me the untweaked font looks somehow more appealing)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hm ok.
@halirutan thanks for the contribution! Such expert knowledge is always highly appreciated. If you need a break from research, you are always welcome to have a look at our issues. (; |
@koppor Pro-pro-tip: The screenshot util on Linux can be configured to automatically upload images to imgur and gives you the link back. Only a Ctrl+V is required 😃 Hmm, but on a side note, I was under the impression that GitHub localizes all image links to imgur to its own hoster. At least I saw this happening in the past. |
* upstream/master: Update gradle to 4.2.1 (#3322) Avoid recreation of the EntryEditor (#3187) Fix #3133 telemetry by locking azure to 1.0.9 German translation for missing properties (#3312) Improvement for Java FX font rendering on Linux (#3305) Add also conversion for em dash Add \textendash to the html conversion table Update latex2tunicode from 0.2.1 -> 0.2.2 Added note about updating controlsfx Fix exception/freezing on EntryChangedEvent in Entry Editor (#3299) Update libs (#3300) update guava from 23.0 -> 23.2 update mvvmfx-validation from 1.6.0 -> 1.7.0 Resolves #3255 file open dialog should have "supported formates" filetype Fix #3235: remote metadata is updated instead of delete + insert (#3282) Change OO paths to Libre Office in preferences (#3287) Fix #2471: remove line breaks from abstracts in ADS fetcher (#3285) Resolves #3280 Empty String instead of N/A (#3288)
The font-rendering of Java FX on Linux seems to be generally not as good as on other systems. I found the repo Java FX hates Linux helpful which made a comparison for different settings for the prism rendering engine.
That being said, I found simply setting
provides the best font rendering without having to make changes in css that might affect other systems.
This pull-request adds a checkbox under Settings -> Appearance -> Look and Feel to turn this on after a restart. I incorporated it into the preference framework. On Linux, it is turned on in the default settings.
When turning it is turned on, the fonts are less blurry and the color bleaching is highly reduced (although we don't use gray scale font smoothing!). Compare these two screenshots:
gradle localizationUpdate
?