set-smoothing in dc<%>

Enables or disables anti-aliased smoothing of lines, curves, rectangles, rounded rectangles, ellipses, polygons, paths, and clear operations. (Text smoothing is not affected by this method, and is instead controlled through the font% object.)

Smoothing is supported under Windows only when Microsoft's gdiplus.dll is installed (which is always the case for Windows XP). Smoothing is supported under Mac OS X always. Smoothing is supported under X only when Cairo is installed when MrEd is compiled. Smoothing is never supported for black-and-white contexts. Smoothing is always supported (and cannot be disabled) for PostScript output.

The smoothing mode is either 'unsmoothed, 'smoothed, or 'aligned. Both 'aligned and 'smoothed are smoothing modes.

In 'smoothed mode for a canvas or bitmap drawing context, integer drawing coordinates correspond to the boundary between pixels, and pen-based drawing is centered over a given line or curve. Thus, drawing with pen width 1 from (0, 10) to (10, 10) draws a 2-pixel wide line with 50% opacity.

The 'aligned smoothing mode is like 'smoothed, but it paints pixels more like 'unsmoothed mode. Since it aligns shapes to pixel boundaries, 'aligned mode often produces better results than 'smoothed, but the results depend on the application. The 'aligned mode is defined in terms of 'smoothed mode, except that drawing coordinates are rounded down (via floor, after scaling and origin translation). For line drawing, coordinates are then shifted right and down by the floor of half a pen width. In addition, for pen drawing through draw-rectangle, draw-ellipse, draw-rounded-rectangle, and draw-arc, the given width and height are each decreased by 1.0.

In either smoothing mode, brush and pen stipples are ignored (except for PostScript drawing), and 'hilite and 'xor drawing modes are treated as 'solid. If smoothing is not supported, then attempting to set the smoothing mode to 'smoothed or 'aligned will have no effect, and get-smoothing will always return 'unsmoothed. Similarly, get-smoothing for a post-script-dc% always returns 'smoothed.