40
votes

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
it seems your resolution is low, however try to change the font-size, and turn-off anti-aliasinguser2511414
It's Java problem, because ST2 has good fonts.Dmitry
Its all about font-rendering in java and not font itself. DevellMan solution will be the only choice for now, and changing LookAndFeel may work for some java softwares (those that support changing laf)Nevercom

6 Answers

44
votes

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
37
votes

Try adding

export _JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=gasp'

to your ~/.bashrc

A more detailed discussion can be found here.

21
votes

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

11
votes

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
votes

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

:)

Scott

1
votes

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.