3

I use both IntelliJ IDEA and Android Studio for development, and for the longest time I've been trying to figure out why the two programs, from the same company, and built on the same codebase, and using the exact same font settings (and same text anti-aliasing method) will render the text in the editor pane differently.

For example, with both programs set to use DejaVu Sans Mono, 12pt:

  • Android Studio:

    enter image description here

  • IntelliJ IDEA:

    enter image description here

You can clearly see the difference, the font is thinner and/or almost like it isn't anti-aliased in IntelliJ.

This has been driving me up the wall, as I find the text in IntelliJ much harder on the eyes.

Has anybody else experienced this before and know how to fix it?

  • I don't see the difference personally. Granted after decades of staring at a computer screen, my vision may be less than optimal... – Elder Geek Jan 26 '18 at 16:52
3

Well, I managed to figure out how to fix it, and it's definitely not what I would have expected.

Turns out that IntelliJ was using my system JDK (Oracle's JDK 8) while Android Studio, which is now bundled with a JDK, was using its bundled one (OpenJDK 8).

Simply telling IntelliJ to use Android Studio's bundled JDK instead of the system JDK fixed the issue. You can do that like so:

  1. Go Help --> Find Action

    enter image description here

  2. Search for "boot JDK"

    enter image description here

  3. Click the ... in the drop down menu

    enter image description here

  4. Point it to {AS install DIR}/jre

    enter image description here

  5. Tell IntelliJ it's OK to restart:

    enter image description here

  6. When it comes back up, the font will now be fixed!

  • Very useful answer - solved my issue with rendering. – axel22 Jul 31 at 11:42
0

1 - Edit <JetBrains product directory>/jre/jre/lib/fontsfont.conf

2 - Comment out all the <test> sections

Resulting file:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
  <match target="font">
<!--
    <test name="family" qual="all" compare="not_eq">
      <string>Consolas</string>
    </test>
    <test name="family" qual="all" compare="not_eq">
      <string>Noto Sans Mono CJK JP</string>
    </test>
    <test name="size" qual="any" compare="less">
      <double>12</double>
    </test>
    <test name="weight" compare="less">
      <const>medium</const>
    </test>
-->
    <edit mode="assign" name="hintstyle">
      <const>hintslight</const>
    </edit>
  </match>
</fontconfig>

3 - Restart Idea

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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