Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(14882)

Issue 8663044: Be serious about setstrokeadjust in PostScript primitives (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years ago by dak
Modified:
10 years, 2 months ago
Reviewers:
Keith, janek
CC:
lilypond-devel_gnu.org
Visibility:
Public.

Description

Be 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+145 lines, -48 lines) Patch
M Documentation/changes.tely View 1 2 3 4 5 6 7 8 9 1 chunk +13 lines, -0 lines 0 comments Download
M Documentation/usage/running.itely View 1 2 3 4 5 6 7 8 9 1 chunk +11 lines, -0 lines 0 comments Download
M ps/music-drawing-routines.ps View 1 2 3 4 5 6 7 8 9 10 chunks +112 lines, -46 lines 0 comments Download
M scm/framework-ps.scm View 1 2 3 4 5 6 7 8 9 2 chunks +3 lines, -2 lines 0 comments Download
M scm/lily.scm View 1 2 3 4 5 6 7 8 9 1 chunk +6 lines, -0 lines 0 comments Download

Messages

Total messages: 22
janek
David, it's great to see you working on this! However, as you can see in ...
11 years ago (2013-04-12 11:06:30 UTC) #1
dak
Fix problem with path initialization, use same drawing method for staff lines
11 years ago (2013-04-12 14:57:07 UTC) #2
janek
David, i'm sorry, but i don't understand what the code does. Obviously, it would help ...
11 years ago (2013-04-14 20:38:12 UTC) #3
dak
On 2013/04/14 20:38:12, janek wrote: > David, > > i'm sorry, but i don't understand ...
11 years ago (2013-04-14 21:17:33 UTC) #4
janek
2013/4/14 <dak@gnu.org>: > On 2013/04/14 20:38:12, janek wrote: >> i'm sorry, but i don't understand ...
11 years ago (2013-04-14 21:43:36 UTC) #5
dak
On 2013/04/14 21:43:36, janek wrote: > 2013/4/14 <dak@gnu.org>: > > On 2013/04/14 20:38:12, janek wrote: ...
11 years ago (2013-04-14 22:43:07 UTC) #6
dak
"Minimally invasive" version. Just use strokes and stroke adjustment when called for.
11 years ago (2013-04-16 13:42:58 UTC) #7
dak
Define and use non_aliased_stroke to have Ghostscript render lines in PNG nicer
11 years ago (2013-04-16 16:12:15 UTC) #8
dak
Don't mess with Ghostscript's choice of currentstrokeadjust
11 years ago (2013-04-18 19:53:41 UTC) #9
dak
Fix linecaps on stems
11 years ago (2013-04-18 20:39:18 UTC) #10
dak
Remove strokepath-based stroking, change clip shape to accommodate for Porter-Duff
11 years ago (2013-04-21 15:59:15 UTC) #11
dak
reenable unconditional stroke adjustment
11 years ago (2013-04-21 23:17:59 UTC) #12
dak
Revert to default strokeadjust, add -dno-pretty-previews-option, document it
11 years ago (2013-04-23 15:03:30 UTC) #13
Keith
Confirming that the .pdf size doubles, but only if we measure relative to the size ...
11 years ago (2013-04-23 21:56:07 UTC) #14
dak
On 2013/04/23 21:56:07, Keith wrote: > Confirming that the .pdf size doubles, but only if ...
11 years ago (2013-04-23 22:22:53 UTC) #15
Keith
LGTM, if you really think masking the stem is a reliable solution. On 2013/04/23 22:22:53, ...
11 years ago (2013-04-25 03:10:59 UTC) #16
dak
On 2013/04/25 03:10:59, Keith wrote: > LGTM, > if you really think masking the stem ...
11 years ago (2013-04-25 07:47:47 UTC) #17
dak
On 2013/04/25 07:47:47, dak wrote: > On 2013/04/25 03:10:59, Keith wrote: > > LGTM, > ...
11 years ago (2013-04-25 16:39:23 UTC) #18
dak
"Keith OHara" <k-ohara5a5a@oco.net> writes: > On Thu, 25 Apr 2013 09:39:23 -0700, <dak@gnu.org> wrote: > ...
11 years ago (2013-04-25 20:19:37 UTC) #19
janek
2013/4/25 <dak@gnu.org>: > To give this some perspective: the starting point for this issue, an ...
11 years ago (2013-04-27 20:40:31 UTC) #20
dak
Route everything through strokeadjust, add -dstrokeadjust option, off by default
10 years, 5 months ago (2013-11-30 18:14:21 UTC) #21
janek
10 years, 5 months ago (2013-11-30 22:11:43 UTC) #22
LGTM as per tracker comment (the results, haven't read the code yet...)

Janek
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b