lilypond-user
[Top][All Lists]
Advanced

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

Re: Advice on glyph construction


From: Torsten Hämmerle
Subject: Re: Advice on glyph construction
Date: Sun, 18 Feb 2018 06:03:28 -0700 (MST)

Hi Andrew,

It's quite annoying that the Unicode characters differ in size and bounding
box (surprisingly, there is no matching circle among the Geometric Shapes
U+25A0 to U+25FF)...


Andrew Bernard wrote
> [...] but I can't figure out how to get the rightmost Unicode glyph to sit
> further down [...]

That's easy: you'll have to set 
TextSpanner.bound-details.right.stencil-align-dir-y = #CENTER
(in your example, only the left align dir has been set to center, that's why
the right text still sits on its baseline).

Having that done, the circles still don't align properly, because they are
slightly different in size and the empty circle has a wider bounding-box
(that's why there is a little gap between the arrow and the circle).

I often use the \box command with zero box-padding to actually see the
bounding boxes, e.g.
\markup \concat \override #'(box-padding . 0) \box { \char ##x25D0 \char
##x20DD }





Andrew Bernard wrote
> [...], and then I also need arrows off to the right of this glyph
> from time to time.

Unfortunately, the line-spanner uses a custom arrow head
(Line_interface::make_arrow) that strongly differs from the standard
\arrow-head markups.
It can be mimicked by using a rotated and scaled triangle, though.

All in all, I've set up two simple \markup definitions (adjusting bounding
box and size of the circles and adding an artificial markup arrow.
It's not a proper solution (manual tweaking involved and with another font,
Unicode characters may behave completely different), but, well, it's a
simple solution using nothing but run-of-the-mill markup:

~~~
\version "2.19.81"

halfCircle = \markup { \hspace #.21 \char ##x25D0 \hspace #0.21 }
emptyCircleArrow = \markup \concat { \lower #.27 \scale #'(1.075 . 1.075)
\char ##x20DD 
                                     \hspace #0.2
                                     \rotate #-90 \lower #0.03 \scale
#'(0.38 . 0.6) \triangle ##t }

 {
  \override TextSpanner.style = #'line
  \override TextSpanner.bound-details.left.stencil-align-dir-y = #CENTER
  \override TextSpanner.bound-details.left.text = \markup \halfCircle
  \override TextSpanner.bound-details.right.stencil-align-dir-y = #CENTER
  \override TextSpanner.bound-details.right.text = \markup \emptyCircleArrow
  \override TextSpanner.bound-details.right.arrow = ##t
  c'4\startTextSpan
  c' c' c' |
  c' c' c' c'\stopTextSpan |
}

circle-markup.png
<http://lilypond.1069038.n5.nabble.com/file/t3887/circle-markup.png>  


HTH,
Torsten



--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html



reply via email to

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