This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 216655

Summary: Font anti aliasing broken when using Java SE 7
Product: platform Reporter: ota <ota>
Component: JDK ProblemsAssignee: Antonin Nebuzelsky <anebuzelsky>
Status: REOPENED ---    
Severity: normal CC: airdrik, dcaoyuan, jeremyclarke, jiriprox, mmetelka, mmirilovic, mym, rabbitboy2007, tveimo
Priority: P2 Keywords: 8.1_WAIVER_APPROVED, JDK_SPECIFIC
Version: 8.0.2   
Hardware: Macintosh (x86)   
OS: Mac OS X   
Issue Type: DEFECT Exception Reporter:
Attachments: Using java SE 7
Using java SE 6
Eclipse Java 6
Eclipse Java 7
java version "1.6.0_43"
java version "1.7.0_21"
SwingSet demo rendering in JDK 1.7 and JDK 1.6
Broken Java 1.7 AA screenshot
7.4 (java 1.8) vs 7.3.1 (java 1.6) - Netbeans 7.4 Product Version: NetBeans IDE 7.4 (Build 201310111528) Java: 1.8.0-ea; Java HotSpot(TM) 64-Bit Server VM 25.0-b45 Runtime: Java(TM) SE Runtime Environment 1.8.0-ea-b103 - Netbeans 7.3 Product Ver
Font comparison of Netbeans 7.3 + Java 1.6 against 7.4 + Java 1.7 on LInux
-J-Dorg.netbeans.editor.aa.fractional=true
NB 7.3.1/Java 1.6, NB 7.4/1.7, NB DEV/1.8 with aa.fractional
NB 7.3.1 with JDK1.6 and UseQuartz=false|true
NB 7.3.1/Java 1.6 useQuartz true|false
NB 7.4-nightly w jdk1.7.0_05 vs jdk1.6.0 with UseQuartz=true
NB 7.4 w JDK 1.7.0_25
openjdk 9 nightly with subpixel antialiasing support patches applied (on retina screen), swing test app
openjdk 9 nightly, subpixel antialiasing on retina, javaFX html editor; Looks very promising!
nb 8 dev 20150520 on openjdk 9 patched with subpixel rendering support
Comparison of JDK8 vs. tveimo's subpixel build vs. Excel for Mac 2011
Comparison contract set to 250 (left) and 140 (right)

Description ota 2012-08-10 10:46:33 UTC
Created attachment 122985 [details]
Using java SE 7

Hey i recently updated to java 1.7 and the font anti aliasing seems to be broken, again. 

There is an old issue http://netbeans.org/bugzilla/show_bug.cgi?id=194676 that includes various configuration recommendations, but none of them help anymore.

For a better compersion i included
Comment 1 ota 2012-08-10 10:47:22 UTC
Created attachment 122986 [details]
Using java SE 6
Comment 2 ota 2012-08-10 10:49:01 UTC
Submitted to early :)!

Included are two screenshots for better comparison.
Comment 3 Petr Somol 2012-08-10 11:36:57 UTC
I took a close look at the screenshots and my conclusion is as follows. This is not a case of antialiasing actually broken, it is a case of slight difference in rendering. The attachment broken.png clearly shows that characters are antialiased. Though I agree they look different in 1.7 from those in 1.6, where they are clearly more legible.

But the difference between 1.7 and 1.6 is completely outside NetBeans code. The past problems NetBeans had with antialiasing, afaik, were related to disabled antialiasing where it should have been enabled or so, what is not the case here.

I attribute the difference in the two attachments to the fact that they have been produced by different vendors - there is no unambiguous definition of how an antialised text should be actually rendered or postprocessed - I suspect that in your 1.6 the JDK detects the fact that bright characters are rendered on dark background and increases slightly the contrast and character weight (in typography it is known that the same white letters on black background are perceived by human eye as thinner that the same in black on white background) while 1.7 either does not do it or does it differently.

