31

So tired to search solution.. I use PHPStorm IDE for my php projects and one trouble just makes me crazy. Editor fonts (editor, don't care about interface) looks horrible. I've tried on different distributions and different DE but result is always the same :( There are screenshots to compare Kate and PHPStorm fonts. I know that PHPStorm is an JAVA application and it uses different font hitting engine, but.. Eclipse is an JAVA app too, but has pretty nice fonts. PHPStorm fonts on both Windows and OSX looks like other system fonts. Smooth and readable. PHPStorm

Kate

Is there way to fix this font issue before my eyes will explode..? Thanks.

2
  • 1
    Hmm. Second screenshot after upload became smoother than original for some reasons. But I think my problem is clear for people who have the same trouble. May 27, 2011 at 11:15
  • 1
    I noticed that NetBeans 7 on linux has the same problem with fonts rendering :( May 27, 2011 at 12:18

9 Answers 9

20

Following the PhpStorm issue, here is what I added to phpstorm64.vmoptions (that I have installed in /usr/local/bin/PhpStorm/bin/):

-Dswing.aatext=true
-Dawt.useSystemAAFontSettings=gasp
-Dsun.java2d.xrender=true

I also did the trick of opening the font in FontForge:

  • Ctrl+A (select all chars)
  • Hints -> Clear Hints
  • Hints -> Clear Instructions
  • File -> Generate Font

I put it in ~/fonts/

I am running Ubuntu 12.10 and after all that, everything looks quite great (I did it for Ubuntu Mono).

The only problem I noticed is that -Dawt.useSystemAAFontSettings=gasp leads to great editor font rendering, but poor rendering for menus and other stuffs. Whereas -Dawt.useSystemAAFontSettings=lcd gives awesome font rendering for menus, but less good font rendering in the editor. So try both and pick the one you prefer.


Update: on Ubuntu 13.10, I have no problem anymore.

6
  • -Dsun.java2d.xrender=true makes to disappear some characters, but first and second options did the trick! :) Jun 28, 2013 at 18:44
  • Update: On Ubuntu 13.04 the font rendering seems OK, I didn't edit anything. Sep 19, 2013 at 7:53
  • Awesome solution, thanks a lot! (the first part, I didn't try the second part)
    – KOHb
    Feb 6, 2014 at 15:28
  • 2
    In fedora 20 64 bit, I had better results with this config: -Dswing.aatext=true -Dawt.useSystemAAFontSettings=on Apr 7, 2014 at 12:42
  • On Ubuntu 15.04, it works with OpenJDK with font fix github.com/achaphiv/ppa-fonts/blob/master/openjdk-fontfix/… instead of Oracle JDK at least on my environment. I didn't need to do the FontForge part.
    – Nobu
    Jul 11, 2015 at 23:51
4

This is Linux specific issue, you can find a lot of information on this problem here. Check the comments for various suggestions and workarounds.

Here is what you can get with just a different font:

IDEA on Linux

1
  • Thanks. I did not find solution for me. But now I know the reason why it happend. May 27, 2011 at 14:36
4

You can install infinality patches and patch OpenJDK to make it use freetype for fonts rendering.

Here are links about installing infinality and patched OpenJDK for Ubuntu-based distributions:

http://www.webupd8.org/2013/06/better-font-rendering-in-linux-with.html
http://www.webupd8.org/2013/06/install-openjdk-patched-with-font-fixes.html

And here is my screenshot of PHPStorm running on Fedora 20 with infinality and patched OpenJDK: enter image description here

3
  • Looks great. AFAIK, OpenJDK was not recommended for using with PHPStorm. JetBrains strongly recommended to use Oracle Java. Does IDE work fine with OpenJDK now? Jan 30, 2014 at 7:00
  • @YaroslavRogoza I have neither performance problems nor any graphic issues or crashes when running PHPStorm on OpenJDK.
    – rpeshkov
    Jan 30, 2014 at 7:30
  • This is the real answer. After a long time of fiddling around with the JVM options without real luck, the patched OpenJDK finally did the job. The rendering improved enormously! Mar 4, 2015 at 8:50
2

Try adding -Dawt.useSystemAAFontSettings=lcd to bin/phpstorm.vmoptions

2
  • 1
    you may want to try also -Dswing.aatext=true and -Dawt.useSystemAAFontSettings=on Dec 29, 2011 at 17:38
  • 1
    These two options together make a noticeable difference for me. Could be better but is now tolerable.
    – ColinM
    Jan 26, 2013 at 4:15
0

Try Settings -> Editor -> Appearance -> Use anti-aliased font

2
  • Try disabling it, or use a different font. There are fonts which does not look correctly when anti-aliasing is turned on.
    – tamasd
    May 27, 2011 at 12:52
  • Thanks. I've tried it with different fonts with and without AA they all looks unpleasant. May 27, 2011 at 12:58
0

The best solution I've found is to use FontForge. FontForge it's a linux application which allows you to edit some font preferences. Just open ttf font within app. Press ctrl+a to select all chars. Then choose from menu Hints -> Clear Hints. Then Hints -> Clear Instructions. And last File -> Generate Fonts. Just save the new font as new or replace existing and try to use this font with PhpStorm. Looks not ideal but much better than before.

0

Also I've noticed that fonts on a dark background looks pretty good in Linux Dark background

0

Comparing NetBeans and PhpStorm side by side on my Debian-Squeeze box and I found NetBeans looked much better even when the same font and font-size was selected. The difference was that PhpStorm had bolded most of the code. After going through the editor configuration and getting rid of all the bolding the editor looks much better now.

0

Monospaced with anti-aliasing looks good to me for WebStorm.

1
  • 1
    "Looks good" it's pretty subjective fact :) A few screenshots would bring some clarity Aug 29, 2013 at 9:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.