lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Add independent control of thickness and offset for underline marku


From: Carl . D . Sorensen
Subject: Re: Add independent control of thickness and offset for underline markup (issue1347041)
Date: Tue, 06 Jul 2010 13:22:06 +0000

Reviewers: Neil Puttock,

Message:
On 2010/05/29 17:51:11, c_sorensen_byu.edu wrote:
On 5/29/10 10:10 AM, "Kieren MacMillan"
<mailto:address@hidden>
wrote:
 > To be clear, 'line-thickness and the thickness property of \underline
are
> [potentially] two different independent values, right?

Yes.  I would suggest that both thickness and offset should be
multipliers
of 'line-thickness (which shows up in your scheme code as thick.

> Once these points are addressed, how do I submit a revision?
>
Attach (or inline) a diff patch on an email, and I'll apply and repost
to
Rietveld.


I haven't seen a follow-up patch for this issue.  Are you still planning
on it?  Or did I miss it?

Thanks,

Carl

Description:
Add independent control of thickness and offset for underline markup

Please review this at http://codereview.appspot.com/1347041/show

Affected files:
  M scm/define-markup-commands.scm


Index: scm/define-markup-commands.scm
diff --git a/scm/define-markup-commands.scm b/scm/define-markup-commands.scm
index 8d4d749770d129975a80113fce9fee9c9d6b5454..0e62a405bf76e2837c45958c7667448c351eacb1 100644
--- a/scm/define-markup-commands.scm
+++ b/scm/define-markup-commands.scm
@@ -277,21 +277,20 @@ Create a beam with the specified parameters.
 (define-markup-command (underline layout props arg)
   (markup?)
   #:category font
-  #:properties ((thickness 1))
+  #:properties ((thickness 1) (offset 0.5))
   "
 @cindex underlining text

 Underline @var{arg}.  Looks at @code{thickness} to determine line
-thickness and y-offset.
+thickness, and @code{offset} to determine line y-offset.

 @lilypond[verbatim,quote]
-\\markup {
-  default
-  \\hspace #2
-  \\override #'(thickness . 2)
-  \\underline {
-    underline
-  }
+\\markup \\fill-line {
+  \\underline "underlined"
+  \\override #'(offset . 5) \\override #'(thickness . 1) \\underline
+"underlined"
+  \\override #'(offset . 1) \\override #'(thickness . 5) \\underline
+"underlined"
 }
 @end lilypond"
   (let* ((thick (* (ly:output-def-lookup layout 'line-thickness)
@@ -299,7 +298,7 @@ thickness and y-offset.
          (markup (interpret-markup layout props arg))
          (x1 (car (ly:stencil-extent markup X)))
          (x2 (cdr (ly:stencil-extent markup X)))
-         (y (* thick -2))
+         (y (* -1 offset))
          (line (make-line-stencil thick x1 y x2 y)))
     (ly:stencil-add markup line)))






reply via email to

[Prev in Thread] Current Thread [Next in Thread]