[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to properly scale a line in markup?
From: |
Thomas Morley |
Subject: |
Re: How to properly scale a line in markup? |
Date: |
Sun, 5 Nov 2017 14:44:56 +0100 |
2017-11-05 13:59 GMT+01:00 Thomas Morley <address@hidden>:
> 2017-11-05 13:29 GMT+01:00 Robin Bannister <address@hidden>:
>> Thomas Morley wrote:
>>
>>> In the real markup-command there will be no "A", so I can't go for
>>> stencil-extent of it.
> The bug is in note-by-number
> https://sourceforge.net/p/testlilyissues/issues/5122/
> see last two comments.
> Thus no text there.
> In my test-markup the "A" was added to have a simple chance to compare
> the line and the letter.
I think I've found a way: inserting a factor relying on the division
of text-font-size taken from paper (probably changed by
set-global-saff-size) and text-font-size taken from current layout
(probably changed by layout-set-staff-size) will do it.
#(define-markup-command (A-plus-vlineIV layout props)()
#:properties ((font-size 0))
(let* ((ref-stil (interpret-markup layout props "A"))
(line-y 1.6)
(layout-text-font-size
(ly:output-def-lookup layout 'text-font-size 11))
(paper-text-font-size
(ly:output-def-lookup $defaultpaper 'text-font-size 11))
(scaled-line
(*
(/ layout-text-font-size paper-text-font-size)
(magstep font-size)
line-y)))
(ly:stencil-combine-at-edge
ref-stil
X
RIGHT
(ly:round-filled-box '(0 . 0.1) (cons 0 scaled-line)
0.08)
0.2)))
%%%%%%%%%%%%%%%%%%%%%%%%
%% EXAMPLE
%%%%%%%%%%%%%%%%%%%%%%%%
#(set-global-staff-size 10)
\score {
{
a^\markup \fontsize #5 {
\A-plus-vlineIV
\draw-line #'(0 . 1.6)
}
}
\layout { #(layout-set-staff-size 30) }
}
Looks like a method to improve note-by-number.
Wouldn't it be a good idea to make all lines scaling properly?
Look at the output from the added \draw-line.
Thanks,
Harm