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.
We need to add support for subpixel rendering introduced in Mustang build 39. According to the discussion with Java team we should have the following options in editor for antialiasing: 1) OFF 2) REGULAR (as now) 3) Use DESKTOP settings - and make this the default. The DESKTOP setting would take the Antialiasing settings from the OS. Right now the JDK team is working on API which will give us these settings both on various OSes. Depending on the OS settings, we will either use no hints, the regular AA hint or the new subpixel rendering hint. I have tried to enable it in editor, it can be done by replacing the current AA hint in org.n.m.e.options.BaseOptions.java with: textAntialiasingHintsMap.put(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB); I attach screenshots with no AA, regular AA and subpixel AA in editor. I also attach a build of editor which forces the subpixel AA hint instead of regular AA hint in editor. So once user activates AA with this build of editor, the subpixel AA is used. This is not a solution, it was just created to show how the subpixel rendering will look like in NetBeans.
Created attachment 22560 [details] No AA in editor
Created attachment 22561 [details] Normal AA in editor
Created attachment 22562 [details] Subpixel AA in editor
Created attachment 22563 [details] Editor build with subpixel AA instead of regular AA
Phil Race on the JDK team gave me the secret: Map hintsMap = (Map)(Toolkit.getDefaultToolkit().getDesktopProperty("awt.font.desktophints")); //NOI18N graphics2d.addRenderingHints(hintsMap); I'm attaching a patch that should fix this for every case I could find in the source base (tabs, explorer, etc.). It also fixes issue 48376, which is really the same issue, but editor-specific. Note it is not tested - this feature won't appear until Mustang b47, which is due sometime this week. I wasn't quite sure what to do in the case someone wants to explicitly turn editor antialiasing *off* (not that you can really do this). The patch for the editor will look for VALUE_TEXT_ANTIALIASING_OFF in the saved rendering hints map. Currently that will never happen, but if someone wanted to make the antialias action more intelligent, it could check the checkbox by default if the platform supports antialiasing by default, and then put explicit no-antialiasing hints into the map it saves if the user de-selects it. (There are a few souls in the world who prefer non-antialiased text - see Joel Spolsky's diatribes on the subject).
Created attachment 23482 [details] Patch
Question for the editor part: Should not the FoldingToolTip and GlyphGutter use the same algorithm like the EditorUI? Possibly that algorithm could be made a static method. BTW IMHO we should upgrade the option to three-state value (as suggested in Roman's original note) in the future anyway.
I hope this is no longer an issue. All the editor's code now applies system rendering hints i.e. some form of public void paint(Graphics g) { Map<?, ?> desktopHints = (Map<?, ?>) Toolkit.getDefaultToolkit().getDesktopProperty("awt.font.desktophints"); //NOI18N ((Graphics2D)g).addRenderingHints(desktopHints); ... } which I assume is the correct state. If not please reopen the issue.