lilypond-user
[Top][All Lists]
Advanced

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

Re: Swedish letters in Lilypond lyrics?


From: Simon Albrecht
Subject: Re: Swedish letters in Lilypond lyrics?
Date: Tue, 19 Jan 2016 22:37:02 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1

On 19.01.2016 22:34, David Kastrup wrote:
address@hidden writes:

David Kastrup:
address@hidden writes:
David Kastrup:
address@hidden writes:
...
BTW, does someone know why add-text-replacements in attached file
doesn't work ?
  I got the syntax from:
http://www.gnu.org/software/guile/manual/html_node/String-Syntax.html#String-Syntax
That's the Guile-2.0 manual.  LilyPond uses 1.8 at the moment.
Hmm, so basically it can't be done.
Nonsense.  You just need to use octal escapes for the actual UTF-8 byte
sequences.  And you'll probably need to revisit that input once
Guile-2.0 actually gets used: I don't think there is an obvious
"portable" way to do it.
So, if neither of the ;-commented out lines below work, what do I do?

\paper {
   #(include-special-characters)

   #(add-text-replacements!
     '(
       ("100" . "hundred")
       ("dpi" . "dots per inch")
       ;(":a" . "\u00E4" )
       ;(":b" . "\x00\xE4" )
       ;(":c" . (list->string (\x00 \xE4)) )
       ;(":d" . $ \markup \char ##x00E4 $ )
     ))
}
Uh, do you actually know what UTF-8 is?  \x00\xE4 would rather be
UTF-16BE.  The UTF-8 byte sequence is "\xc3\xa4" instead which works.
\x00 is not a valid number or character and you use it like a function
call because of failing to quote.  #\000 would be a character, but it
needs to be in octal, so we are talking here about
(list->string '(#\303 #\244))

$ is not a valid method to escape from Scheme into LilyPond but rather
the other way round.

#{ \markup \char ##x00e4 #} does not work since markup commands like
\char are only evaluated at markup interpretation time.

You can use (ly:char->utf8 #x00e4) instead.

So, forget my question :-)



reply via email to

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