Skip to content

Instantly share code, notes, and snippets.

@mageddo
Last active May 2, 2016 17:18
Show Gist options
  • Save mageddo/5aa07953708e088bb3903a0b2e6d1c71 to your computer and use it in GitHub Desktop.
Save mageddo/5aa07953708e088bb3903a0b2e6d1c71 to your computer and use it in GitHub Desktop.
Fix intellij idea swing ugly fonts

take a look at

https://github.com/mageddo/idea-ugly-fonts-fix/tree/master


LEGACY

The explanation below can work but is not maintened

Fix intellij swing ugly fonts (way 1)

Downloading and installing the fixed jdk (First way)

$ JDK_LINK="http://googledrive.com/host/0BwBEh4QJvkXjQzIxSFJtal9LNXM" # x64 bits
$ TAR_NAME="/tmp/jdk1.8.0-amd64-font-fixed.tar.xz"
$ curl -L $JDK_LINK > $TAR_NAME
tar: jdk1.8.0-amd64-font-fixed/man/ja: Cannot create symlink to ‘ja_JP.UTF-8’: File exists # no problem here
tar: Exiting with failure status due to previous errors
$ sudo tar -xf $TAR_NAME -C /opt/

Downloading and installing the fixed jdk (Second way)

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

# and choose your jdk version
$ sudo apt-get install openjdk-7-jdk
$ sudo apt-get install openjdk-8-jdk

Setup intellij fixed script

#!/bin/sh
# setting the fixed jdk to the default only in this terminal
export JAVA_HOME=/opt/jdk1.8.0-amd64-font-fixed 

# enabling the fix on intellij
export _JAVA_OPTIONS="-Dawt.useSystemAAFontSettings=lcd \
			-Dsun.java2d.xrender=true"

# starting idea
IDEA_HOME=/opt/idea
$IDEA_HOME/bin/idea.sh

Fixing font size

Fix intellij swing ugly fonts (way 2)

Downloading and installing the fixed jdk (First way)

(As above)

Setup intellij fixed script

create a gtkrc file to set the font size

$ touch $IDEA_HOME/.gtkrc

# with the follow content 
style "user-font" {
        font_name = "Monospace 2"
}

widget_class "*" style "user-font"

gtk-font-name="Monospace 2"

Create idea fixed start script

$ touch $IDEA_HOME/idea-fixed

# with the follow content
#!/bin/sh
# setting the fixed jdk to the default only in this terminal
export JAVA_HOME=/opt/jdk1.8.0-amd64-font-fixed 

# enabling the fix on intellij
export _JAVA_OPTIONS="-Dawt.useSystemAAFontSettings=lcd \
			-Dsun.java2d.xrender=true"

# starting idea
IDEA_HOME=/opt/idea
export GTK2_RC_FILES=$PWD/.gtkrc
$IDEA_HOME/bin/idea.sh

Fixing font size

Keywords

java idea jetbrans intellij idea jdk swing font-fix font fix gtk linux

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment