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

Issue 1689041: Patch for issue #1116 (one stencil in fill-line) (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 10 months ago by perpeduumimmobile
Modified:
12 years, 10 months ago
Reviewers:
joeneeman, Neil Puttock
CC:
lilypond-devel_gnu.org
Visibility:
Public.

Description

Patch for issue #1116 (one stencil in fill-line) Avoid translation of stencils if only one markup is given as argument for fill-line. Regressions not checked yet.

Patch Set 1 #

Patch Set 2 : removed word-space from \fill-line; reindentation #

Total comments: 5

Patch Set 3 : Fixes in fill-line, again. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+71 lines, -62 lines) Patch
M scm/define-markup-commands.scm View 1 2 3 chunks +71 lines, -62 lines 0 comments Download

Messages

Total messages: 4
joeneeman
Are you still waiting for someone to review this? If so, here are a couple ...
13 years, 10 months ago (2010-06-30 18:34:35 UTC) #1
Neil Puttock
Hi Alexander, LGTM. It just needs some regression tests; the examples from #1116 and #382 ...
13 years, 10 months ago (2010-07-01 22:27:42 UTC) #2
perpeduumimmobile
On 2010/06/30 18:34:35, joeneeman wrote: > Are you still waiting for someone to review this? ...
13 years, 9 months ago (2010-07-12 16:14:01 UTC) #3
perpeduumimmobile
13 years, 9 months ago (2010-07-12 16:18:35 UTC) #4
On 2010/07/01 22:27:42, Neil Puttock wrote:
> Hi Alexander,
> 
> LGTM.
Thanks.

> It just needs some regression tests; the examples from #1116 and #382 should
> suffice.

I did not write those - I'm not yet perfectly convinced that the handling of
word-space is the right thing to do (see below).

> http://codereview.appspot.com/1689041/diff/2001/3001#newcode845
> scm/define-markup-commands.scm:845: (set! line-stencils empty-stencil)
> Hmm, line-stencils isn't appropriate from this point, since it's no longer a
> list of stencils; perhaps it would be clearer to bind to another variable?

Not sure how to name it, then. I used the large if clause, but I'm not sure if
this is good coding style in scheme? Looks more like an early return from
imperative languages...

> http://codereview.appspot.com/1689041/diff/2001/3001#newcode847
> scm/define-markup-commands.scm:847: (stack-stencils-padding-list
> indent
Done.


Regarding word-space:

I reintroduced word-space property to ensure that texts don't collide. This
seems not the best way, though. Consider

\markup \column {
  \fill-line { "|" "|" "|" "|" }
  \fill-line { "|" "veeeeeeeeeeeeeeeeeeeeeeeeeeery long text"
               "veeeeeeeeeeeeeeeeeeeery long text" "|" }
}

(Without word-space in the last version of my patch, this let's the texts
collide.)
Expected output should be this text fitted into one line, not exceeding the
linewidth unless absolutely necessary (i.e., text-width + (n-1)*word-space >
linewidth).
I think the best way would be to solve some minimization problem in the
springs-and-rods style:
- fix the leftmost and rightmost markup to hit the boundaries of the line
- minimize sum over all squared distances of center of texts and optimal
  center points, which are at (2*i / (2*n+1) * line-width) for n stencils,
  subject to non-overlapping texts.
  Perhaps, a weight should be added depending on the lengths of the texts:
  The narrower the text, the more visible is the deviation from the optimal
  position, IMHO.
IIUC, the necessary code for the optimization is already there, but I don't
know where to look. I certainly could reinvent the wheel and implement the
Simplex algorithm in Scheme, but I'm sure someone already did better.
Sign in to reply to this message.

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