On Sat, 16 Apr 2005 16:05:37 +0200 Han-Wen Nienhuys <[EMAIL PROTECTED]> wrote:
> Op za, 16-04-2005 te 15:12 -0300, schreef Jonatan Liljedahl: > > > This sounds like a good idea. Probably the arrow drawing should be > > > done by the line-interface code, because arrows are a generic > > > thing to have on lines. > > > > Yes, I'll see what I can do. Is make_line() and make_dashed_line() > > only used by the Line_interface::line() function? (so that it's Ok > > to add an extra argument to make_line() to tell it about the > > arrow...) > > I don't know - grep the source code. It might be easier to make an > add_arrow_endings() function, which does not need to know about the > line style (dashed, etc.) or thickness. Ok, I'll attach my patch with this mail. Apply with "patch -p0 < arrow_lijon.patch". I think I have managed to set all grobs defaults to NOT use any arrows, so that glissandos and tuplet brackets and stuff like that doesn't get arrowheads... One problem (?) is that arrows are drawn also on lines that are broken when the staff continues on the next line. Maybe this is the right thing, in the same way that hairpins behaves; they are as big at the broken end as the real end, if you understand what I mean... Below is an example use: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \version "2.5.18" %% Some shortcuts #(define (arrow a b) (ly:export #{ \override TextSpanner #'edge-text = #(cons $a $b) \override TextSpanner #'dash-fraction = #'() \override TextSpanner #'style = #'line \override TextSpanner #'arrow = ##t #} ) ) bts = \startTextSpan ets = \stopTextSpan %% EXAMPLE \relative c'' { #(arrow "foo" "bar") a8\bts gis8\< a2. c,4\glissando g'\! c\ets c } %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Another problem is that I get near zero padding between the line and the edge texts. But this was the same without my arrow.. > > > > Another solution would be to put the arrow in the end edge text, > > > > and translate it to the left a bit... Is it possible to include > > > > markup (with > > > > \stencil code-to-draw-arrowhead) in the edge texts somehow? > > > > > > I'm not sure it will work. There is padding (bound-padding > > > property) between the text and the line, > > > but you could give it a try. > > > > I tried putting markup in the edge texts but they came out verbatim. > > > > Try something like > > \override ... #'edge-text = #(cons (make-bold-markup "foo") '() ) Thanks! That worked. I tried to put the arrow in the end text, but I got problems with translation of the arrowhead as the endtext is centered and the position is dependant of the characters in the text. /Jonatan -=( http://kymatica.com )=-
arrow_lijon.patch.gz
Description: Binary data
arrowtest.png
Description: Binary data
_______________________________________________ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user