DescriptionBe serious about setstrokeadjust in PostScript primitives
This particularly concerns draw_round_box which is used for drawing
lines with a rounded ending. If the width/height ratio or its inverse
exceeds 2, the box is considered to be a "line". In this case, first
a clipping path is established representing the whole shape and
extended widely in the area of the "main stroke". The reason for this
extension is to avoid both clip area and stroke competing for the
outline. While this is not a problem for the PostScript or PDF
rendering model, the Cairo bitmap rendering library employs
Porter-Duff compositing for antialiasing amounting to "cheap man's
antialiasing" not requiring a higher rendering resolution but relying
on edges affecting a single pixel to be independent.
Porter-Duff requires us not to have multiple parallel strokes or clip
areas if we want to avoid wrong sub-pixel grayness levels (and
consequently lines appearing too thick or thin) in Cairo-based
previewers like Evince.
After establishing the clip area, a stroke is drawn through. This
stroke may (at the PostScript device's discretion) employ
strokeadjustment further correcting the apparent thickness.
Ghostscript employs stroke adjustment when rendering at a resolution
below 150dpi. Stroke adjustment does not pass into PDF, however, when
ps2pdf runs.
Ghostscript performs sub-pixel rendering for antialiasing which
reduces the amount of discontinuities possibly caused by joining
stroke-adjusted shapes with full shapes.
It turns out that sharper contours can be achieved by using strokepath
and fill instead of a plain stroke. However, the resulting crisper
stems tend to combine worse with beams, so this approach has not been
pursued.
Also contains commits
Don't meddle with Ghostscript's choice of currentstrokeadjust
It should be appropriate for device and resolution by default.
Make stroke_and_fill? PostScript operator that fills conditionally
Make music-drawing-routines.ps require PostScript 2.0
There is no point having conditional code around setstrokeadjust and
its ilk any more.
Patch Set 1 #Patch Set 2 : Fix problem with path initialization, use same drawing method for staff lines #Patch Set 3 : "Minimally invasive" version. Just use strokes and stroke adjustment when called for. #Patch Set 4 : Define and use non_aliased_stroke to have Ghostscript render lines in PNG nicer #Patch Set 5 : Don't mess with Ghostscript's choice of currentstrokeadjust #Patch Set 6 : Fix linecaps on stems #Patch Set 7 : Remove strokepath-based stroking, change clip shape to accommodate for Porter-Duff #Patch Set 8 : reenable unconditional stroke adjustment #Patch Set 9 : Revert to default strokeadjust, add -dno-pretty-previews-option, document it #
Total comments: 1
Patch Set 10 : Route everything through strokeadjust, add -dstrokeadjust option, off by default #
MessagesTotal messages: 22
|