• Willkommen im Forum „Archiviertes Lilypond Forum (2017)“.
 

Dies ist das Archiv des alten Forums (bis März 2017). Das aktuelle Forum ist unter lilypondforum.de zu finden.
This is the archive of the old forum (until March 2017). You can find the current forum at lilypondforum.de.

Hauptmenü

Kreis mit Text und definiertem Durchmesser - geht das?

Begonnen von Manuela, Montag, 13. April 2015, 10:22

Vorheriges Thema - Nächstes Thema

Manuela

Hi an alle,

ich weiß, Lilypond ist eigentlich nicht dafür gedacht  ;).

Ich kann Kreise mit Text drinnen zeichnen und angeben, wie viel Abstand zwischen Text und Kreislinie sein soll, d.h. die Größe des Kreises variiert je nach Textlänge.
\markup {
  \circle {
    Hi
  }
}

Ich kann Kreise ohne Text zeichnen und den Durchmesser angeben.
\markup {
  \draw-circle #2 #0.5 ##f
  \hspace #2
  \draw-circle #2 #0 ##t
}

Was ich nicht kann ist Kreise mit definiertem Durchmesser und Text drin zeichnen. Oder geht das doch?

kilgore

#1
nicht besonders elegant aber so geht es auch recht schnell:


{ c'^\markup \override #'(thickness . 4 ) \circle { \pad-around #1 Hi }
  c'^\markup \circle { \pad-around #2 Hi }
}


oder mit \combine und etwas einstellen:


{ c'^\markup  {
  \combine \center-align
  \translate #'( 0 . -.75 ) "Hi"
  \draw-circle #2 #0.5 ##f
} }

RobUr

Hallo Manuela,

ich empfehle folgende Lösung aus unserem kreativen Forum: Studierzeichen : Kombination 2

Gruß, Robert

harm6

Hallo,

schau mal, ob Du mit folgendem klar kommst.


\version "2.19.17"

#(define-markup-command (combine-xy-centered layout props args)
  (markup-list?)
  #:properties ((last-arg-at-baseline? #f))
  (let* ((stils (map (lambda (arg) (interpret-markup layout props arg)) args))
         (last-stil (if (not (null? args))
                        (interpret-markup layout props (last args))
                        #f))
         (last-y-ext (if last-stil
                         (ly:stencil-extent last-stil Y)
                         '(0 . 0))))
                     
    (ly:stencil-translate-axis
      (apply ly:stencil-add
        (map
          centered-stencil
          (map (lambda (arg) (interpret-markup layout props arg)) args)))
      (if last-arg-at-baseline?
          (/ (- (interval-length last-y-ext)
                (/ (ly:output-def-lookup layout 'blot-diameter) 2))
             2)
          0)
      Y)))


\markup {
  "some text"
  \combine-xy-centered {
    \draw-circle #2 #0.1 ##f
    \draw-circle #1.7 #0.1 ##f
    \draw-circle #1.4 #0.1 ##f
    \draw-circle #1.1 #0.1 ##f
    \draw-circle #0.8 #0.1 ##f
    \draw-circle #0.5 #0.1 ##f
    \draw-circle #0.2 #0.1 ##f
    \bold \with-color #red "Hi"
  }
  "some text"
}

\markup {
  "some text"
  \override #'(last-arg-at-baseline? . #t)
  \combine-xy-centered {
    \draw-circle #2 #0.1 ##f
    \draw-circle #1.7 #0.1 ##f
    \draw-circle #1.4 #0.1 ##f
    \draw-circle #1.1 #0.1 ##f
    \draw-circle #0.8 #0.1 ##f
    \draw-circle #0.5 #0.1 ##f
    \draw-circle #0.2 #0.1 ##f
    \bold \with-color #red "Hi"
  }
  "some text"
}



Bin momentan zu müde für weitere Erklärungen.
Falls Du Fragen hast - - morgen ;)

Gruß,
  Harm

Manuela

Danke für eure Antworten. Ich melde mich wieder, sobald ich mich mit euren Vorschlägen und Lösungen beschäftigt habe, das wird aber wahrscheinlich bis zum WE dauern.