Using arbitrary markup as lyric hyphen: Difference between revisions

m Lemzwerg moved page Using any arbitrary markup as LyricHyphen to Using arbitrary markup as lyric hyphen without leaving a redirect
m Remove outdated comments
Line 1: Line 1:
Lyric hyphens have several user-modifiable properties such as length and thickness; this doesn’t allow, however, for further tweaking, for example, rendering hyphens as rounded boxes to better match the font possibly used for <code>LyricText</code>, or even printing hyphens as actual glyphs rather than drawing basic boxes.
Lyric hyphens have several user-modifiable properties such as length and thickness; this doesn’t allow, however, for further tweaking, for example, rendering hyphens as rounded boxes to better match the font possibly used for <code>LyricText</code>, or even printing hyphens as actual glyphs rather than drawing basic boxes.


This snippet rewrites the <code>LyricHyphen</code> stencil procedure to use a proper glyph… or indeed any arbitrary markup.
This snippet rewrites the <code>LyricHyphen</code> stencil procedure to use a proper glyph – or indeed any arbitrary markup.


<lilypond version="2.24" full>
<lilypond version="2.24">
%% Originally contributed by Aaron Hill:
% Originally contributed by Aaron Hill:
%% https://lists.gnu.org/archive/html/lilypond-user/2019-03/msg00257.html
% https://lists.gnu.org/archive/html/lilypond-user/2019-03/msg00257.html


#(define (lyric-hyphen-text-stencil grob)
#(define (lyric-hyphen-text-stencil grob)
Line 95: Line 95:
   Lo -- rem ip -- sum do -- lor sit a -- met.
   Lo -- rem ip -- sum do -- lor sit a -- met.
    
    
%%  \mark \markup { "LyricHyphen.text is " \circle  \with-color #red "&" }
   \mark \markup { "LyricHyphen.text is " \circle \with-color #red "♥" }
   \mark \markup { "LyricHyphen.text is " \circle \with-color #red "♥" }
   \override LyricHyphen.text = \markup \circle \with-color #red "♥"
   \override LyricHyphen.text =  
    \markup
      \circle \with-color #red  
      %% For unknown reason "\xe2\x99\xa5", which is "♥", U+2665, does not work in LSR,
      %% replacing it with "&"
      %% Outside of LSR it works -- Harm
      %%
      %% Outside LSR it's possible to use "♥" directly for guile-v1 and guile-v2  --Harm (May 2022)
      %% #"&"
      #"♥"
   \override LyricText.font-size = #3
   \override LyricText.font-size = #3
   Lo -- rem ip -- sum do -- lor sit a -- met.
   Lo -- rem ip -- sum do -- lor sit a -- met.
      %% Same here for "\xe2\x89\x8b", which is "≋", U+224B, does not work in LSR,
      %% replacing it with "~"
      %% Outside of LSR it works -- Harm
      %%
      %% Outside LSR it's possible to use "≋" directly for guile-v1 and guile-v2  --Harm (May 2022)


   \mark \markup { "LyricHyphen.text is blue" \with-color #blue #"≋" }
   \mark \markup { "LyricHyphen.text is blue" \with-color #blue #"≋" }
   \override LyricHyphen.text =  
   \override LyricHyphen.text =  
     \markup
     \markup \scale #'(3 . 1) \with-color #blue #"≋"
      \scale #'(3 . 1) \with-color #blue #"≋"
   \override LyricText.font-size = #6
   \override LyricText.font-size = #6
   Break -- ing
   Break -- ing