Intellij IDEA font smoothing in linux

2019-02-03 03:57发布

I'm using IntelliJ IDEA on Arch Linux with KDE. OpenJDK version is 1.7.0_40.

Whole IDE fonts (includes code editor) are rendered without any antialiasing and font smoothing. I set in idea.properties file idea.use.default.antialiasing.in.editor to true, and added in _JAVA_OPTIONS variable -Dawt.useSystemAAFontSettings=on -Dswing.aatext=true without any effect.

What else I can try to enable font smoothing?

8条回答
相关推荐>>
2楼-- · 2019-02-03 04:42

Take a look here. I remember having the same problem when running IDEA, but after adding the line mentioned in the wiki the problem goes away.

export _JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=setting' where setting may be

  • off or false or default – No anti-aliasing
  • on – Full anti-aliasing
  • gasp – Use the font's built-in hinting instructions
  • lcd or lcd_hrgb – Anti-aliasing tuned for many popular LCD monitors
  • lcd_hbgr – Alternative LCD monitor setting
  • lcd_vrgb – Alternative LCD monitor setting
  • lcd_vbgr – Alternative LCD monitor setting
查看更多
ゆ 、 Hurt°
3楼-- · 2019-02-03 04:43

This is a known bug in OpenJDK. I don't think any amount of tweaking will fix this for you, it might make it a bit better, but the font rendering is broken in OpenJDK.

The most pain free fix IMHO, is to go to the AUR and install jdk7-compat, which is designed to run next to your normal JDK.

Don't worry if you never used the AUR, its really straight forward. Basically, what you do is

  1. insure you have base-devel installed with pacman -S base-devel
  2. download the tar from the AUR page I linked above, uncompress it.
  3. run 'makepkg -di' in the folder where you uncompressed to

and its done. Now, edit /usr/share/intellijidea-ce/bin/idea.sh and change the line which executes the program (its in the bottom of the file) so it looks like this

eval "/opt/java7/bin/java" $ALL_JVM_ARGS -Djb.restart.code=88 $MAIN_CLASS_NAME "$@"

This will make intelliJ run in the ORACLE JVM rather than the OpenJDK one, which fixes the font issues all together.

查看更多
登录 后发表回答