lilypond-user
[Top][All Lists]
Advanced

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

Re: Add text to score without affecting spacing


From: Aaron Hill
Subject: Re: Add text to score without affecting spacing
Date: Wed, 09 Feb 2022 16:53:17 -0800

On 2022-02-09 4:12 pm, Valentin Petzel wrote:
Hi Kieren,

thank you. Yes, currently I am using some tweaked Rehearsal Marks mit 0-
dimensions and some tweaks. Just asking if there was a better way.

There are a number of grobs that normally have no visual representation. You could attach your content there:

%%%%
\version "2.22.0"

overlayText =
#(define-music-function
  (grob-path text)
  (key-list? markup?)
  (define (print-with-point-outline grob)
   (ly:stencil-outline
    (ly:text-interface::print grob)
    point-stencil))
  (define (proc grob . args)
    (ly:grob-set-property! grob 'font-size -6)
    (ly:grob-set-property! grob 'layer 1000)
    (ly:grob-set-property! grob 'stencil
     print-with-point-outline)
    (ly:grob-set-property! grob 'text text))
  #{ \applyOutput $grob-path #proc #})

{
  b'4
  \overlayText Score.PaperColumn
    \markup \general-align #Y #UP "Lorem"
  4
  \overlayText Score.NoteColumn
    \markup \vcenter \whiteout \box "Ipsum"
  2
}
%%%%


-- Aaron Hill

Attachment: annotation.cropped.png
Description: PNG image


reply via email to

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