Deutschsprachiges LilyPond-Forum

Spezielle Notation => Neue Musik => Thema gestartet von: gaerchle am Donnerstag, 6. Mai 2021, 21:50

Titel: Textkasten [gelöst]
Beitrag von: gaerchle am Donnerstag, 6. Mai 2021, 21:50
Liebe Experten,

wie bekomme ich einen Textkasten bzw. eine Textbox - über die Notenzeilen gelegt.
Am liebsten so, dass ich die Notenzeilen im Hintergrund nicht mehr sehe?

Vielen Dank
Gärchle
Titel: Antw:Textkasten
Beitrag von: harm6 am Freitag, 7. Mai 2021, 21:03
Hallo,

mir ist nicht klar was Du möchtest.
Kannst Du ein Bild posten? Bzw eines mit einem Grafikprogramm erstellen?

Gruß,
  Harm
Titel: Antw:Textkasten
Beitrag von: gaerchle am Freitag, 7. Mai 2021, 21:26
Okay.
Anbei ein Beispiel.
Ich hoffe, es ist jetzt klarer.
Danke.
Titel: Antw:Textkasten
Beitrag von: Malte am Samstag, 8. Mai 2021, 09:34
Ich würde etwas probieren wie \markup \with-dimensions #'(0 .0) #'(0 . 0) \whiteout \box "Text" oder so ... Ggf. zu verschieben mit \translate.
Titel: Antw:Textkasten
Beitrag von: gaerchle am Samstag, 8. Mai 2021, 14:54
Ja, geht. Krieg ich mit ein bisschen Gebastel hin. :D
Danke vielmals
Titel: Antw:Textkasten [gelöst]
Beitrag von: harm6 am Samstag, 8. Mai 2021, 15:22
Vielleicht hilft:


\version "2.22.0"

#(define-markup-command (top-box layout props mrkp)(markup?)
  #:properties ((thickness 1)
                (box-padding 1.0)
                (color white))
  (let* ((stil (interpret-markup layout props mrkp))
         (stil-x-ext (ly:stencil-extent stil X))
         (stil-y-ext (ly:stencil-extent stil Y))
         (line-thick (ly:output-def-lookup layout 'line-thickness))
         (thick (* thickness line-thick)))
    (box-stencil
      (ly:stencil-add
        (stencil-with-color
          (ly:round-filled-box
            (interval-widen stil-x-ext box-padding)
            (interval-widen stil-y-ext box-padding)
            0)
          color)
        stil)
      thick 0)))

topLayerText =
#(define-scheme-function (move mrkp)(pair? markup?)
#{
  \once \override TextScript.outside-staff-priority = #'()
  \once \override TextScript.staff-padding = #'()
  \once \override TextScript.font-shape = #'upright
  \once \override TextScript.layer = 5000
  \once \override TextScript.X-offset = #(car move)
  \once \override TextScript.Y-offset = #(cdr move)
  <>-\markup \with-dimensions #'(0 . 0) #'(0 . 0) \top-box #mrkp
#})

%%%%%%%%%%%%%%%%%%%%
%% EXAMPLE
%%%%%%%%%%%%%%%%%%%%

lorem =
\markup
\override #'(line-width . 40)
\wordwrap-string #"Lorem ipsum dolor sit amet, consectetur
adipisicing elit, sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua.  Ut enim ad minim
veniam, quis nostrud exercitation ullamco laboris
nisi ut aliquip ex ea commodo consequat."

\score {
  \new StaffGroup
    <<
      \new Staff { b1 }
      \new Dynamics {
        \topLayerText #'(20 . -20) \lorem
        s1
      }
      \new Staff { c'1 }
      \new Staff { d'1 }
      \new Staff { e'1 }
      \new Staff { f'1 }
      \new Staff { g'1 }
    >>
  \layout { ragged-right = ##f }
}


Gruß,
  Harm