lilypond-devel
[Top][All Lists]
Advanced

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

Special characters: make text-replacements list longer


From: PNEU
Subject: Special characters: make text-replacements list longer
Date: Sat, 12 Apr 2014 17:23:53 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Dear LilyPond Community,


I would like to suggest a little enhancement to make special characters
easier to insert.

I was getting tired of using these methods (c \mark \markup {\concat {"B"
\char ##xd6 "u" \char ##x159 "r" \char ##xe9 "e"} –_&OE;&hellip }) to
insert special characters in my lyrics, titles etc.

So I changed my text-replacements.ly file to this (see below 1), changing
all characters to their equivalent in I-dont-know-what other encoding. It
works surprisingly well! You just have to enter the characters in plain text
in LilyPad and out they come in the PDF.

I did have an interference with the default tagline -- the dash would not
get printed -- so I changed my default tagline accordingly (in file
titling-init.ly), see below 2.



If it is not too risky you might really consider switching the default
text-replacement.ly file to this. Indeed it is currently really difficult
for French / German / Spanish etc users to insert special characters in
LilyPond.


Thanks a lot, good luck,
PNEU





##### \LilyPond 2.18.2\usr\share\lilypond\current\ly\text-replacements.ly #####

\version "2.16.0"

#(define (add-text-replacements! alist)
   (set! text-font-defaults
         (assoc-set! text-font-defaults 'replacement-alist
                     (cdaar
                      (internal-add-text-replacements (list text-font-defaults) 
alist)))))

#(define (include-special-characters)
   (add-text-replacements!
     '(;; Punctuation
       ("…" . "…")
       ("–" . "–")
       ("—" . "—")
       ("¡" . "¡")
       ("¿" . "¿")
       ("&solidus;" . "∕") ; this is not a slash,
                           ; contrary to what is said in Unicode.

       ;; French, German and English quotes open/close
       ("&flq;" . "‹")
       ("&frq;" . "›")
       ("&flqq;" . "«")
       ("&frqq;" . "»")
       ("&glq;" . "‚")
       ("&grq;" . "‘")
       ("&glqq;" . "„")
       ("&grqq;" . "“")
       ("&elq;" . "‘")
       ("&erq;" . "’")
       ("&elqq;" . "“")
       ("&erqq;" . "”")

       ;; Word dividers
       (" " . " ")
       (" " . " ")
       (" " . " ")
       (" " . " ")
       ("&nnbsp;" . " ") ; narrow non-breaking space
       ("‍" . "‍")
       ("‌" . "‌")
       ("·" . "·") ; interpunct

       ;; General typography
       ("•" . "•")
       ("&copyright;" . "©")
       ("&registered;" . "®")
       ("&trademark;" . "â„¢")
       ("†" . "†")
       ("‡" . "‡")
       ("№" . "â„–")
       ("ª" . "ª")
       ("º" . "º")
       ("¶" . "¶")
       ("§" . "§")
       ("°" . "°")
       ("№" . "â„–")
       ("‰" . "‰")
       ("¦" . "¦")

       ;; Diacritics
       ("´" . "´")
       ("&acutedbl;" . "˝")
       ("`" . "`")
       ("˘" . "˘")
       ("ˇ" . "ˇ")
       ("&cedilla;" . "¸")
       ("&circumflex;" . "^")
       ("&diaeresis;" . "¨")
       ("&macron;" . "¯")

       ;; Non-ASCII Letters (Excluding Accented Letters)
       ("&aa;" . "Ã¥")
       ("&AA;" . "Ã…")
       ("&ae;" . "æ")
       ("&AE;" . "Æ")
       ("&dh;" . "ð")
       ("&DH;" . "Ð")
       ("&dj;" . "Ä‘")
       ("&DJ;" . "Đ")
       ("&l;" . "Å‚")
       ("&L;" . "Ł")
       ("&ng;" . "Å‹")
       ("&NG;" . "ÅŠ")
       ("&o;" . "ø")
       ("&O;" . "Ø")
       ("&oe;" . "Å“")
       ("&OE;" . "Å’")
       ("&s;" . "Å¿")
       ("&ss;" . "ß")
       ("&th;" . "þ")
       ("&TH;" . "Þ")

       ;; Mathematical symbols
       ("+" . "+")
       ("−" . "−")
       ("×" . "×")
       ("÷" . "÷")
       ("¹" . "¹")
       ("²" . "²")
       ("³" . "³")
       ("&sqrt;" . "√")
       ("&increment;" . "∆")
       ("&infty;" . "∞")
       ("∑" . "∑")
       ("±" . "±")
       ("&bulletop;" . "∙")
       ("&partial;" . "∂")
       ("&neg;" . "¬")

       ;; Currency symbols
       ("&currency;" . "¤")
       ("$" . "$")
       ("€" . "€")
       ("&pounds;" . "£")
       ("¥" . "Â¥")
       ("¢" . "¢")

         
       
        ;; My symbols, added
        ("¡" . "Ž")
        ("¢" . "¢")
        ("£" . "£")
        ("¥" . "Â¥")
        ("¦" . "Ĭ")
        ("§" . "§")
        ("¨" . "Ŭ")
        ("©" . "©")
        ("ª" . "Ǧ")
        ("«" . "«")
        ("¬" . "ÅŠ")
        ("­" . "­")
        ("®" . "®")
        ("¯" . "Ç‘")
        ("°" . "°")
        ("±" . "ž")
        ("²" . "²")
        ("³" . "³")
        ("´" . "´")
        ("µ" . "µ")
        ("¶" . "Ä­")
        ("·" . "·")
        ("¸" . "Å­")
        ("¹" . "¹")
        ("º" . "ǧ")
        ("»" . "»")
        ("¼" . "Å‹")
        ("½" . "½")
        ("¾" . "Ÿ")
        ("¿" . "Ç’")
        ("À" . "À")
        ("Á" . "Ã")
        ("Â" . "Â")
        ("Ã" . "Ã")
        ("Ä" . "Ä")
        ("Å" . "Ã…")
        ("Æ" . "Æ")
        ("Ç" . "Ç")
        ("È" . "È")
        ("É" . "É")
        ("Ê" . "Ê")
        ("Ë" . "Ë")
        ("Ì" . "ÃŒ")
        ("Í" . "Ã")
        ("Î" . "ÃŽ")
        ("Ï" . "Ã")
        ("Ð" . "Äž")
        ("Ñ" . "Ñ")
        ("Ò" . "Ã’")
        ("Ó" . "Ó")
        ("Ô" . "Ô")
        ("Õ" . "Õ")
        ("Ö" . "Ö")
        ("×" . "Ã")
        ("Ø" . "ÆŸ")
        ("Ù" . "Ù")
        ("Ú" . "Ú")
        ("Û" . "Û")
        ("Ü" . "Ãœ")
        ("Ý" . "Ä°")
        ("Þ" . "Åž")
        ("ß" . "ß")
        ("à" . "à")
        ("á" . "á")
        ("â" . "â")
        ("ã" . "ã")
        ("ä" . "ä")
        ("å" . "Ã¥")
        ("æ" . "É™")
        ("ç" . "ç")
        ("è" . "è")
        ("é" . "é")
        ("ê" . "ê")
        ("ë" . "ë")
        ("ì" . "ì")
        ("í" . "í")
        ("î" . "î")
        ("ï" . "ï")
        ("ð" . "ÄŸ")
        ("ñ" . "ñ")
        ("ò" . "ò")
        ("ó" . "ó")
        ("ô" . "ô")
        ("õ" . "õ")
        ("ö" . "ö")
        ("÷" . "ý")
        ("ø" . "ɵ")
        ("ù" . "ù")
        ("ú" . "ú")
        ("û" . "û")
        ("ü" . "ü")
        ("ý" . "ı")
        ("þ" . "ÅŸ")
        ("ÿ" . "ÿ")
        ("Œ" . "ÂŒ")
        ("œ" . "Âœ")
        ("Š" . "Š")
        ("š" . "š")
        ("Ÿ" . "Ÿ")
        ("ƒ" . "ƒ")
        ;("–" . "–") 
        ;("—" . "—")
        ("‘" . "‘")
        ("’" . "Â’")
        ("‚" . "‚")
        ("“" . "“")
        ("”" . "”")
        ("„" . "„")
        ("†" . "†")
        ("‡" . "‡")
        ("•" . "•")
        ("…" . "Â…")
        ("‰" . "‰")
        ("€" . "€")
        ("™" . "™"))))





###### in file \LilyPond
2.18.2\usr\share\lilypond\current\ly\titling-init.ly ######


tagline = \markup {
  \pad-to-box #'(0 . 0) #'(0 . 3)
  {  \with-url

    #"http://lilypond.org/";
    \line {

      %% 2014 = em dash.

      #(format #f "Music engraving by LilyPond ~a -- www.lilypond.org"
         (lilypond-version)
         )
    }
  }
}




reply via email to

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