Jump to content

Flat and sharp symbols in text-markups: Difference between revisions

From LilyPond wiki
Import snippet from LSR
 
m New category
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
If you want to use flat or sharp symbols in text, you may want to adjust the horizontal and vertical position of the \flat or \sharp.
If you want to use flat or sharp symbols in text, you may want to adjust the horizontal and vertical position of the \flat or \sharp.


<lilypond version="2.24.0">
<lilypond version="2.24">
%% http://lsr.di.unimi.it/LSR/Item?id=288
%% http://lsr.di.unimi.it/LSR/Item?id=288


Line 29: Line 29:
[[Category:Text]]
[[Category:Text]]
[[Category:Workaround]]
[[Category:Workaround]]
[[Category:Snippet]]

Latest revision as of 23:26, 21 November 2025

If you want to use flat or sharp symbols in text, you may want to adjust the horizontal and vertical position of the \flat or \sharp.

\version "2.24"

%% http://lsr.di.unimi.it/LSR/Item?id=288


raisedFlat = \markup { \translate #(cons -0.4 0.5) \smaller \flat  }

\new Staff {
  \set Staff.instrumentName = \markup { 
    \center-column  {
      \line {  Solo Clar. }   
      \line { "in B"\raisedFlat } 
    }
  }
  \relative c' { 
    des1^\markup { "D" \translate #(cons -0.3 0.4) \flat "major" } ~  | des | 
    dis1^\markup { "D" \translate #(cons -0.3 0.9) \sharp "minor" } ~ | dis1 
    \bar "||"
 } 
}

\paper {
  ragged-right = ##t 
}