-
-
Notifications
You must be signed in to change notification settings - Fork 390
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
Fonts look different in some flatpaked Java programs #4122
Comments
any updates on this? I am experiencing exactly the same issue on Kubuntu with every Flatpaked Java application. |
I think this should be reported to the openjdk extension repo? |
Install |
@zocker-160 can you check if that gtk portal is running? |
@soredake I have EDIT: I want to add, that this issue can be reproduced quite easily, all you need is a Kubuntu VM with literally any Java application inside Flatpak. |
@zocker-160 to clarify, your problem is the used font(s) in jdownloader flatpak is different from the host? |
@soredake not only JDownloader, it is true for any Java application running inside Flatpak. As you can see on the images above, it is not only a different font, but also the anti aliasing does not seem to work properly. In terms of the last image, even the text color is different. |
@zocker-160 there's three bugs here
After doing all those three, fonts should look as they need to be. Additionally you can try |
@soredake thank you a lot for looking into this, I highly appreciate it. All 3 issues you listed to me sound like missing file permission, but I tried with I also copied the entire
To me this sounds like some fundamental issue with Flatpak, since with full access to the host files, the application should have everything it needs. |
@zocker-160 Can you show me output of |
understood, but I copied the entire folder to |
oops I pressed enter too soon, will post outputs any moment |
here my outputs:
understood yeah you are right, good to know and good point |
@zocker-160 yeah, everything is setup correctly. If your fonts are different in flatpak'ed java apps that can mean three things:
Jdownloader on host uses 1.8.0 (really old) java, flatpak version uses 17 (recent) java, other flatpaked apps probably use newer (or older) java than on host too. Fonts at least should be antialiased if you done For me (at least in fedora kde vm), fonts in jd2 are same in host and flatpak, and AA working after that command, but rendering is different. |
@soredake I did some further testing with one of my own applications which uses Java 17. And while it does indeed look very similar (way more similar than with a Java 8 or 11 project) to native, it is absolutely not the same. Now I hear you saying, that one would need to pixel peep in order to see the difference, I agree, BUT this is more a fundamental question, because IMO packaging a software in a different format should absolutely never change how the application looks. This does not happen for DEB, RPM or Appimage for that matter, so it shouldn't for Flatpak either. If you want to try yourself, this is my Flatpak manifest I used for testing: |
@zocker-160 don't forget that flatpak is not only a package format but also have sandboxing (that for now causes problems with integration with system fonts), you can as i said report problem here, maybe java sdk maintainer can help you, or complain here #1563 |
@soredake yes I know and I highly appreciate the sandboxing as well. I hope the Java SDK maintainers know better what is going on and how to potentially fix it. Thank you very much for your time and effort to help out with this issue. |
Judging by screenshots it looks like another font is used, so my theory about flatpak internal fonts taking precedence is maybe right, one idea is to remove files from /var/lib/flatpak/<path to runtime's conf.d folder> and leave only 50-flatpak.conf, this will in theory will load only your fonts. |
oh I see, inside the runtime that I am using How can I get rid of them for testing? |
@zocker-160 I'm not sure if this will work, but you can try:
After you've done experimenting you can repair runtimes with |
Or you can change priority of 50 files to 100 to make them load your fonts last overriding flatpak defaults. |
Another option is to create custom runtime and run your app with |
alright so I did some further testing today and your suggestion sadly makes things even worse, now the fonts are not only ugly but also very small. I also tried copying the Maybe I need to copy the actual fonts from the host also into the runtime? |
You can try this, |
@soredake I managed success!!! I am sure this "solution" is ugly as fk and IMO this should be addressed by flatpak devs, no user should have to do any of this. Here is what I did:
I think the main issue is, that the Flatpak cannot access the fonts inside |
adding an overwrite for on my host:
inside flatpak:
I think this is the key issue here. |
Your host fonts are mounted at |
FWIW this does not just affect Java applications. I am seeing this in vscodium, where the text in flatpak is somehow wider than in a vscode running in firejail.
|
Linux distribution and version
KDE Neon User Edition 5.20 x86_64
Flatpak version
1.10.1
Description of the problem
Fonts are showing aliased in some flatpaked Java programs. Running these jars without a sandboxed environment results in proper, smoothed-out fonts.
First reported in the repo where I saw this problem occur, but down the line the maintainer told me the issue wasn't on their flatpak, not on their machine.
guihkx/com.teamshiginima.ShiginimaLauncher#1
Here's a picture of how the fonts differ (On
org.jdownloader.JDownloader
):Another picture. This time the proportions of the windows look different. Top is native, bottom flatpak.
The maintainer told me they didn't experience issues on their system running GNOME.
Steps to reproduce
The text was updated successfully, but these errors were encountered: