Way to configure Intellij to enable Fractional Metrics for rendering?

Hello, new user via Android Studio...

I'm struggling with the font rendering in Linux.  Enabling anti-aliasing helped a lot, but I really like the Dejavu Mono font with the rendering hint Fractional Metrics turned on.  Is there a way to enable that in an environment variable or config file somewhere?  Or via a plugin?

Thanks

5 comments

Hello,

There is no way to specify that at the moment.

Tried that locally by modifying IJ sources and didn't notice any difference. You can try that yourself at local environment by checking out [IJ sources|https://github.com/JetBrains/intellij-community] and modifying UISettings.setupAntialiasing()

Denis

0

Hmm... I don't know if it has to do with the default font rendering in Gnome or what, but it makes a lot of difference on mine.  See below... 1st with no AA, 2nd with AA, 3rd with AA and FM.  Is there a way to edit or compile one class and replace just that one?  Sorry, I'm new to Java...

Thanks

http://www.asevers.com/font-rendering.png

0

Well, you can download IJ sources or check out IJ project from github. After that you can modify UISettings.setupAntialiasing() by adding code like below to it:

g2d.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON);


After that you can compile the project and assemble all UISettings.*.class files into a jar named, say openapi.patched.jar and put it into $IJ_HOME/lib. Your changes should be picked up next time the ide is restarted then.

Denis
0

Thanks... I couldn't quite get that to work, though.  I guess the code in openapi.jar takes precedence?  I tried naming it openaph.jar... still no go.

However, I tried updating openapi.jar with the new class, and that worked for the installed IDEA, but not for Android Studio.  It aborted with a seemingly unrelated error message.  So I downloaded THAT source, made the change and compiled... it wouldn't run from IDEA, so I guess there's some dependency issues or something, but I was able to update the installed Android Studio's openapi.jar with the compiled UISettings.class, and it runs and renders the fonts like I wanted.  So, marking as answered... again, thanks a lot.

0

Hi Severs,

Ok, thanks for the update. I've created corresponding ticket to provide a configuration ability for instructing the ide to use fractional metrics (not sure why I don't see any effect at local environment though) - IDEA-108693.

Denis

0

Please sign in to leave a comment.