Jump to content

Eyeglasses as markup (postscript)

From LilyPond wiki
Revision as of 22:42, 26 October 2025 by Jean Abou Samra (talk | contribs) (Import snippet from LSR)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

To insert eyeglasses into a score (strongly indicating that one should look at the conductor), one has to insert self-defined postscript code as a markup.

\version "2.24.0"

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

% The postscript code to produce eyeglasses:
eyeglassesps = #"0.15 setlinewidth
-0.9 0 translate
1.1 1.1 scale
1.2 0.7 moveto
0.7 0.7 0.5 0 361 arc
stroke
2.20 0.70 0.50 0 361 arc
stroke
1.45 0.85 0.30 0 180 arc
stroke
0.20 0.70 moveto
0.80 2.00 lineto
0.92 2.26 1.30 2.40 1.15 1.70 curveto
stroke
2.70 0.70 moveto
3.30 2.00 lineto
3.42 2.26 3.80 2.40 3.65 1.70 curveto
stroke"

eyeglasses =  \markup { 
  \with-dimensions #'(0 . 4.4) #'(0 . 2.5) 
  \postscript #eyeglassesps 
}

\relative c'' { c2^\eyeglasses  a2_\eyeglasses }