lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unicode accidentals vs. Markup accidentals


From: Valentin Petzel
Subject: Re: Unicode accidentals vs. Markup accidentals
Date: Mon, 16 Jan 2023 13:17:21 +0100

Hello Werner,

I quite like this, but incorporating this into my previous code I found going 
down TWO steps to be optically more pleasing. This probably because the 
\number accidentals are designed for use with with numbers, which are slightly 
higher than regular text and very bold faced. So in your example the 
accidentals just look quite chunky and big. Going down two font sizes looks 
much more elegant in my opinion:

#(define-markup-command (tsharp layout props) ()
   (interpret-markup layout props (markup #:fontsize -2 #:number "♯")))
#(define-markup-command (tflat layout props) ()
   (interpret-markup layout props (markup #:fontsize -2 #:number "♭")))
#(define-markup-command (tnatural layout props) ()
   (interpret-markup layout props (markup #:fontsize -2 #:number "♮")))

#(define-markup-command (with-sharp layout props m) (markup?)
   (interpret-markup layout props (markup #:concat (m #:tsharp))))
#(define-markup-command (with-flat layout props m) (markup?)
   (interpret-markup layout props (markup #:concat (m #:tflat))))
#(define-markup-command (with-natural layout props m) (markup?)
   (interpret-markup layout props (markup #:concat (m #:tnatural))))

#(define-markup-command (with-sharp-between layout props m1 m2) (markup? 
markup?)
   (interpret-markup layout props (markup #:concat (m1 #:tsharp m2))))
#(define-markup-command (with-flat-between layout props m1 m2) (markup? markup?)
   (interpret-markup layout props (markup #:concat (m1 #:tflat m2))))
#(define-markup-command (with-natural-between layout props m1 m2) (markup? 
markup?)
   (interpret-markup layout props (markup #:concat (m1 #:tnatural m2))))

\markup { A C with a \tsharp can be written \with-sharp-between C ,
          a C with a \tnatural can be written \with-natural C and
          a C with a \tflat can be written \with-flat-between C . }

\new Staff {
  \override TextScript.before-line-breaking =
  #(lambda (grob)
     (ly:grob-set-property! grob 'text
                            (markup #:replace
                                    `(("♭" . ,#{ \markup{ \tflat} #})
                                      ("♯" . ,#{ \markup{ \tsharp} #})
                                      ("♮" . ,#{ \markup{ \tnatural} #}))
                                    (ly:grob-property grob 'text))))
  c'1^"B♭"
  c'1^"C♯"
  c'1^"D♮"
}

Cheers, Valentin

Am Montag, 16. Jänner 2023, 09:31:54 CET schrieb Werner LEMBERG:
> > Lilypond ships with a text font as well as a music font.  I agree
> > that I suspect that currently Lilypond's text font does not actually
> > define these Unicode music characters, so it falls back on the OS to
> > find them.  Why not just add copies of Emmentaler glyphs to the
> > Lilypond text fonts for characters within the Unicode spec?
> 
> 
> IMHO, there is zero benefit of doing that.  I guess one of the first
> action a slightly more advanced user does is to change the default
> fonts to something else, because the default is not 'sexy' enough to
> most people.  Irrespective of that it would be an additional burden to
> us to maintain such modifications.
> 
> 
> > I also don't think it's unreasonable to suggest that the default
> > typography should look good.
> 
> 
> No question – I think the default *does* look good, as demonstrated in
> my previous e-mail.
> 
> 
> > I hope we can agree that the output on staves 1 & 2 is significantly
> > worse than the output on staff 3 (attached picture if it doesn't
> > display inline for you).
> 
> 
> Yes, but you are using the wrong commands.  Have you actually noticed
> the example I've sent in my last e-mail?
> 
> 
> > Staves 1&2 are Unicode and default markup glyphs as in my original
> > post (compiled on Windows). To get staff 3 the following is
> > required:
> > 
> > \new Staff {
> > 
> >     c'1^\markup\concat\vcenter { B \hspace #0.2 \fontsize #-1.5 \flat }
> >     c'1^\markup\concat\vcenter { C \hspace #0.1 \fontsize #-2 \sharp }
> >     c'1^\markup\concat\vcenter { D \hspace #0.2 \fontsize #-1.5 \natural
> >     }
> >   
> >   }
> > 
> > 
> > IMO Staff 3 should be the default output, not something that
> > requires so much tweaking.
> 
> 
> I rather suggest the following
> 
> ```
> F = \markup { \smaller \number ♭ }
> S = \markup { \smaller \number ♯ }
> N = \markup { \smaller \number ♮ }
> 
> \new Staff {
>   c'1^\markup \concat { B \F }
>   c'1^\markup \concat { C \S }
>   c'1^\markup \concat { D \N }
> }
> ```
> 
> If you look more closely, the accidentals produced by `\number` are
> different from the ones produced by `\flat` and friends.  The former
> are mainly for text markup and thus have more reasonable metric
> values, while the latter are suited mainly for non-text markup.
> 
> BTW, the new text accidentals are new in version 2.24.
> 
> 
>     Werner

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]