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.
Summary: | Add support for subpixel rendering introduced in JDK6 | ||
---|---|---|---|
Product: | editor | Reporter: | Roman Strobl <rstrobl> |
Component: | -- Other -- | Assignee: | Milutin Kristofic <mkristofic> |
Status: | RESOLVED FIXED | ||
Severity: | blocker | CC: | tboudreau |
Priority: | P1 | ||
Version: | 5.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | ENHANCEMENT | Exception Reporter: | |
Bug Depends on: | |||
Bug Blocks: | 48376 | ||
Attachments: |
No AA in editor
Normal AA in editor Subpixel AA in editor Editor build with subpixel AA instead of regular AA Patch |
Description
Roman Strobl
2005-06-08 19:29:07 UTC
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. |