Jump to content

Adjusting vertical positioning of lyric hyphens: Difference between revisions

From LilyPond wiki
Revert usage of `property-defaults`; this is only available starting with version 2.25.5.
thickness
Line 2: Line 2:


You can adjust the vertical positioning of the hyphens manually. To get a good result you may want to insert a “real” hyphen for comparison (like between l-e in the snippet).
You can adjust the vertical positioning of the hyphens manually. To get a good result you may want to insert a “real” hyphen for comparison (like between l-e in the snippet).
Also, you may want to adjust the thickness of the Hyphens:  LyricHyphen.thickness


<lilypond version="2.24">
<lilypond version="2.24">
Line 26: Line 28:
       \Lyrics
       \Lyrics
       \override LyricHyphen.Y-offset = #0.16
       \override LyricHyphen.Y-offset = #0.16
      \override LyricHyphen.thickness = #2.1
     }
     }
   }
   }

Revision as of 08:03, 2 March 2026

For joining syllables, LilyPond doesn’t use the hyphen of the text font but instead draws a simple line with variable length (this limitation is tracked as Issue #1255). Its standard vertical position doesn’t always fit the proportions of the text font. When using a font with a large x-height, it may be too low.

You can adjust the vertical positioning of the hyphens manually. To get a good result you may want to insert a “real” hyphen for comparison (like between l-e in the snippet).

Also, you may want to adjust the thickness of the Hyphens: LyricHyphen.thickness

\version "2.24"

% LSR contributed by Hannes Kuhnert <hannes.kuhnert@gmx.de> 1.2.2012.

\score {
  <<
    \new Voice = "Lied" {
      \relative {
        \clef G
        \key c \major
        e'2 d c1
      }
    }

    \new Lyrics = "Lied"
    \lyricsto Lied {
      La -- l-e -- lu.
    }
  >>

  \layout {
    \context {
      \Lyrics
      \override LyricHyphen.Y-offset = #0.16
      \override LyricHyphen.thickness = #2.1
    }
  }
}

\paper {
  #(define fonts
    (make-pango-font-tree
     "Serif"
     "Sans"
     "Monospace"
     (/ 20 20)))
}