1. Download and install Netbeans 6.7.1 on Mac OS X Snow Leopard with Java 1.6.0_15 (I believe this reproduces in Leopard as well).
2. Observe that fonts are blurry and hard to read.
3. Find the netbeans.conf file and add -J-Dapple.awt.graphics.UseQuartz=true to netbeans_default_options
4. Restart the IDE
5. Observe much better font rendering.
Without Quartz, the IDE is unusable due to poor font rendering which causes eye strain.
Netbeans IDE should use the better Quartz rendering on Mac OS X by default.
Can not reproduce on java 1.6.0_15. Fonts seem to be clear.
Can you please attach screenshots?
Created attachment 91640 [details]
Rendering of fonts with default settings
Notice that grayscale font smoothing is used. This is particularly noticeable on lower contrast fonts, e.g. gray comments or pink class names.
The next attachment will show font rendering of the same exact code fragment, but with Quartz enabled.
Created attachment 91641 [details]
Rendering of fonts with Quartz enabled
Notice how much crisper the fonts are with Quartz subpixel rendering. Still not as crisp as in Windows version, but much more pleasant to look at for extended periods of time.
All that needs to be done to get this rendering is -J-Dapple.awt.graphics.UseQuartz=true needs to be added to netbeans_options in netbeans.conf
You might also want to add -J-Dfile.encoding=UTF-8 there while you're at it, so that Netbeans would save text files in UTF8 (as opposed to MacRoman) by default. I could file a separate bug on that, if you'd like.
Thanks for the analysis! (and yes, please file a standalone issue for the utf encoding, to track these two separately)
I don't know much about Quartz rendering I admit, but based on the screenshots I agree it should be on by default if there are no possible side-effects.
Reassigning to editor (hope it's the correct component) for implementation ..
Integrated into 'main-golden', will be available in build *201005192201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
User: Vita Stejskal <firstname.lastname@example.org>
Log: #177249: adding -J-Dapple.awt.graphics.UseQuartz=true
The Quartz rendering is using the native rendering pipeline on Mac. This was the default in JDK5 on the Mac. In JDK6 (which is the only available JDK on Mac Snow Leopard), Apple changed the default and turned off Quartz and enabled the default JDK rendering pipeline.
What I -don't- know is WHY Apple turned off Quartz, but I do know that there are some associated memory leaks with it, and I believe that it used to cause problems for the UML support in NetBeans. Vita, maybe you should check with any graphics-teams (e.g. mobile editor, javafx team) to make sure they aren't affected by this change the way UML used to be.
I personally run with Quartz turned on, and have for a couple of years (since the default was changed). The text rendering is much better.
But what I -don't- understand is why, on Mac, the JDK rendering pipeline doesn't give proper LCD antialiasing! It -does- do that on all other platforms, so why it doesn't work on the Mac is not clear to me. The following article seems to indicate that it's because it needs a couple of different rendering hints set:
Vita, I know the editor sets some rendering hints etc during its painting. If we can adjust the flags such that the JDK rendering pipeline can be used instead of Quartz, I think that would be better; it would be the same codepath as on other platforms, and obviously Apple must have turned off Quartz for a reason. (The JavaFX release notes mention a number of leaks and other issues, but it's possible that NetBeans doesn't trigger these nearly as much as JavaFX since JavaFX is much heavier on using it for drawing all kinds of shapes, effects, etc.)
Actually, I hadn't read that article very carefully. It doesn't look like the rendering hints actually work on the Mac, just elsewhere. I don't know why subpixel rendering doesn't seem to work on the Mac with the sun pipeline since it works on other platforms...?
Tor, thanks a lot for all this info. I'll make some more investigation...
-J-Dorg.netbeans.modules.editor.settings.storage.fontscolors.CompositeFCS.level=FINE can be used to see what rendering hits are used by the editor. On my Mac KEY_TEXT_ANTIALIASING = VALUE_TEXT_ANTIALIAS_ON. This value is good for CRT, but on LCD one of the *_LCD_* constants should be used - most likely VALUE_TEXT_ANTIALIAS_LCD_HRGB.
The value is obtained from "awt.font.desktophints" desktop property, which is supplied by JDK. And so it looks like that JDK6 on Mac does not detect/set the desktop hints correctly.
http://hg.netbeans.org/jet-main/rev/0ee3981678ff - no fix, just logging
Regarding "And so it looks like that JDK6 on Mac does not detect/set the
desktop hints correctly.": I heard from an Apple VM engineer that LCD subpixel rendering is only implemented in the Quartz rendering engine, NOT in their alternative path. So no amount of fiddling with rendering hints will make this work, the only way to get LCD text is with Quartz on. But he also stated that Quartz is supported. (See comment from Mike at http://blogs.sun.com/tor/entry/lcd_sub_pixel_rendering#comments )
Thanks Tor. I think we are done then.
The isssue is still there in 6.9 which I have just downloaded and installed. The same parameter fixes it.
(In reply to comment #14)
> The isssue is still there in 6.9 which I have just downloaded and installed.
> The same parameter fixes it.
Umm, could you please check that your <nb69-inst>/etc/netbeans.conf contains -J-Dapple.awt.graphics.UseQuartz=true?
No, it did not. If I add it there by hand, the issue goes away.
Ah, now I understand. The issue is fixed in trunk, but not in release69 repository. The reason for that is that the fix was delivered after the clone had been created and the issue was not a showstopper for 6.9 release. (also see target-milestone == next) I'm marking this as 6.9.1_CANDIDATE so that the fix could be ported to release691 repository.
Could you please try downloading a recent dev build and confirm that the problem is really fixed there? Thanks a lot
Please verify bugfix for this bug, so it can be integrated into release691 repository.
Product Version: NetBeans IDE Dev (Build 201006230001)
main #4ecfb51a71fb ported to release691 #65c55daeb9fd
Verified in the following 6.9.1 build:
Product Version: NetBeans IDE 6.9.1 Dev (Build 201007062301)
Java: 1.6.0_20; Java HotSpot(TM) 64-Bit Server VM 16.3-b01-279
System: Mac OS X version 10.5.8 running on x86_64; MacRoman; en_US (nb)
The quartz (-Dapple.awt.graphics.UseQuartz=true) switch is now on by default - the switch is visible in the IDE log.