4

I'm trying to forward my IDE, Netbeans, over ssh to the Xming server on my Windows Desktop. I'm able to get Netbeans to launch and run, but the fonts look terrible because they aren't being anti-aliased. I've uploaded a screenshot here.

If I launch Netbeans from Gnome on the linux box itself, the fonts look fine, so it must be a problem with Xming or the Windows font rendering. Does anyone have any ideas about how to get Xming to display the fonts anti-aliased?

Update:

I just setup a font server on the host, but the fonts still appear pixelated on the client side.

jcnnghm
  • 7,426
  • 7
  • 32
  • 38

5 Answers5

7

I ended up setting some of the netbeans command line options in the launcher script to force anti aliasing and force subpixel font rendering. This fixed the issue.

Update: Added Steps

I set the netbeans_default_options under /etc/netbeans.conf to read:

netbeans\_default\_options="-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-XX:MaxPermSize=200m -J-Xverify:none -J-Dapple.laf.useScreenMenuBar=true -J-Dawt.useSystemAAFontSettings=lcd"
bear
  • 11,364
  • 26
  • 77
  • 129
jcnnghm
  • 7,426
  • 7
  • 32
  • 38
  • Might be beneficial for someone else running into this issue if you could share those command-line options. – cmptrgeekken Apr 13 '09 at 19:55
  • 1
    if I do this, I have a *severe* drop in performance. It becomes *impossible* to write any code. I tried only the `AAFontSettings`, and also you memory settings (assuming you had the same issue). But unfortunately it did not help. How is performance on your system? Everything here should be fine. The machines are fast, GB netwwork, so I don't know what's the bottleneck... :( – exhuma Apr 16 '12 at 12:57
  • I also have a severe performance drop... – Frederik Oct 11 '13 at 15:45
  • Ran into this myself recently. `awt.useSystemAAFontSettings` looks much better, but too slowly to be usable. The fix was to enable xrender. Add `-J-Dsun.java2d.xrender=true -J-Dawt.useSystemAAFontSettings=on` and the fonts should look nice without the huge performance drop. Source: http://docs.oracle.com/javase/7/docs/technotes/guides/2d/flags.html#xrender `on` is aliasing but no hinting. Adjust this to taste. The page I linked gives the available options. – Filipp Apr 21 '17 at 10:41
3

As stated in this blog, you can activate the option mentioned in the previous answer system-wide for all swing applications adding

_JAVA_OPTIONS="-Dawt.useSystemAAFontSettings=lcd"

to your profile.

Community
  • 1
  • 1
Alberto
  • 5,021
  • 4
  • 46
  • 69
3

Java is a bit weird on Linux as to how it decides whether to anti-alias or not.

It seems to detect if KDE or GNOME are running, and if not, decides not to bother.

If you want another solution, try making sure that "gnome-settings-daemon" is running before launching netbeans.

2

I use Mint Linux and the configuration below is ok here.

The correct form is this:

netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true -J-Dsun.zip.disableMemoryMapping=true --laf GTK"
Romeryto
  • 62
  • 3
1

Allow the Linux machine to be an X11 fontserver and tell your Xming session to use the Linux machine as an X11 font server.

Thorbjørn Ravn Andersen
  • 73,784
  • 33
  • 194
  • 347