Ugly fonts in Java applications on Ubuntu

2020-05-10 23:56发布

Help me, please. It's screen of my Netbeans:enter image description here PyCharm: enter image description here How can I fix it? I use Oracle Java 7. java version "1.7.0_25" Java(TM) SE Runtime Environment (build 1.7.0_25-b15) Java HotSpot(TM) 64-Bit Server VM (build 23.25-b01, mixed mode)

PS: For comparison my Sublime Text:enter image description here

6条回答
Root(大扎)
2楼-- · 2020-05-11 00:35

After hours of searching and experimenting, I finally found a working solution!!! No need to mess up with fontforge, no need to patch your jdk, which is not allowed on a corporate workstation.

  1. REQUIRED Remove openjdk and install oracle jdk.
  2. Download deb from http://ppa.launchpad.net/no1wantdthisname/ubuntu/pool/main/f/fontconfig-infinality/
  3. Install it: sudo dpkg -i *.deb
  4. Enable osx font smoothing: sudo /etc/fonts/infinality/infctl.sh setstyle
  5. Reboot your system sudo reboot lightgdm

If you are an Android Studio (Intellij) user, try add the following lines to your studio(64).vmoptions:

-Dawt.useSystemAAFontSettings=on
-Dswing.aatext=true
-Dsun.java2d.xrender=true
查看更多
贼婆χ
3楼-- · 2020-05-11 00:36

Old topic but for future visits, here is a solution that works:

# Install both infinality and fontfix'ed JDK.
sudo add-apt-repository ppa:no1wantdthisname/ppa
sudo add-apt-repository ppa:no1wantdthisname/openjdk-fontfix
sudo apt-get update
sudo apt-get install fontconfig-infinality openjdk-7-jdk
# Apply a font style that looks good.
sudo /etc/fonts/infinality/infctl.sh setstyle linux
# And reboot the system.
sudo reboot

source : Demian Ferreiro in solution

查看更多
再贱就再见
4楼-- · 2020-05-11 00:37

As of version release 2016.1, JetBrains is including / bundling a JRE that has the font rendering corrected.

:)

Scott

查看更多
来,给爷笑一个
5楼-- · 2020-05-11 00:38

So... Seems my problem is solved.

Step 1, Install and configure Infinality for better font rendering in Linux

sudo add-apt-repository ppa:no1wantdthisname/ppa
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install fontconfig-infinality

Step 2., Install OpenJDK7 with font fixes in Ubuntu

sudo add-apt-repository ppa:no1wantdthisname/openjdk-fontfix
sudo apt-get update
sudo apt-get upgrade

NetBeans: screenshot with improved fonts

Step 3: Applies nice font style linux

sudo /etc/fonts/infinality/infctl.sh setstyle linux
查看更多
Animai°情兽
6楼-- · 2020-05-11 00:41

Try adding

export _JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=gasp'

to your ~/.bashrc

A more detailed discussion can be found here.

查看更多
beautiful°
7楼-- · 2020-05-11 00:51

I suggest changing the choice of font in the program's settings. You can also install the windows fonts on Ubuntu if you prefer these.

In both cases you should be able to chose File -> Settings and search for font and change it to whatever you like.

I use a proportional font in IntelliJ CE and it looks fine to me in Ubuntu.

查看更多
登录 后发表回答