How to correctly configure fonts for OpenJDK apps in nixpkgs?

376 Views Asked by At

When I run IntelliJ inside of Docker using a nixpkgs environment, I see a lot of missing characters in the GUI: enter image description here

A possibly unrelated problem is that the act of selecting text (when selectable) seems to improve the situation - see the transition from the second to thirt image in the attached screenshots.

I have a relatively easy to reproduce example (assuming one has docker available). I haven't tested this on NixOS directly, but may have to try that next to rule out issues: my current setup is based on that of kurron/docker-intellij, which does NOT have this problem (both mine and his are ultimately based on the same Ubuntu 16.04 docker image), leading me to believe it is a problem either in the OpenJDK in nixpkgs, or some bad interaction between nixpkgs X/fonts and the Ubuntu base system used.

To reproduce, you can ignore the README for now, just do:

source build.sh
./idea.sh # This will start the container
idea-ultimate # this should be run inside the container

Note that idea.sh runs xhost + and performs some volume mounts, so please inspect before running if you are concerned.

Things that DO seem to work without font issues from the same container:

  • gedit (no java involved: nix-env -i gedit)
  • JDiskReport: (java involved - fonts work but don't look great, so probably a separate issue); download with wget, unzip with unzip, and run with java -jar ...

I assume IntelliJ is still based on Swing - but haven't seen any recent confirmation of this. If so, I could do more targeted testing.

0

There are 0 best solutions below