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: David Kastrup
Subject: Re: Swedish letters in Lilypond lyrics?
Date: Tue, 19 Jan 2016 22:34:50 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

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.

-- 
David Kastrup



reply via email to

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