[Top][All Lists]

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

Re: New alist to replace special characters. (issue4553056)

From: address@hidden
Subject: Re: New alist to replace special characters. (issue4553056)
Date: Mon, 23 May 2011 12:56:51 +0200

On May 23, 2011, at 12:38 PM, address@hidden wrote:

> This prints every character with its shorthand, but works bad because of
> '\t', '\v' and '\n' :
> \version "2.15.0"
> \include ""
> #(define-markup-list-command (show-special-characters layout props) ()
>                             (interpret-markup-list layout props
>                               (map (lambda (pair)
>                                            (markup #:fill-line (
>                                                #:null
>                                                #:override
> '(replacement-string-max-length . 0)
>                                                (car pair)
>                                                (car pair)
>                                                #:null)))
>                                    special-characters-alist)))
> \markuplines \show-special-characters

Good work!

A couple things :

(1)     If I want to write "\emdash is a command in lilypond", that won't work 
(I think) with this patch.  You need to create either a ("\\\\" . "\\") special 
character or another workaround for the backslash.
(2)     For ligatures that arrive at the end of the word like in some German 
texts, you'll need to figure out where the ligature falls in the word.  Writing 
a single exception to do this in C++ is easy, but if ligatures are any hairier 
than this (i.e. if in Nabakov's Zemblan there is an ie ligature except after 
c), then you'd be better off porting the whole thing to Scheme and doing it via 
regular expressions or some other sorta text replacement algorithm.  The added 
advantage of this is that users can specify their own rules.
(3)     Newbs will invariably learn about this feature, want to use it, and 
then complain that the ligature they want is in a different font than Century 
Schoolbook in the PDF.  Perhaps lilypond should issue a warning if a character 
is found in a font that is not the one you currently have selected like 
"Warning: Charater `foo' found, but not in the current font."


reply via email to

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