You are not logged in.

#1 2020-10-31 13:26:03

Dreezy
Member
Registered: 2016-06-21
Posts: 19

[SOLVED] Ugly looking fonts on Swing when using bunsen labs

I don't know why the problem is, but the fonts are ugly, like there is no anti-aliasing on java swing applications.

I already tried the configurations, in /etc/environment, but the problem doesn't seem to go away.

_JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true'

So anybody with a good solutions.

bad java swing fonts

Last edited by twoion (2020-11-01 11:54:32)

Offline

#2 2020-10-31 13:54:06

Dreezy
Member
Registered: 2016-06-21
Posts: 19

Re: [SOLVED] Ugly looking fonts on Swing when using bunsen labs

Am on the latest bunsen labs, by the way.

Last edited by Dreezy (2020-10-31 13:54:20)

Offline

#3 2020-10-31 14:12:02

twoion
ほやほや
Registered: 2015-08-10
Posts: 3,025

Re: [SOLVED] Ugly looking fonts on Swing when using bunsen labs

Dreezy wrote:

I don't know why the problem is, but the fonts are ugly, like there is no anti-aliasing on java swing applications.

I already tried the configurations, in /etc/environment, but the problem doesn't seem to go away.

_JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true'

So anybody with a good solutions.

https://i.imgur.com/wjqLgb0.png

When you launch the application with the proper environment set from a terminal, it should print a line starting with "Picked up _JAVA_OPTIONS".

 $ _JAVA_OPTIONS='-Dswing.aatext=true -Dawt.useSystemAAFontSettings=on' PortfolioPerformance
Picked up _JAVA_OPTIONS: -Dswing.aatext=true -Dawt.useSystemAAFontSettings=on

Can you check if that is the case, and if not, just execute the `env` command to see if the setting is really part of the session?

Note that /etc/environment is processed by libpam only, so in order to make that variable part of the session, you likely have to log out and log in again (if you're using /etc/environment -- I have my settings in ~/.config/plasma-workspace/env, because I'm on KDE.

To control if the settings WOULD work correctly, issue

env _JAVA_OPTIONS='-Dswing.aatext=true -Dawt.useSystemAAFontSettings=on' yourprogram on the terminal

so we can stop worrying about how to get the environment there if it doesn't work at all in the app. Which app btw? Is that Eclipse or netbeans? Did you triple-check if there is a setting in the GUI to turn settings like this on?


Per aspera ad astra.

Offline

#4 2020-10-31 14:24:23

Dreezy
Member
Registered: 2016-06-21
Posts: 19

Re: [SOLVED] Ugly looking fonts on Swing when using bunsen labs

twoion wrote:
Dreezy wrote:

I don't know why the problem is, but the fonts are ugly, like there is no anti-aliasing on java swing applications.

I already tried the configurations, in /etc/environment, but the problem doesn't seem to go away.

_JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true'

So anybody with a good solutions.

https://i.imgur.com/wjqLgb0.png

When you launch the application with the proper environment set from a terminal, it should print a line starting with "Picked up _JAVA_OPTIONS".

 $ _JAVA_OPTIONS='-Dswing.aatext=true -Dawt.useSystemAAFontSettings=on' PortfolioPerformance
Picked up _JAVA_OPTIONS: -Dswing.aatext=true -Dawt.useSystemAAFontSettings=on

Can you check if that is the case, and if not, just execute the `env` command to see if the setting is really part of the session?

Note that /etc/environment is processed by libpam only, so in order to make that variable part of the session, you likely have to log out and log in again (if you're using /etc/environment -- I have my settings in ~/.config/plasma-workspace/env, because I'm on KDE.

To control if the settings WOULD work correctly, issue

env _JAVA_OPTIONS='-Dswing.aatext=true -Dawt.useSystemAAFontSettings=on' yourprogram on the terminal

so we can stop worrying about how to get the environment there if it doesn't work at all in the app. Which app btw? Is that Eclipse or netbeans? Did you triple-check if there is a setting in the GUI to turn settings like this on?

It's netbeans, and I tried as you said:

env _JAVA_OPTIONS='-Dswing.aatext=true -Dawt.useSystemAAFontSettings=on' ./netbeans

But still getting that bad looking font. I don't know if there is a settings for such in the UI.

Offline

#5 2020-10-31 14:30:16

twoion
ほやほや
Registered: 2015-08-10
Posts: 3,025

Re: [SOLVED] Ugly looking fonts on Swing when using bunsen labs

Definitely works for me

$ env | grep _JAVA
_JAVA_AWT_WM_NONREPARENTING=1
_JAVA_OPTIONS=-Dswing.aatext=true -Dawt.useSystemAAFontSettings=on
$ netbeans 
Picked up _JAVA_OPTIONS: -Dswing.aatext=true -Dawt.useSystemAAFontSettings=on

So in your case, perhaps the launcher Debian is using could be scrubbing the environment".


Per aspera ad astra.

Offline

#6 2020-10-31 14:54:06

Dreezy
Member
Registered: 2016-06-21
Posts: 19

Re: [SOLVED] Ugly looking fonts on Swing when using bunsen labs

twoion wrote:

Definitely works for me

$ env | grep _JAVA
_JAVA_AWT_WM_NONREPARENTING=1
_JAVA_OPTIONS=-Dswing.aatext=true -Dawt.useSystemAAFontSettings=on
$ netbeans 
Picked up _JAVA_OPTIONS: -Dswing.aatext=true -Dawt.useSystemAAFontSettings=on

So in your case, perhaps the launcher Debian is using could be scrubbing the environment".

Damn, maybe it's cause I am using openj9 version from adoptopenjdk 11.
Which one are you using???

Offline

#7 2020-11-01 06:26:42

Dreezy
Member
Registered: 2016-06-21
Posts: 19

Re: [SOLVED] Ugly looking fonts on Swing when using bunsen labs

Okay, I have tried with regular hotspot jdk from adoptopenjdk, and fonts are clear now. It appears to be an issue with openj9 versions.

Offline

#8 2020-11-01 11:54:14

twoion
ほやほや
Registered: 2015-08-10
Posts: 3,025

Re: [SOLVED] Ugly looking fonts on Swing when using bunsen labs

Dreezy wrote:

Okay, I have tried with regular hotspot jdk from adoptopenjdk, and fonts are clear now. It appears to be an issue with openj9 versions.

This is very good to know. I'll mark the thread as "solved".


Per aspera ad astra.

Offline

Board footer

Powered by FluxBB