Ugly/Non Anti-Aliased fonts in Java-Swing Applications
up vote
9
down vote
favorite
I've recently switched to Ubuntu and I've installed Oracle's Java JDK 8u45 (32 bit) using the webupd8team/java repository.
Everything seems to be working fine except that the Java-Swing applications are having broken and ugly fonts with no anti-aliasing. Changing the font doesn't work. Native applications like Gedit though having the same font are not affected (nor are non-Swing Java-applications like Eclipse); its only affecting Swing-based applications.
Screenshots:
(jEdit v5.1)
I'm running Ubuntu 15.04 (which is the latest version as of 2015-06-15). My Java version is 1.8.0_45 and 'java -version' gives the following output:
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) Server VM (build 25.45-b02, mixed mode)
I've tried the fixes given in similar questions (here and on other stackexchange sites) but they do not work. I've also added the following lines in the /etc/environment (as given here: https://wiki.archlinux.org/index.php/Java_Runtime_Environment_Fonts) but they are not giving me any apparent results.
JAVA_FONTS=/usr/share/fonts/truetype
_JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on'
I'm sure there must be a fix for this. The same Java-Applications are working as they should on Windows-7.
java fonts jdk
add a comment |
up vote
9
down vote
favorite
I've recently switched to Ubuntu and I've installed Oracle's Java JDK 8u45 (32 bit) using the webupd8team/java repository.
Everything seems to be working fine except that the Java-Swing applications are having broken and ugly fonts with no anti-aliasing. Changing the font doesn't work. Native applications like Gedit though having the same font are not affected (nor are non-Swing Java-applications like Eclipse); its only affecting Swing-based applications.
Screenshots:
(jEdit v5.1)
I'm running Ubuntu 15.04 (which is the latest version as of 2015-06-15). My Java version is 1.8.0_45 and 'java -version' gives the following output:
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) Server VM (build 25.45-b02, mixed mode)
I've tried the fixes given in similar questions (here and on other stackexchange sites) but they do not work. I've also added the following lines in the /etc/environment (as given here: https://wiki.archlinux.org/index.php/Java_Runtime_Environment_Fonts) but they are not giving me any apparent results.
JAVA_FONTS=/usr/share/fonts/truetype
_JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on'
I'm sure there must be a fix for this. The same Java-Applications are working as they should on Windows-7.
java fonts jdk
add a comment |
up vote
9
down vote
favorite
up vote
9
down vote
favorite
I've recently switched to Ubuntu and I've installed Oracle's Java JDK 8u45 (32 bit) using the webupd8team/java repository.
Everything seems to be working fine except that the Java-Swing applications are having broken and ugly fonts with no anti-aliasing. Changing the font doesn't work. Native applications like Gedit though having the same font are not affected (nor are non-Swing Java-applications like Eclipse); its only affecting Swing-based applications.
Screenshots:
(jEdit v5.1)
I'm running Ubuntu 15.04 (which is the latest version as of 2015-06-15). My Java version is 1.8.0_45 and 'java -version' gives the following output:
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) Server VM (build 25.45-b02, mixed mode)
I've tried the fixes given in similar questions (here and on other stackexchange sites) but they do not work. I've also added the following lines in the /etc/environment (as given here: https://wiki.archlinux.org/index.php/Java_Runtime_Environment_Fonts) but they are not giving me any apparent results.
JAVA_FONTS=/usr/share/fonts/truetype
_JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on'
I'm sure there must be a fix for this. The same Java-Applications are working as they should on Windows-7.
java fonts jdk
I've recently switched to Ubuntu and I've installed Oracle's Java JDK 8u45 (32 bit) using the webupd8team/java repository.
Everything seems to be working fine except that the Java-Swing applications are having broken and ugly fonts with no anti-aliasing. Changing the font doesn't work. Native applications like Gedit though having the same font are not affected (nor are non-Swing Java-applications like Eclipse); its only affecting Swing-based applications.
Screenshots:
(jEdit v5.1)
I'm running Ubuntu 15.04 (which is the latest version as of 2015-06-15). My Java version is 1.8.0_45 and 'java -version' gives the following output:
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) Server VM (build 25.45-b02, mixed mode)
I've tried the fixes given in similar questions (here and on other stackexchange sites) but they do not work. I've also added the following lines in the /etc/environment (as given here: https://wiki.archlinux.org/index.php/Java_Runtime_Environment_Fonts) but they are not giving me any apparent results.
JAVA_FONTS=/usr/share/fonts/truetype
_JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on'
I'm sure there must be a fix for this. The same Java-Applications are working as they should on Windows-7.
java fonts jdk
java fonts jdk
edited Dec 3 at 6:24
asked Jun 15 '15 at 11:03
hexman
456316
456316
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
8
down vote
accepted
This problem has long been fixed so I decided I should post the solution. Note that the problem is still there by default but it can be fixed by a parameter.
Adding this line:
_JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true'
to /etc/environment
fixes the issue.
This fix works as of Ubuntu 16.04 and OpenJDK 8u151 (haven't checked with Oracle JDK or Java 9).
Working example:
Note: Some fonts and AA settings complicate the problem. In jEdit, I use the default Java fonts ("Dialog" as it's called) for everything. You can probably use a different font for the Text-Area but Dialog is the best for buttons, etc. The best Text-Area AA setting I've found is standard but your mileage may vary.
1
Your solution works great!
– Nadav B
Apr 18 at 14:39
Again needed as of Ubuntu 18.10 and OpenJDK 11. And still working! :)
– tanius
Nov 30 at 1:51
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
8
down vote
accepted
This problem has long been fixed so I decided I should post the solution. Note that the problem is still there by default but it can be fixed by a parameter.
Adding this line:
_JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true'
to /etc/environment
fixes the issue.
This fix works as of Ubuntu 16.04 and OpenJDK 8u151 (haven't checked with Oracle JDK or Java 9).
Working example:
Note: Some fonts and AA settings complicate the problem. In jEdit, I use the default Java fonts ("Dialog" as it's called) for everything. You can probably use a different font for the Text-Area but Dialog is the best for buttons, etc. The best Text-Area AA setting I've found is standard but your mileage may vary.
1
Your solution works great!
– Nadav B
Apr 18 at 14:39
Again needed as of Ubuntu 18.10 and OpenJDK 11. And still working! :)
– tanius
Nov 30 at 1:51
add a comment |
up vote
8
down vote
accepted
This problem has long been fixed so I decided I should post the solution. Note that the problem is still there by default but it can be fixed by a parameter.
Adding this line:
_JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true'
to /etc/environment
fixes the issue.
This fix works as of Ubuntu 16.04 and OpenJDK 8u151 (haven't checked with Oracle JDK or Java 9).
Working example:
Note: Some fonts and AA settings complicate the problem. In jEdit, I use the default Java fonts ("Dialog" as it's called) for everything. You can probably use a different font for the Text-Area but Dialog is the best for buttons, etc. The best Text-Area AA setting I've found is standard but your mileage may vary.
1
Your solution works great!
– Nadav B
Apr 18 at 14:39
Again needed as of Ubuntu 18.10 and OpenJDK 11. And still working! :)
– tanius
Nov 30 at 1:51
add a comment |
up vote
8
down vote
accepted
up vote
8
down vote
accepted
This problem has long been fixed so I decided I should post the solution. Note that the problem is still there by default but it can be fixed by a parameter.
Adding this line:
_JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true'
to /etc/environment
fixes the issue.
This fix works as of Ubuntu 16.04 and OpenJDK 8u151 (haven't checked with Oracle JDK or Java 9).
Working example:
Note: Some fonts and AA settings complicate the problem. In jEdit, I use the default Java fonts ("Dialog" as it's called) for everything. You can probably use a different font for the Text-Area but Dialog is the best for buttons, etc. The best Text-Area AA setting I've found is standard but your mileage may vary.
This problem has long been fixed so I decided I should post the solution. Note that the problem is still there by default but it can be fixed by a parameter.
Adding this line:
_JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true'
to /etc/environment
fixes the issue.
This fix works as of Ubuntu 16.04 and OpenJDK 8u151 (haven't checked with Oracle JDK or Java 9).
Working example:
Note: Some fonts and AA settings complicate the problem. In jEdit, I use the default Java fonts ("Dialog" as it's called) for everything. You can probably use a different font for the Text-Area but Dialog is the best for buttons, etc. The best Text-Area AA setting I've found is standard but your mileage may vary.
answered Nov 24 '17 at 16:20
hexman
456316
456316
1
Your solution works great!
– Nadav B
Apr 18 at 14:39
Again needed as of Ubuntu 18.10 and OpenJDK 11. And still working! :)
– tanius
Nov 30 at 1:51
add a comment |
1
Your solution works great!
– Nadav B
Apr 18 at 14:39
Again needed as of Ubuntu 18.10 and OpenJDK 11. And still working! :)
– tanius
Nov 30 at 1:51
1
1
Your solution works great!
– Nadav B
Apr 18 at 14:39
Your solution works great!
– Nadav B
Apr 18 at 14:39
Again needed as of Ubuntu 18.10 and OpenJDK 11. And still working! :)
– tanius
Nov 30 at 1:51
Again needed as of Ubuntu 18.10 and OpenJDK 11. And still working! :)
– tanius
Nov 30 at 1:51
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f636666%2fugly-non-anti-aliased-fonts-in-java-swing-applications%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown