Font in IntelliJ IDEA on Ubuntu 14.04

I installed IntelliJ IDEA 13.1 and Oracle JDK 1.8 on Ubuntu 14.04 x64 but when I launch IntelliJ IDEA the font is not ideal.

How I can change the font?

screenshot


I wrote a little manual how to fix this. Note: that it is only for 64-bit. architecture.

wget https://cloud.urshulyak.com/index.php/s/kcBfJQDyQABcbjz/download &&
mv download jdk-8u5-tuxjdk-b08.tar.gz &&
tar -zxvf jdk-8u5-tuxjdk-b08.tar.gz &&
sudo mv jdk-8u5-tuxjdk-b08 /usr/lib/jvm &&
rm jdk-8u5-tuxjdk-b08.tar.gz

Script to start Intellij Idea

*only note that need to change IDEA_HOME location for your path of idea

#!/bin/sh

IDEA_HOME=/opt/idea
# for old idea JAVA_HOME, for new 2016+ will be IDEA_JDK
#export JAVA_HOME=/usr/lib/jvm/jdk-8u5-tuxjdk-b08/
 
export IDEA_JDK=/usr/lib/jvm/jdk-8u5-tuxjdk-b08/
export _JAVA_OPTIONS="-Dawt.useSystemAAFontSettings=lcd \
                      -Dsun.java2d.xrender=true"
export GNOME_DESKTOP_SESSION_ID=this-is-deprecated
exec $IDEA_HOME/bin/idea.sh "$@"

Result:


Short answer that worked for me:

1) Go to File->Settings->Appearance & Behavior->Appearance.

2) Under anti-aliasing change both IDE and Editor options to "Greyscale".


Don't apply this configuration on Ubuntu 14!

Install freetype

$ sudo apt-get install libfreetype6

Install infinality patch

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

I had to do the following afterwards:

$ sudo rm /etc/fonts/conf.avail/52-infinality.conf
$ sudo ln -s /etc/fonts/infinality/infinality.conf /etc/fonts/conf.avail/52-infinality.conf

To use Windows 7 like font rendering do the following:

$ sudo /etc/fonts/infinality/infctl.sh setstyle win7

Configure your IDEA_HOME/bin/idea64.vmoptions. Add below lines:

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

Also enable Use Anti-aliased font checkbox, go to: File -> Settings -> Editor -> Appearance.

Preview:

Editor font: Monaco, UI: Ubuntu Bold

enter image description here


I have prepared a dedicated font named as "Ubuntu Mono Nohinting" to workaround a rendering issue with Java Swing applications such as NetBeans IDE, IntelliJ IDEA and PyCharm. The font hinting information has been stripped from the original Ubuntu Mono font family.

How to install

  • download the zip file from here
  • extract it
  • open *.ttf with Font Viewer to install.
  • or you can manually copy *.ttf into ~/.local/share/fonts/.

How to use

  • Select "Ubuntu Mono Nohinting" in editors' configuration.

Screenshots

Ubuntu Mono Font with PyCharm Monokai theme

Ubuntu Mono Font with PyCharm Monokai theme

Ubuntu Mono Nohinting Font with PyCharm Monokai theme

Ubuntu Mono Nohinting Font with PyCharm Monokai theme


Note that in Webstorm 9, the file you need to add these changes:

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

is:

bin/webstorm64.vmoptions

Confirmed working on Ubuntu 14.04