Ubuntu – Same font is rendered differently in IntelliJ IDEA vs. Android Studio


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?

Best Answer

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!