guihkx / com.teamshiginima.ShiginimaLauncher

📦 Flatpak build of Shiginima Launcher (NOT OFFICIAL)
Creative Commons Zero v1.0 Universal
11 stars 3 forks source link

Font is aliased #1

Closed luni3359 closed 3 years ago

luni3359 commented 3 years ago

It's pretty harmless, but the font shows up aliased on the launcher. Flatpak on the left side, normal jar on the right. weird

guihkx commented 3 years ago

I don't have this issue on GNOME, but I'll take a better look at this tomorrow when I get home. In the meantime, could you confirm that this issue is exclusive to this launcher by e.g. installing another Java program using Flatpak? Thanks.

Sent from ProtonMail mobile

-------- Original Message -------- On Feb 7, 2021, 20:19, Luni wrote:

It's pretty harmless, but the font shows up aliased on the launcher. Flatpak on the left side, normal jar on the right. weird

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

luni3359 commented 3 years ago

I could only find two obvious ones to test. I tried BlueJ and TuxGuitar, but neither of them had the issue.

guihkx commented 3 years ago

So I can reproduce this on Kubuntu 20.10, but I believe this is somewhat of a KDE issue.

Plasma now uses xsettingsd to sync their settings with Gtk applications, so if you read ~/.config/xsettingsd/xsettingsd.conf, on a clean installation it will look like this:

Net/ThemeName "Breeze"
Gtk/EnableAnimations 1
Gtk/DecorationLayout "icon:minimize,maximize,close"
Gtk/PrimaryButtonWarpsSlider 0
Gtk/ToolbarStyle 3
Gtk/MenuImages 1
Gtk/ButtonImages 1
Gtk/CursorThemeName "breeze_cursors"
Net/IconThemeName "breeze"
Gtk/FontName "Noto Sans,  10"

However, for some reason, none of the Xft/* properties are set.

So, a workaround for add this line somewhere in xsettingsd.conf:

Xft/Antialias 1

Other properties are available too, but this one should suffice. After that, simply logout/login or just kill the xsettingsd process and launch it again manually using Alt+F2.

Fonts won't look exactly like they do when you run the .jar file directly, but that's how they look for me on GNOME anyway.

luni3359 commented 3 years ago

Thanks, Xft/Antialias -1 partially solved it for me. The font looks different, but at least it's not pixelated anymore. I tried setting Hinting on like you suggested, but it didn't seem to have any effect for me.

Do you think this is reportable to Flatpak? I thought it could be, because the program looks different when sandboxed.

guihkx commented 3 years ago

I tried setting Hinting on like you suggested, but it didn't seem to have any effect for me.

Oops, I messed up. It was the Xft/Antialias 1 option that should've been set indeed, and not Xft/Hinting. 😅 Glad you caught that!

Do you think this is reportable to Flatpak?

I guess so, but I still think KDE might be doing something to change how their fonts look on Java programs. On GNOME at least, they are rendered exactly the same on both 'native' and Flatpak:

Untitled

Can you also do comparison between 'native' JDownloader and Flatpak'd JDownloader (package: org.jdownloader.JDownloader)?

luni3359 commented 3 years ago

Can you also do comparison between 'native' JDownloader and Flatpak'd JDownloader (package: org.jdownloader.JDownloader)?

Here you are. I disabled the antialiasing for the test. The fonts look the same, aside from the jagged edges. Sidebyside

Seems like I was wrong. The fonts are ever so slightly different from each other, even with antialiasing on.

image

It's even more apparent in the exit windows. Top is native, bottom flatpak.

image

guihkx commented 3 years ago

Hmm, what distro are you using? Debian-based distros are known for applying a number of patches to their packages, while Arch-based distros tend to keep patches to a minimum.

So, I installed Manjaro 20.2.1 (with Plasma 5.20.5), and this is the font rendering I get when I run java -jar shiginima.jar:

image

Yes, antialiasing is not even on by default, lol. To actually enable it, you have to set the _JAVA_OPTIONS environment variable:

$ _JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on' java -jar shiginima.jar

image

I would guess they're patching some package (Java being my first guess), in order to make fonts render prettier on KDE. I could be wrong, though. So feel free to report to the Flatpak guys.

luni3359 commented 3 years ago

I'm on KDE Neon. Thanks for the information, I'll see how to report this, if possible.