Hi List, hi Schemers,

I'm currently working on finding new tools to ease drawings with the 'path'
command.
I already found some nice ones that helped me to create new drawings and
enhanced old snippets.
That's what I've done here: http://lsr.di.unimi.it/LSR/Item?id=904

However, I'm not satisfied with the code I'm using there; here's roughly
how it's working:

\version "2.18.2"

%% hereunder works fine:
#(define-markup-command (smiley layout props smiley-choice)
  (number?)
  (interpret-markup layout props
    (case smiley-choice
      ((1)
        #{
           \markup "A"
        #})
      ((2)
        #{
           \markup "smile"
        #})
      (else
        #{
           \markup
           \null
        #})
      )))

%% Test:
\markup\column {
  \smiley #1
  \smiley #2
  \smiley #10
}

%% But I think It would be much better to use:
#(define-markup-command (smiley-string layout props smiley-choice)
  (string?)
  (interpret-markup layout props
    (case smiley-choice
      (("A")
        #{
           \markup "A"
        #})
      ((":)")
        #{
           \markup "smile"
        #})
      (else
        #{
           \markup
           \null
        #})
      )))

%% Test:
\markup\column {
  \smiley-string #"A"
  \smiley-string #":)"
  \smiley-string #"none"
}

%%% ... does not work though.

What am I missing?

Thank you in advance,
Cheers,
Pierre
_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to