I am closing it here as JDK issue unrelated to NetBeans.
Comment 4 ota 2012-09-14 14:36:30 UTC
Hey thanks for the response - after investigating further i am unable to find any issues with the 1.7 jdk regarding the font rendering. The problem also does not occur in eclipse or any other java apps. Are you sure this is not netbeans related?
Comment 5 Petr Somol 2012-09-17 08:29:22 UTC
(In reply to comment #4)
> Hey thanks for the response - after investigating further i am unable to find
> any issues with the 1.7 jdk regarding the font rendering. The problem also does
> not occur in eclipse or any other java apps. Are you sure this is not netbeans
> related?

Would you please attach a screenshot comparing the NB and Eclipse rendered fonts on your 1.7 JDK ?
Comment 6 ota 2012-10-01 12:55:06 UTC
Please see the two attached files i added when opening this issue for the difference.
Comment 7 Petr Somol 2012-10-08 14:13:41 UTC
(In reply to comment #6)
> Please see the two attached files i added when opening this issue for the
> difference.

If I understand it right the two original attachments show font rendering of JDK6 and JDK7, both in NetBeans. It would be good to show the same (both JDK6 and JDK7) comparison on Eclipse..
Comment 8 ota 2012-10-12 08:04:42 UTC
Created attachment 125831 [details]
Eclipse Java 6
Comment 9 ota 2012-10-12 08:05:03 UTC
Created attachment 125832 [details]
Eclipse Java 7
Comment 10 ota 2012-10-12 08:05:56 UTC
(In reply to comment #7)
> (In reply to comment #6)
> > Please see the two attached files i added when opening this issue for the
> > difference.
> 
> If I understand it right the two original attachments show font rendering of
> JDK6 and JDK7, both in NetBeans. It would be good to show the same (both JDK6
> and JDK7) comparison on Eclipse..

Ah i see! I attached two new screenshots which compare the eclipse font rendering. Hope it helps.
Comment 11 snagnever 2013-02-13 05:16:54 UTC
any solution, so far?
i have the same problem
Comment 12 larsomat 2013-04-17 09:52:20 UTC
I just installed the nightly of Netbeans. I had to install the Java 7 from Oracle before I could do that. And now I have the same problem. Ugly!
Comment 13 larsomat 2013-04-18 10:51:59 UTC
Created attachment 133559 [details]
java version "1.6.0_43"
Comment 14 larsomat 2013-04-18 10:52:47 UTC
Created attachment 133560 [details]
java version "1.7.0_21"
Comment 15 larsomat 2013-04-18 10:54:06 UTC
I added some screenshots with Netbeans 7.3. Same font settings in both, the only difference is the Java version.
Comment 16 Petr Somol 2013-04-18 10:56:10 UTC
Standa, you might know more than me about how JDK version affects our font rendering, would you please evaluate this ?
Comment 17 Stanislav Aubrecht 2013-04-18 11:27:37 UTC
Looks like a JDK issue. Please run some plain Swing app, e.g. Anagrams game from NetBeans samples and compare how it looks like when running with JDK 1.6 and JDK 1.7
Comment 18 Stanislav Aubrecht 2013-06-13 09:00:16 UTC
Created attachment 135741 [details]
SwingSet demo rendering in JDK 1.7 and JDK 1.6
Comment 19 Stanislav Aubrecht 2013-06-13 09:01:27 UTC
HTML rendering did change in JDK 1.7, see the attached screen shot showing SwingSet demo running under JDK 1.7 update 21 and JDK 1.6 update 45.
It seems that JDK 1.7 uses also different default fonts.
Comment 20 erusev 2013-08-22 10:11:34 UTC
I'm not sure it is correct to say this is a JDK issue as the fonts of other IDEs (such as PHPStorm) running the same JDK don't seem to have the same issue.
Comment 21 larsomat 2013-08-23 08:35:53 UTC
For me personally, this is a "blocker".

I don't use nightly builds anymore since the change and won't update Netbeans until this issue has been adressed.
Comment 22 erusev 2013-08-23 12:42:59 UTC
I feel the same way as larsomat. I would also not update Netbeans until this issue has been addressed.
Comment 23 mym 2013-10-02 22:05:30 UTC
I had to manually set netbeans_jdkhome to use 1.6 as this is definitely a blocker. Many plugins refuse to work with 1.6 though...
Comment 24 erusev 2013-10-14 16:51:23 UTC
Is it realistic to expect any progress on this? It is a major issue.
Comment 25 larsomat 2013-10-14 16:58:01 UTC
I'd like to know this, too. I stopped using nightly builds as I stated before. And therefore I stopped submitting any bug reports on them. This issue needs to be addressed before I even think of going back to nightly builds.

I'm pretty sure it's the same for many developers on OSX who are not commenting here. That's a major loss for Netbeans development (on OSX)...
Comment 26 snagnever 2013-10-15 19:51:42 UTC
Created attachment 141113 [details]
Broken Java 1.7 AA screenshot
Comment 27 snagnever 2013-10-15 19:56:01 UTC
It IS a major problem for developers on Mac OS.
I will stick to NB 7.3.1 until it is fixed, it's impossible to use the ide with this broken AA

http://d.pr/i/UqCE
Comment 28 erusev 2013-10-16 09:35:35 UTC
Here are 2 more screenshots:

NetBeans 7.3.1: http://d.pr/i/t2xm
NetBeans 7.4: http://d.pr/i/3b8T
Comment 29 tveimo 2013-10-17 12:21:21 UTC
It seems it's possible to bring back subpixel font antialiasing in jdk 1.7 on OSX by using fractional metrics. Would it be possible to get a netbeans build with fractional metrics enabled for the editor component, to see if that fixes the issues people have with the font rendering in jdk 1.7 on OSX?

See https://bugs.openjdk.java.net/browse/JDK-8023794, there's an example font program where one can add fractional metrics to the source, to see the results.
Comment 30 pemedina 2013-10-17 12:22:36 UTC
Same issue here

7.4   / java version "1.7.0_40" Bad.
7.3.1 / java version "1.6.0_65" Ok.

Running Mac OS X 10.7.5
Comment 31 friimaind 2013-10-17 14:03:00 UTC
Same problem here.

About my system:
- Mac 10.7.5
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)

Netbeans 7.3.1 looks fine
Netbeans 7.4 looks broken
Screenshot comparison: http://imgur.com/SQcdaFv

Any news? It's impossible to work with 7.4 :(
Comment 32 tveimo 2013-10-18 13:55:58 UTC
Looks like all the netbeans font rendering code during setup checks the awt.font.desktophints property, which if present is added to the rendering hints, eg from SceneComponent.java; 

Graphics2D gr = (Graphics2D) g;

Object props = Toolkit.getDefaultToolkit ().getDesktopProperty ("awt.font.desktophints"); // NOI18N
if (props instanceof Map)
  gr.addRenderingHints ((Map) props);
gr.setRenderingHint (RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
gr.setRenderingHint (RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);

But it's not possible to configure a map property value outside Java code.
Comment 33 tveimo 2013-10-18 14:09:08 UTC
Would it be possible to create a netbeans module that calls

Map desktopHints = new HashMap();
desktopHints.put(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON);
Toolkit.setDesktopProperties("awt.font.desktophints", desktopHints);

before the rest of netbeans is initialized?
Comment 34 evacchi 2013-10-19 20:11:29 UTC
I've tried to create a module like the one suggested in Comment #33

I don't think it is working, but I encourage people to clone/fork to try the code.

https://github.com/evacchi/netbeans-fractionalmetrics-fix
Comment 35 friimaind 2013-10-21 09:36:10 UTC
Created attachment 141337 [details]
7.4 (java 1.8) vs 7.3.1 (java 1.6)

- Netbeans 7.4
Product Version: NetBeans IDE 7.4 (Build 201310111528)
Java: 1.8.0-ea; Java HotSpot(TM) 64-Bit Server VM 25.0-b45
Runtime: Java(TM) SE Runtime Environment 1.8.0-ea-b103

- Netbeans 7.3
Product Ver

java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)
Comment 36 tveimo 2013-10-21 12:08:11 UTC
You might rather want to look at

org.netbeans.modules.editor.settings.storage.fontscolors.CompositeFCS.java

in the editor.settings.storage module. It's where the renderingHints are defined for the editor. If you build netbeans locally, you can experiment with the hints defined there. Eg try the -J-Dorg.netbeans.editor.aa.extra.hints=true parameter. While it turns on fractional metrics, it doesn't specify LCD_HRGB for text antialiasing, which is required for subpixel antialiasing on OSX.

However, I've tried to add this hint, but there's still no subpixel font rendering, so there must be some other setting somewhere that is preventing it, maybe something like the bit depth of the buffer the editor renders into.

Eg try running the AntialiasDemo.java program defined in the bugreport here;

https://bugs.openjdk.java.net/secure/attachment/15546/AntialiasDemo.java

on a mac with jdk1.7+ to see which hints are required to produce subpixel font rendering.
Comment 37 airdrik 2013-10-21 15:05:27 UTC
Created attachment 141356 [details]
Font comparison of Netbeans 7.3 + Java 1.6 against 7.4 + Java 1.7 on LInux

Piping in to mention that this is not an OSX-specific bug.  I'm seeing it on linux (ubuntu 12.04, 64-bit) as well.
Screenshot comparing Netbeans 7.3 on Java 1.6 with Netbeans 7.4 on Java 1.7, using Ubuntu font.

font options used: -J-Dswing.aatext=true -J-Dawt.useSystemAAFontSettings=lcd

After a some more investigation, most fonts render identically between 7.3 and 7.4 (Ubuntu is one of the few that I'd tried that .  My preferred font (Avdira) also doesn't render properly in 7.4 (appears similarly over-bold), but it is excluded from selection entirely in 7.3 so I can't provide that comparison.  I could provide a comparison of Avdira between NB 7.4 and other native apps (kwrite, spyder) if that is worthwhile.
Comment 38 friimaind 2013-10-21 15:24:23 UTC
Comment on attachment 141337 [details]
7.4 (java 1.8) vs 7.3.1 (java 1.6)

- Netbeans 7.4
Product Version: NetBeans IDE 7.4 (Build 201310111528)
Java: 1.8.0-ea; Java HotSpot(TM) 64-Bit Server VM 25.0-b45
Runtime: Java(TM) SE Runtime Environment 1.8.0-ea-b103

- Netbeans 7.3
Product Ver

Edit, my fault:

- Netbeans 7.4
Product Version: NetBeans IDE 7.4 (Build 201310111528)
Java: 1.8.0-ea; Java HotSpot(TM) 64-Bit Server VM 25.0-b45
Runtime: Java(TM) SE Runtime Environment 1.8.0-ea-b103

- Netbeans 7.3
Product Version: NetBeans IDE 7.3.1 (Build 201306052037)
Java: 1.6.0_65; Java HotSpot(TM) 64-Bit Server VM 20.65-b04-462
Runtime: Java(TM) SE Runtime Environment 1.6.0_65-b14-462-11M4609
Comment 39 evacchi 2013-10-22 12:58:35 UTC
the code that I have put on GitHub does effect rendering if you select VALUE_TEXT_ANTIALIAS_LCD_HRGB and VALUE_FRACTIONALMETRICS_ON but the result is ugly. I don't see any improvements in the other cases. This is certainly a JDK bug, but I would like to find a workaround for Netbeans
Comment 40 jeremyclarke 2013-11-04 22:00:58 UTC
+1 for this being a horrible problem. I can barely look at my code with this change. As stated in other comments it seems to disproportionately affect dark-background color schemes, but to my eyes it's a problem no matter what. 

This is going to be the thing that forces me to try PHPStorm :(
Comment 41 pemedina 2013-11-05 12:07:16 UTC
So i am wondering how are you people dealing with this issue?
In my case, i was forced to stay with 7.3.

Should we expect a fix for this?
Comment 42 LuCiAn0 2013-11-06 15:19:15 UTC
I had to stay with 7.3. I don't think this problem is going to get fixed any soon. I'm currently looking for a new IDE.
Comment 43 tveimo 2013-11-07 11:13:36 UTC
The problem is twofold; subpixel antialiasing is not working, and if it was, the font rendering in the jdk is sub-par compared to the one provided by apples own JDK (which I presume use OSX native font rendering). So if you solved the subpixel antialiasing issue, it would render like intellij renders on OSX with JDK 7/8.

But it wouldn't give the same font rendering as netbeans 7.3 on apples JDK.

If you get a retina display, the problem mostly goes away, since even grayscale antialiasing produces visually decent results, when the JDK gets to work with the native resolution (with JDK 8 and JDK 7u40 upwards), although scrolling performance is degraded (See https://netbeans.org/bugzilla/show_bug.cgi?id=237724).
Comment 44 Miloslav Metelka 2013-11-11 14:44:40 UTC
(In reply to tveimo from comment #36)
> You might rather want to look at
> 
> org.netbeans.modules.editor.settings.storage.fontscolors.CompositeFCS.java
> 
> in the editor.settings.storage module.

IMHO the CompositeFCS.getRenderingHints() is rather complex and instead we should just add the desktop hints to existing hints in the Graphics.
Possibly we can allow for some extra hints such as fractional metrics (but individually not like org.netbeans.editor.aa.extra.hints which adds a set of additional properties at once).
I've made a fix to view hierarchy (in jet-main repository) which does that and a possibility to run the IDE with

-J-Dorg.netbeans.editor.aa.fractional=true

to set the fractional metrics hint whether makes any improvement or not to the rendering.

The fix also allows to see the a complete set of hints by using

-J-Dorg.netbeans.editor.view.settings.level=FINE

there should be an output like this:

DocumentView.updateFontColorSettings() Antialiasing Rendering Hints:
    Graphics: {Text-specific antialiasing enable key=Default antialiasing text mode, Text-specific LCD contrast key=140, Fractional metrics enable key=Integer text metrics mode, Stroke normalization control key=Default stroke normalization, Global antialiasing enable key=Nonantialiased rendering mode, Global rendering quality key=Default rendering methods}
    Desktop Hints: {Text-specific antialiasing enable key=LCD HRGB antialiasing text mode}
    Extra Hints: null

where "Graphics:" means output of Graphics.getRenderingHints() before adding additional hints by NetBeans.
"Extra hints" would be set if the "org.netbeans.editor.aa.fractional" would be set to true.
I can add additional properties if there would be any demand for them.

http://hg.netbeans.org/jet-main/rev/f2ba621880bf
Comment 45 Quality Engineering 2013-11-13 03:07:04 UTC
Integrated into 'main-silver', will be available in build *201311130002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/f2ba621880bf
User: Miloslav Metelka <mmetelka@netbeans.org>
Log: #216655 - Font anti aliasing broken when using Java SE 7.
Comment 46 Jiri Prox 2013-11-13 06:24:45 UTC
Can someone try the new switch, please?

You can provide switch on command line when starting netbeans or you can add it to property netbeans_default_options in the netbeans.conf (located in {install_dir}/etc)

Thanks
Comment 47 friimaind 2013-11-13 09:30:07 UTC
I've installed build 201311130002 and tested the new boot option.
Maybe I missed something but I do not see any difference:

Screenshot: http://i.imgur.com/bgBAAqH.png

I've edited the netbeans.conf like that:

netbeans_default_options="-J-Dorg.netbeans.editor.aa.fractional=true -J-client etc.."
Comment 48 friimaind 2013-11-13 09:31:19 UTC
Created attachment 142118 [details]
-J-Dorg.netbeans.editor.aa.fractional=true
Comment 49 pemedina 2013-11-13 13:35:46 UTC
No luck on my side.

Added " -J-Dorg.netbeans.editor.aa.fractional=true -J-Dorg.netbeans.editor.view.settings.level=FINE" to netbeans.conf and i can see


DocumentView.updateFontColorSettings() Antialiasing Rendering Hints:
    Graphics: {Fractional metrics enable key=Integer text metrics mode, Text-specific antialiasing enable key=Default antialiasing text mode, Stroke normalization control key=Default stroke normalization, Text-specific LCD contrast key=140, Global antialiasing enable key=Nonantialiased rendering mode, Global rendering quality key=Default rendering methods}
    Desktop Hints: {Text-specific antialiasing enable key=Antialiased text mode, Global antialiasing enable key=Antialiased rendering mode}
    Extra Hints: {Fractional metrics enable key=Fractional text metrics mode}

in ide log.

But nothing as changed on font rendering.
Comment 50 drillingman 2013-11-13 20:05:07 UTC
Created attachment 142154 [details]
NB 7.3.1/Java 1.6, NB 7.4/1.7, NB DEV/1.8 with aa.fractional

I was testing with different Netbeans versions and Java versions and the switch 
"-J-Dorg.netbeans.editor.aa.fractional=true -J-Dorg.netbeans.editor.view.settings.level=FINE". 
It seems that there is no difference between Java 1.7 and 1.8 or using the switch or not while NB 7.3.1 with Java 1.6 renders font much better.

IDE log:
DocumentView.updateFontColorSettings() Antialiasing Rendering Hints:
    Graphics: {Fractional metrics enable key=Integer text metrics mode, Text-specific LCD contrast key=140, Global rendering quality key=Default rendering methods, Global antialiasing enable key=Nonantialiased rendering mode, Stroke normalization control key=Default stroke normalization, Text-specific antialiasing enable key=Default antialiasing text mode}
    Desktop Hints: {Global antialiasing enable key=Antialiased rendering mode, Text-specific antialiasing enable key=Antialiased text mode}
    Extra Hints: {Fractional metrics enable key=Fractional text metrics mode}
updateCharMetrics(): FontRenderContext: AA=true, AATransformed=false, AAFractMetrics=true, AAHint=Antialiased text mode

I use OSX 10.9
Comment 51 tveimo 2013-11-18 14:27:10 UTC
Are the netbeans devs able to get any feedback from the jdk team about this issue?
Comment 52 Miloslav Metelka 2013-11-19 14:08:38 UTC
I've added some more AA command line parameters support described at
http://wiki.netbeans.org/EditorAntialiasing

http://hg.netbeans.org/jet-main/rev/eada3c10e3d9
Comment 53 Miloslav Metelka 2013-11-19 15:28:52 UTC
So IIUC the font rendering changed between Java 6 and Java 7 on Mac OSX (the native font rendering possibly changed to java's own font rendering) and so we can't resolve the problem in NB. Could anyone please check if the issue occurs when running NB 7.3.1 on both Java 6 and Java 7 (please check that you have one of the latest Java 7 versions when doing the comparison)? You can force the JDK by using --jdkhome command line parameter when running NB (possibly see http://wiki.netbeans.org/FaqStartupParameters for help). Thanks.
Comment 54 drillingman 2013-11-19 19:21:04 UTC
Using NB 7.3.1 with Java 1.7 is exactly the same rendering result as in NB 7.4 with Java 1.7 on  OS X (see my screenshot above, no difference to NB 7.4/1.7). 

So I am forced to use 7.3.1 with Java 1.6.

I will try your new switches later.
Comment 55 tveimo 2013-11-20 11:45:56 UTC
Regarding http://wiki.netbeans.org/EditorAntialiasing:

RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB is mentioned twice, assume one of them should be _VRGB. Is this reflected in the java code?

Regarding the actual setting options, somehow they still don't work. I can't even turn off antialiasing for text using .aa.text=off

Running with the command line options 

netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-Dnetbeans.logger.console=true -J-ea -J-Dapple.laf.useScreenMenuBar=true -J-Dplugin.manager.check.updates=false -J-Dorg.netbeans.editor.aa.fractional=false -J-Dorg.netbeans.editor.view.settings.level=FINE -J-Dorg.netbeans.editor.aa=off -J-Dorg.netbeans.editor.aa.text=off"

doesn't provide non-antialiased text. So it appears there must be something somewhere else that overrides the swing 2D settings. Does the 'Desktop Hints' setting override the 'Graphics' setting? If it does, there's no wonder that it's not possible to turn off antialiasing, or turn on subpixel antialiasing.

This is with MacOS 10.9, jdk 1.8.0_111, netbeans dev 201311200002, producing the following debug output; 

DocumentView.updateFontColorSettings() Antialiasing Rendering Hints:
    Graphics: {Global rendering quality key=Default rendering methods, Stroke normalization control key=Default stroke normalization, Text-specific antialiasing enable key=Default antialiasing text mode, Fractional metrics enable key=Integer text metrics mode, Text-specific LCD contrast key=140, Global antialiasing enable key=Nonantialiased rendering mode}
    Desktop Hints: {Text-specific antialiasing enable key=Antialiased text mode, Global antialiasing enable key=Antialiased rendering mode}
    Extra Hints: null
Comment 56 tveimo 2013-11-20 11:48:07 UTC
Additionally, according to http://stackoverflow.com/questions/1910964/how-can-i-inherit-the-systems-anti-alias-setting-for-painting-text-to-off-scree,

"the subpixel AA hints appear to only be respected when painting directly to the AWT graphics context; when I paint to a double-buffer image it just does standard AA; but when I bypass the double-buffer image the subpixel AA is done."

So there might be some issues with netbeans use of double buffering and antialiased text. Is it possible to turn off double buffering to test this?
Comment 57 Miloslav Metelka 2013-11-21 09:56:03 UTC
(In reply to tveimo from comment #56)
> Additionally, according to
> http://stackoverflow.com/questions/1910964/how-can-i-inherit-the-systems-
> anti-alias-setting-for-painting-text-to-off-scree,
> 
> "the subpixel AA hints appear to only be respected when painting directly to
> the AWT graphics context; when I paint to a double-buffer image it just does
> standard AA; but when I bypass the double-buffer image the subpixel AA is
> done."
> 
I'll add a switch for RepaintManager.setDoubleBufferingEnabled().
Since "Extra Hints: null" it looks that the last commit is no in main-silver yet (it's only in jet-main so you would have to checkout and build jet-main). I'll add a switch and build a .jar for you.

Thanks for RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB - I've fixed that in the documentation; the changeset is fine.
Comment 58 tveimo 2013-11-23 09:53:51 UTC
Ok running on jet-main, I am actually able to turn off antialiasing completely. No subpixel rendering yet though. Did you get to implement the double buffer toggle?

Running with:

netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-Dnetbeans.logger.console=true -J-ea -J-Dapple.laf.useScreenMenuBar=true -J-Dsun.java2d.dpiaware=true -J-Dsun.zip.disableMemoryMapping=true -J-Dplugin.manager.check.updates=false -J-Dnetbeans.extbrowser.manual_chrome_plugin_install=yes -J-Dorg.netbeans.editor.aa.fractional=true -J-Do
rg.netbeans.editor.view.settings.level=FINE -J-Dorg.netbeans.editor.aa=on -J-Dorg.netbeans.editor.aa.text=hrgb

Gives this output

DocumentView.updateFontColorSettings() Antialiasing Rendering Hints:
    Graphics: {Text-specific antialiasing enable key=Default antialiasing text mode, Stroke normalization control key=Default stroke normalization, Global antialiasing enable key=Nonantialiased rendering mode, Global rendering quality key=Default rendering methods, Text-specific LCD contrast key=140, Fractional metrics enable key=Integer text metrics mode}
    Desktop Hints: {Text-specific antialiasing enable key=Antialiased text mode, Global antialiasing enable key=Antialiased rendering mode}
    Extra Hints: {Text-specific antialiasing enable key=LCD VRGB antialiasing text mode, Global antialiasing enable key=Antialiased rendering mode, Fractional metrics enable key=Fractional text metrics mode}
updateCharMetrics(): FontRenderContext: AA=true, AATransformed=false, AAFractMetrics=true, AAHint=LCD VRGB antialiasing text mode
Comment 59 tveimo 2013-11-23 11:47:26 UTC
Tried with -J-Dorg.netbeans.editor.double.buffered=false with no difference; still no subpixel antialiasing.
Comment 60 Miloslav Metelka 2013-11-25 12:38:14 UTC
The JComponent.setDoubleBuffered() is not honored even when called up in all parent components (sharing the same buffer).
 So the only way seems to be RepaintManager.setDoubleBuffered() which affects the whole app since RepaintManager.currentManager(Component) uses a shared instance.
 tveimo please try jet-main with the following changeset:
http://hg.netbeans.org/jet-main/rev/885e54ab9159
Comment 61 larsomat 2013-11-25 19:18:58 UTC
It seems to be a Java related problem. Netbeans and Java belong to the same company (Oracle). There should be a way to tackle this problem from the source... shouldn't it?
Comment 62 tveimo 2013-11-26 05:45:56 UTC
I can definitely see that double buffering gets turned off with that latest change. But still no subpixel rendering though. 

arsomat@netbeans.org is right in that it would be an idea to get a comment from the JDK guys as to under what circumstances the font renderer changes from subpixel to normal antialiasing.
Comment 63 Miloslav Metelka 2013-11-27 09:28:58 UTC
> I can definitely see that double buffering gets turned off with that latest
> change. But still no subpixel rendering though. 
I was asked if you could run NB 7.3.1 on 1.6 once with

-J-Dapple.awt.graphics.UseQuartz=true

and once with

-J-Dapple.awt.graphics.UseQuartz=false

Please attach the results to this issue. Thanks in advance.


> 
> arsomat@netbeans.org is right in that it would be an idea to get a comment
> from the JDK guys as to under what circumstances the font renderer changes
> from subpixel to normal antialiasing.

Yes, I've contacted AWT developers and they said that it looks like greyscale vs LCD problem (the subpixel rendering is missing).
 JDK7 still uses Apple's font rasterizer. Apple has maintained development of JDK6 and they used a lot of private Apple's APIs regarding font rendering. This was no longer possible for OpenJDK7 so Apple has contributed a modified port of that code. There used to be some greyscale vs LCD related problems in that contributed code.
Comment 64 tveimo 2013-11-27 14:54:53 UTC
Created attachment 142644 [details]
NB 7.3.1 with JDK1.6 and UseQuartz=false|true

Attached NB 7.3.1 with jdk 1.6 and UseQuartz=true|false. This is with "Merlo 12" as text-editor font.
Comment 65 drillingman 2013-11-27 19:35:22 UTC
Created attachment 142654 [details]
NB 7.3.1/Java 1.6 useQuartz true|false

I added a screenshot too with a dark background. It shows more clearly that the behaviour of this switch is the difference between good font rendering and the problematic NB 7.3 or 7.4 with Java 1.7.
Comment 66 dhatadi 2013-11-28 01:27:55 UTC
Using this version of Java seems to fix the problem, at least on Linux (CentOS release 5.6):

java version "1.7.0_05"
Java(TM) SE Runtime Environment (build 1.7.0_05-b06)
Comment 67 tveimo 2013-11-28 10:46:25 UTC
Indeed it looks like 1.7.0_05 does render with subpixel antialiasing when fractional metrics are enabled. Font rendering is definitely subpar jdk1.6 using quartz though.
Comment 68 tveimo 2013-11-28 10:48:11 UTC
Created attachment 142668 [details]
NB 7.4-nightly w jdk1.7.0_05 vs jdk1.6.0 with UseQuartz=true
Comment 69 tveimo 2013-11-29 13:14:36 UTC
Tested working with jdk1.7.0_25, but not with jdk1.7.0_40, so something happened between those jdk releases.
Comment 70 tveimo 2013-12-05 12:40:47 UTC
I guess this bug can be closed, there's now sufficient support in netbeans to configure fonts, it's now really a JDK issue. 

According to this; https://bugs.openjdk.java.net/browse/JDK-8023794 a fix doesn't seem to be planned until JDK 9.
Comment 71 larsomat 2013-12-05 12:53:28 UTC
I think it should stay open until it's fixed in the JDK, even if the Netbeans team can't do anything about it, because this is a serious issue.

But I don't know how you generally handle those kinds of bugs here.
Comment 72 Miloslav Metelka 2013-12-05 14:38:59 UTC
I agree with tveimo to close this issue. This is a JDK problem that we cannot fix on NB side. The problem is covered by the existing issue https://bugs.openjdk.java.net/browse/JDK-8023794

I have transplanted all changesets of this issue (extra anti-aliasing command-line options) into release74 so that they will be part of 7.4 patch2:
f2ba621880bf transplanted to 00929006425e
eada3c10e3d9 transplanted to 3f8effd41707
1bcafecfb1f4 transplanted to d32741c7b1aa
885e54ab9159 transplanted to 5a43dad65cdf

Reassigning to platform/JDK problems.
Comment 73 Quality Engineering 2013-12-06 01:02:07 UTC
Integrated into 'releases/release74', will be available in build *201312052201* or newer. Wait for official and publicly available build.

Changeset: http://hg.netbeans.org/releases/rev/00929006425e
User: Miloslav Metelka <mmetelka@netbeans.org>
Log: #216655 - Font anti aliasing broken when using Java SE 7.
(transplanted from f2ba621880bf20b423ed9f4be4fa6f8ffe4044b7)
Comment 74 tveimo 2013-12-06 10:11:10 UTC
Any chance some pressure could be put on the JDK guys to prioritize font rendering for JDK 8? 

Also, it doesn't seem possible to vote for or comment on the OpenJDK bugs.
Comment 75 krur 2013-12-09 09:23:19 UTC
(In reply to Quality Engineering from comment #73)
> Integrated into 'releases/release74', will be available in build
> *201312052201* or newer. Wait for official and publicly available build.

i just tried latest nightly build.. but no improvements
Comment 76 tveimo 2013-12-09 10:42:31 UTC
If you'd read through the comments, you'd notice it only works for jdk 1.7.0 u25 or earlier, and then it doesn't render properly, due to a bug in the JDK that require fractional metrics to be enabled for subpixel font rendering. 

Thus, it's a JDK bug and needs a JDK fix.
Comment 77 Miloslav Metelka 2013-12-16 10:04:24 UTC
tveimo does https://bugs.openjdk.java.net/browse/JDK-8023794 cover the problem (my assumption) or not?

Just to clarify I assume that it does not help if you'd force an extra RenderingHints.VALUE_FRACTIONALMETRICS_ON by using

-J-Dorg.netbeans.editor.aa.fractional=true

on >1.7.0u25 or does it?
Comment 78 tveimo 2013-12-16 13:49:33 UTC
No it doesn't help.
Comment 79 tveimo 2014-01-06 06:11:40 UTC
mmetelka, sorry didn't see the first part of the question:

Bug https://bugs.openjdk.java.net/browse/JDK-8023794 only describes part of the problem, ie. whenever subpixel rendering is enabled on jdk1.7.0_25 or earlier, the font rendering is not acceptable. 

See left side of the picture here; https://bugzilla-attachments-216655.netbeans.org/bugzilla/attachment.cgi?id=142668

Fractional metrics makes subpixel rendering unusable on OSX. 


On jdk1.7.0_40 and later, subpixel rendering is not enabled simply by turning on fractional metrics, thus a separate jdk bug is required to describe this. Unfortunately, I don't have access to the jdk bug system. 

I've only seen this with netbeans, simple font rendering demo apps doesn't trigger it.

If you can get comments from the JDK guys on this issue, they can probably easily find out where things regressed between _25 and _40.
Comment 80 augf87 2014-01-09 04:36:23 UTC
Created attachment 143732 [details]
NB 7.4 w JDK 1.7.0_25

Running under Linux (Mint 16) I tried many JVM combinations (1.7.0_45, 1.7.0_25, 1.6.0_45) with NB 7.3.1 and 7.4. Still can't get antialiasing to get enabled in any way, the same look as the first time started remains.

I have already added in netbeans_default_options "-J-Dswing.aatext=true -J-Dawt.useSystemAAFontSettings=lcd -J-Dorg.netbeans.editor.aa.fractional=true".
Comment 81 tveimo 2014-01-27 15:08:48 UTC
Try using the parameters

-J-Dorg.netbeans.editor.aa.fractional=true -J-Dorg.netbeans.editor.view.settings.level=FINE -J-Dorg.netbeans.editor.aa.text=hrgb
Comment 82 tveimo 2014-01-27 15:20:02 UTC
augf87, your attachment shows fonts rendered using subpixel antialiasing. Did I misunderstand your question?
Comment 83 Jackie_Rosen 2014-02-16 11:24:31 UTC
SPAM - Removed by Administrator
Comment 84 larsomat 2014-04-25 13:22:32 UTC
I just heard that this problem is fixed since Netbeans 8. Can anyone here confirm this?
Comment 85 eternoendless 2014-04-25 14:43:22 UTC
@larsomat: It's still there

Running Netbeans 8, Java 1.8, OS X 10.9.2
Comment 86 pemedina 2014-04-25 15:10:32 UTC
yes ,still there. Nothing has changed.
Using Netbeans 8, java version "1.8.0-ea"

(In reply to eternoendless from comment #85)
> @larsomat: It's still there
> 
> Running Netbeans 8, Java 1.8, OS X 10.9.2
Comment 87 Miloslav Metelka 2014-04-28 13:12:36 UTC
This problem is a result of JDK bug
https://bugs.openjdk.java.net/browse/JDK-8023794

The JDK issue's description mentions
g2Image.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.KEY_FRACTIONALMETRICS_ON);
as a possible remedy for the problem but this does not work in NB case. I've added all the AA flags as part of changeset
http://hg.netbeans.org/jet-main/rev/eada3c10e3d9
on 2013-11-19 described by
http://wiki.netbeans.org/EditorAntialiasing
but none of the switches seems to be able to turn the AA rendering from grey to LCD.

The problem affects java products that use Swing+AWT rendering (products like Eclipse use an SWT rendering so the problem is likely not present there).

Subsequent NB releases likely won't change the situation unless it would show up that NB's code does trigger the problem somehow. However rendering on non-Mac OS X platforms (and even Mac OS X JDK 1.6) works fine which indicates that our code should be ok.
Comment 88 rabbitboy2007 2015-04-09 04:08:30 UTC
oh,NB8.0.2 with JDK1.8u40 have the same problem
Comment 89 basil.bourque 2015-04-29 22:17:29 UTC
Fails to use Apple Quartz font smoothing.

See screen shot:
    http://i.imgur.com/em7HQWn.png

No Quartz font-smoothing.
NetBeans 8.0.2 is bad, while TextMate is good.
Java 8 Update 45. 
Mountain Lion 10.8.5.
Comment 90 tveimo 2015-05-26 14:09:24 UTC
I just downloaded and built openjdk 9 from mercurial, patched with the patchset from http://cr.openjdk.java.net/~bae/8023794/9/webrev.10/

The jdk can then render subpixel antialiased text fine, as shown in the enclosed screenshot from a test app. However, netbeans 8 still can't take advantage of it. I tried to use the command line switches 

-J-Dorg.netbeans.editor.view.settings.level=FINE -J-Dorg.netbeans.editor.aa.text=hrgb

with and without the additional switch

-J-Dorg.netbeans.editor.aa.fractional=true

Since the antialias support is now no longer conditional on fractional rendering being turned on.

So am wondering, are these switches no longer supported in netbeans 8, or would there possibly be an issue still with some configuration of image or surface use that would prevent netbeans from using subpixel antialiased text?

Would also be handy to find a place to download the older netbeans 7.4 nightly that had support for these switches to test with as well.
Comment 91 tveimo 2015-05-26 14:11:04 UTC
Created attachment 153879 [details]
openjdk 9 nightly with subpixel antialiasing support patches applied (on retina screen), swing test app
Comment 92 tveimo 2015-05-27 05:04:06 UTC
Created attachment 153888 [details]
openjdk 9 nightly, subpixel antialiasing on retina, javaFX html editor; Looks very promising!
Comment 93 MontyHu 2015-05-27 09:26:46 UTC
@tveimo: How did you improve the anti-aliasing as shown in your screen caps above? Did you just use those two switches? Does the anti-aliasing also work in Netbeans?
Comment 94 tveimo 2015-05-27 10:05:00 UTC
Netbeans itself doesn't display properly with subpixel antialiasing. These screenshots are with other JFC apps.

I built openjdk locally using these instructions: http://blog.shelan.org/2015/03/how-to-build-open-jdk-9-on-mac-osx.html, patched with these patches: http://cr.openjdk.java.net/~bae/8023794/9/webrev.10/
Comment 95 Miloslav Metelka 2015-05-27 12:08:56 UTC
(In reply to tveimo from comment #91)
> Created attachment 153879 [details]
> openjdk 9 nightly with subpixel antialiasing support patches applied (on
> retina screen), swing test app

Hi Tor,
 since integration of
http://hg.netbeans.org/jet-main/rev/eada3c10e3d9
on 2013-11-19
 NB editor allows for any combination of rendering hints specified on command line (see http://wiki.netbeans.org/EditorAntialiasing) so if you have managed to display Swing test app to render properly then NB with the same set of rendering hints should render in the same way. Could you please check that? It would be a great step ahead regarding this issue. Thanks.
Comment 96 tveimo 2015-05-27 15:01:23 UTC
Ok, I do see these in the logs

DocumentView.updateFontColorSettings() Antialiasing Rendering Hints:
    Graphics: {Text-specific antialiasing enable key=Default antialiasing text mode, Global rendering quality key=Default rendering methods, Stroke normalization control key=Default stroke normalization, Global antialiasing enable key=Nonantialiased rendering mode, Text-specific LCD contrast key=140, Fractional metrics enable key=Integer text metrics mode}
    Desktop Hints: {Text-specific antialiasing enable key=LCD HRGB antialiasing text mode, Global antialiasing enable key=Antialiased rendering mode}
    Extra Hints: {Text-specific antialiasing enable key=LCD HRGB antialiasing text mode, Global antialiasing enable key=Nonantialiased rendering mode}
updateCharMetrics(): FontRenderContext: AA=true, AATransformed=true, AAFractMetrics=false, AAHint=LCD HRGB antialiasing text mode


but still no subpixel rendering. I remember there was a theory it might be due to double buffering being used, am unsure if there was a build at one stage where double buffering was disabled, as a test?
Comment 97 tveimo 2015-05-27 15:34:38 UTC
From the source: http://www.docjar.com/html/api/sun/java2d/opengl/OGLSurfaceData.java.html

* For now, we can only render LCD text if:
     *   - the fragment shader extension is available, and
     *   - blending is disabled, and
     *   - the source color is opaque
     *   - and the destination is opaque

Just got a tip about:

"remove the condition (src/java.desktop/share/classes/sun/java2d/opengl/OGLSurfaceData.java, line 410:

sg2d.surfaceData.getTransparency() == Transparency.OPAQUE &&

At the moment, lcd text pipeline unable to handle translucent destination
correctly. This problem will be addressed by a fix for this bug:

https://bugs.openjdk.java.net/browse/JDK-8078516"

Cortesy of the developer working on this. With that change the editor renders with subpixel AA. It looks very good, except for a few places where the text seems to be renderes twice (left and bottom margin). It's a bit slower than usual grayscale rendering, so if you favour subpixel rendering, please also vote for bug https://netbeans.org/bugzilla/show_bug.cgi?id=249052.
Comment 98 tveimo 2015-05-27 15:41:17 UTC
Created attachment 153905 [details]
nb 8 dev 20150520 on openjdk 9 patched with subpixel rendering support

Now this looks like something! Needs some slight work on the labels in the left and bottom margin, since they seems to be rendered twice. Editor is a bit slow still.
Comment 99 larsomat 2015-05-27 15:56:42 UTC
Sorry for getting a bit off-topic, but I just wanted to say: I'm really happy that people are working on this. 

Can't wait for it to arrive on my screen...
Comment 100 MontyHu 2015-05-27 18:10:26 UTC
I echo larsomat's statement that I'm really glad someone is working on this. 

I'm considering switching from Sublime Text to Netbeans, but, the font rendering is so terrible in Netbeans compared to Sublime Text, I don't know if I could stand looking at it all day long. I use a font called Panic Sans that is great for programming. It looks really good in Sublime Text which has a "subpixel_antialias" option for fonts that makes them look sharp and easy to read. The same font in Netbeans is thinner and harder to read unless I change the point size to 14. In Sublime Text the same font is very readable at size 12 (plus I can see more code on the screen at one time). 

There are some really nice features in Netbeans I'd like to use going forward if the font rendering issue can be resolved. Thanks!
Comment 101 tveimo 2015-05-28 00:32:38 UTC
Just a warning; scrolling is extremely slow in netbeans with subpixel antialiasing. I'd say it's not usable at the moment.
Comment 102 tveimo 2015-06-19 03:04:08 UTC
With the latest patch for bug https://bugs.openjdk.java.net/browse/JDK-8087201, at http://cr.openjdk.java.net/~bae/8087201/9/webrev.00/ subpixel rendering is actually fast enough to use on a daily basis on my 2014 15" retina mbp (with nvidia / intel integrated gfx)! 

It even runs fast enough for day-to-day use, on intel integrated graphics.

The jdk still has to be patched as described in comment 97, https://netbeans.org/bugzilla/show_bug.cgi?id=216655#c97 to enable subpixel rendering.
Comment 103 tveimo 2015-06-26 08:31:39 UTC
Openjdk 9 build with subpixel antialiasing enabled is now available for download;

http://download.java.net/jdk9/archive/b70/binaries/
Comment 104 tveimo 2015-07-02 08:45:56 UTC
I've posted a post on my blog on how to patch and build openJDK 9 on OSX; http://www.nothome.com/2015/07/subpixel-font-rendering-with-netbeans.html
Comment 105 Antonin Nebuzelsky 2015-09-16 11:23:56 UTC
(In reply to tveimo from comment #102)
> With the latest patch for bug https://bugs.openjdk.java.net/browse/JDK-8087201
> It even runs fast enough for day-to-day use, on intel integrated graphics.

tveimo, the JDK fix has been backported to 8u66 and can be downloaded at

https://jdk8.java.net/download.html

Can you please verify the latest NB daily with 8u66 early access has this issue finally fixed? Thanks.

As with other JDK bugs, closing wontfix on NB side.
Comment 106 larsomat 2015-09-17 07:22:59 UTC
I installed 8u66 Build b02, but I don't see any improvement.
Comment 107 tveimo 2015-09-22 02:40:27 UTC
Hi Antonin Nebuzelsky,

Installed 8u66 build b02. This JDK version does NOT fix the subpixel antialiasing issue on OSX. A patch is still required to enable it for translucent surfaces, which netbeans uses.
Comment 108 tveimo 2015-09-25 11:45:18 UTC
Just to clarify, jdk issue https://bugs.openjdk.java.net/browse/JDK-8023794 must also be backported to JDK 8 before it can use subpixel rendering on OSX, but then only for apps that use non-transparent surfaces.
Comment 109 Jiri Kovalsky 2015-09-30 13:26:08 UTC
As per the bug waiving process [1] can you please provide appropriate justification for the waiver request? What is the plan about it? Thanks Tondo!

[1] http://wiki.netbeans.org/WaiverProcess
Comment 110 Antonin Nebuzelsky 2015-09-30 13:43:06 UTC
(In reply to Jiri Kovalsky from comment #109)
> What is the plan about it?

Expecting fixes on JDK side. Most probably no changes on NB side then, but having open to keep track of the progress on JDK side, and not lose track for verification.
Comment 111 Jiri Kovalsky 2015-10-05 11:19:28 UTC
Bug waiver for 8.1 approved.
Comment 112 tveimo 2016-08-01 14:07:32 UTC
I have patched and build a version of OpenJDK 8 that supports subpixel rendering with netbeans on OSX. It is available for download at http://www.nothome.com/2016/08/subpixel-font-rendering-with-openjdk-8.html.
Comment 113 ebakke 2016-08-01 18:30:08 UTC
Created attachment 161517 [details]
Comparison of JDK8 vs. tveimo's subpixel build vs. Excel for Mac 2011

I just tried tveimo's subpixel-enabled OpenJDK build on my NetBeans Platform application. Comparison attached. Subpixel rendering works, but all fonts are quite a bit heavier than on regular JDK8, and than on native apps such as Excel for Mac 2011. Explicitly setting values for RenderingHints.KEY_TEXT_LCD_CONTRAST during Graphics2D painting did not make enough of a difference to approach the lighter contrast of OS font rendering.
Comment 114 tveimo 2016-08-03 13:43:37 UTC
Thanks for testing the JDK build. 

Check comments 13 and 14 in this bug report, or comment 26. 

The subpixel font rendering that is in openJDK 9 and this patched openJDK 8 build is very close if not exact to the font rendering in apples old jdk 6 which uses native font rendering.

It looks like support for transparent surfaces is not highly prioritised, so it would be interesting to find out what can be done to reduce the use of these in the netbeans editor code.
Comment 115 ebakke 2016-08-03 15:57:43 UTC
tveimo: The higher contrast works well for bright text on dark backgrounds, as in the examples you referenced. Ideally the contrast should be lighter for dark text on bright backgrounds, doing what Petr Somol suspected was the case for JDK 1.6: "I suspect that in your 1.6 the JDK detects the fact that bright characters are rendered on dark background and increases slightly the contrast and character weight". But that would be up to the JDK in any case.
Comment 116 tveimo 2016-08-09 15:22:46 UTC
Can you try adding -J-Dorg.netbeans.editor.aa.contrast=250 to netbeans_default_options to see if the fonts looks thin enough? The default (140?) might be too low.
Comment 117 tveimo 2016-08-09 15:28:45 UTC
Created attachment 161603 [details]
Comparison contract set to 250 (left) and 140 (right)

Screen shots of contract set to 250 (left) and 140 (right, the default).
Comment 118 Miloslav Metelka 2016-08-10 08:52:50 UTC
>It looks like support for transparent surfaces is not highly prioritised, so it would be interesting to find out what can be done to reduce the use of these in the netbeans editor code.
I'm not aware that we would use transaprency except in case of rectangular selection rendering in EditorCaret where we use                         g2d.setComposite(AlphaComposite.SrcOver.derive(0.2f));
Not sure though if TextLayout that we currently use for rendering (the modification to use GlyphVector is still in progress) uses it internally or not.
Most of the rendering code is in org.netbeans.modules.editor.lib2.view.HighlightsViewUtils so if you find anything that could be improved I'll be happy to change it.
Comment 119 tveimo 2016-08-11 11:43:15 UTC
There's a number of surfaces that are BufferedImage.TYPE_INT_ARGB. I think the check sg2d.surfaceData.getTransparency() == Transparency.OPAQUE on that surface then returns true, disabling subpixel antialiasing.