lilypond-user
[Top][All Lists]
Advanced

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

Re: horizontal line separator in column markup (as in fraction or polych


From: Thomas Morley
Subject: Re: horizontal line separator in column markup (as in fraction or polychord)
Date: Fri, 3 Feb 2012 02:03:17 +0100

Hi,

2012/2/2 Xavier Scheuer <address@hidden>:
> On 2 February 2012 22:23, Jean-Alexis Montignies <address@hidden> wrote:
>> Hi,
>>
>> I'm trying to write a polychord markup that looks like a mathematical 
>> fraction.
>>
>> May be I've overlooked something, but I didn't found a way to draw a
>> horizontal line between to text lines of a column.
>> I'm using:
>>
>> \markup {\override #`(direction . ,UP) \dir-column
>>      { "C"
>>        \draw-line #'(3 . 0)
>>        "Db" }
>> }
>>
>> But then I have too many vertical space between Db and the separator
>> and I have to hardcode the length of the line.
>>
>> Any suggestion?
>
> Why not simply
>
>  \chords {
>    c1:/des
>  }
>
> ?
>
> Cheers,
> Xavier
>
> --
> Xavier Scheuer <address@hidden>
>
> _______________________________________________
> lilypond-user mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/lilypond-user

an idea:

\version "2.14.2"

#(define-markup-command (custom-column layout props args)
  (markup-list?)
   ;#:properties ((direction)
   ;(baseline-skip))
        
  (let* ((args-length-ls (sort (map (lambda (x)
                        (interval-length
                           (ly:stencil-extent
                              (interpret-markup layout props x)
                            X)))
                        args)
                          >))
        ; baseline-skip is hard-coded!
        ; if you change this don't forget to change 0.65
        ; in: #:translate (cons 0 (* 0.65 baseline-skip))
        (baseline-skip 1.2)
        (ln-mrkp (markup #:translate (cons 0 (* 0.65 baseline-skip))
                         #:draw-line (cons (car args-length-ls) 0)))
        (new-args (list (car args) ln-mrkp (cadr args))))
        ; direction is hard-coded!
  (stack-lines -1 ;(if (number? direction) direction -1)
               0.0
               baseline-skip
               (interpret-markup-list layout props new-args))))

\markup {
        \custom-column { "C" "Db" }
        \custom-column { "Ees" "Disis" }
        \custom-column { "a" "Whatsever" }
}

HTH,
  Harm

Attachment: atest-09.png
Description: PNG image


reply via email to

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