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 241363 - Font property editor should anti-alias its font example as appropriate
Summary: Font property editor should anti-alias its font example as appropriate
Alias: None
Product: platform
Classification: Unclassified
Component: Property Sheet (show other bugs)
Version: 7.4
Hardware: Macintosh (x86) Mac OS X
: P4 normal with 1 vote (vote)
Assignee: Stanislav Aubrecht
Depends on:
Reported: 2014-02-04 05:37 UTC by ebakke
Modified: 2014-02-07 02:51 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:

Font property painter antialiasing problem (33.36 KB, image/png)
2014-02-04 06:21 UTC, ebakke

Note You need to log in before you can comment on or make changes to this bug.
Description ebakke 2014-02-04 05:37:53 UTC
The PropertyEditor for the Font class has a neat little dialog box that lets you select what font to use as a value for the property (e.g. to set the font for a JLabel in NetBeans' form builder). A small defect is that "The quick brown fox jumps over the lazy dog" is shown in a non-anti-aliased manner. I think this should be very easy to fix, by inserting the following right before the call to FontEditor.this.paintText that paints MSG_Preview in org.netbeans.beaninfo.editors.FontEditor:

if (g instanceof Graphics2D) {
  Object desktopHints = Toolkit.getDefaultToolkit()
  if(desktopHints instanceof Map<?,?>)
    ((Graphics2D) g).addRenderingHints((Map<?,?>) desktopHints);

Sadly I don't have the NetBeans build system set up to test such changes myself. But this is how I've enabled anti-aliasing in my own custom-painted Swing components before.
Comment 1 ebakke 2014-02-04 06:21:41 UTC
Created attachment 144756 [details]
Font property painter antialiasing problem

Actually, it seems that there's a problem with lacking antialiasing in FontEditor.paintValue() as well, which is used to paint font values in the property sheet. As can be seen by the attached screenshot, proper antialiasing only happens whenever the custom editor button ("...") is shown, presumably because the button's painting code happens to apply the appropriate rendering hints itself.

The solution, I think, should be to add the rendering hints to the Graphics2D object first thing in paintText(). That should make the example text properly anti-aliased both for the inline font value in the property sheet and for the "The quick brown fox" in the dialog box.
Comment 2 Stanislav Aubrecht 2014-02-04 09:35:31 UTC
core-main 05199bf2a12d
Comment 3 Quality Engineering 2014-02-07 02:37:55 UTC
Integrated into 'main-silver', will be available in build *201402070001* on (upload may still be in progress)

User: S. Aubrecht <>
Log: #241363 - text anti-aliasing
Comment 4 ebakke 2014-02-07 02:51:59 UTC
Thanks for the fix!