修改IntelliJ IDEA的抗锯齿字体渲染方式 | How to fix font anti-aliasing in IntelliJ IDEA when using high DPI?

http://superuser.com/questions/614960/how-to-fix-font-anti-aliasing-in-intellij-idea-when-using-high-dpi

提示:适用于webstorm等jetbrains家的IDE

I’m on a high-dpi display and I got it working with a perfect font rendering, to achieve this you need to:

  • (On Linux only) Install and use Oracle JDK (I’m using 1.7) and not OpenJDK (also the patched one with fontfix was useless for me). See how to do this.

  • Edit the .vmoptions configuration file that you find into the Bin installation folder (eg.studio.vmoptions and for 64bit studio64.vmoptions, or WebStorm.exe.vmoptions etc. according to the version of the IDE you installed) by adding these lines:
    -Dawt.useSystemAAFontSettings=on
    -Dswing.aatext=true
    -Dsun.java2d.xrender=true

  • Remove hinting informations from the font that you would like to use and select the new font intoIntelliJ IDEA preferences (Setting -> Editor -> Font);
    if you don’t know how to do this, install FontForge then:

    1. Open your font in FontForge
    2. Select all glyphs via Ctrl+A and clear all hints (Hints -> Clear Hints)
    3. Select glyphs again and use Hints -> Clear Instruction
    4. Save the font with different name ( File -> Generate Fonts)
    5. Install the new font, select it in IDEA

If you followed the above tips and you’re experiencing lags when fast scrolling the code (this sometimes could happen on Linux distributions with a not optimized gpu driver), try removing the line
-Dsun.java2d.xrender=true
from the .vmoptions file.

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注