]> git.donarmstrong.com Git - lilypond.git/blob - ly/text-replacements.ly
Run grand-replace (issue 3765)
[lilypond.git] / ly / text-replacements.ly
1 %%%% This file is part of LilyPond, the GNU music typesetter.
2 %%%%
3 %%%% Copyright (C) 2011--2014 Bertrand Bordage <bordage.bertrand@gmail.com>
4 %%%%
5 %%%% LilyPond is free software: you can redistribute it and/or modify
6 %%%% it under the terms of the GNU General Public License as published by
7 %%%% the Free Software Foundation, either version 3 of the License, or
8 %%%% (at your option) any later version.
9 %%%%
10 %%%% LilyPond is distributed in the hope that it will be useful,
11 %%%% but WITHOUT ANY WARRANTY; without even the implied warranty of
12 %%%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 %%%% GNU General Public License for more details.
14 %%%%
15 %%%% You should have received a copy of the GNU General Public License
16 %%%% along with LilyPond.  If not, see <http://www.gnu.org/licenses/>.
17
18 \version "2.16.0"
19
20 #(define (add-text-replacements! alist)
21    (set! text-font-defaults
22          (assoc-set! text-font-defaults 'replacement-alist
23                      (cdaar
24                       (internal-add-text-replacements (list text-font-defaults) alist)))))
25
26 #(define (include-special-characters)
27    (add-text-replacements!
28      '(;; Punctuation
29        ("&hellip;" . "…")
30        ("&ndash;" . "–")
31        ("&mdash;" . "—")
32        ("&iexcl;" . "¡")
33        ("&iquest;" . "¿")
34        ("&solidus;" . "∕") ; this is not a slash,
35                            ; contrary to what is said in Unicode.
36
37        ;; French, German and English quotes open/close
38        ("&flq;" . "‹")
39        ("&frq;" . "›")
40        ("&flqq;" . "«")
41        ("&frqq;" . "»")
42        ("&glq;" . "‚")
43        ("&grq;" . "‘")
44        ("&glqq;" . "„")
45        ("&grqq;" . "“")
46        ("&elq;" . "‘")
47        ("&erq;" . "’")
48        ("&elqq;" . "“")
49        ("&erqq;" . "”")
50
51        ;; Word dividers
52        ("&ensp;" . " ")
53        ("&emsp;" . " ")
54        ("&thinsp;" . " ")
55        ("&nbsp;" . " ")
56        ("&nnbsp;" . " ") ; narrow non-breaking space
57        ("&zwj;" . "‍")
58        ("&zwnj;" . "‌")
59        ("&middot;" . "·") ; interpunct
60
61        ;; General typography
62        ("&bull;" . "•")
63        ("&copyright;" . "©")
64        ("&registered;" . "®")
65        ("&trademark;" . "™")
66        ("&dagger;" . "†")
67        ("&Dagger;" . "‡")
68        ("&numero;" . "№")
69        ("&ordf;" . "ª")
70        ("&ordm;" . "º")
71        ("&para;" . "¶")
72        ("&sect;" . "§")
73        ("&deg;" . "°")
74        ("&numero;" . "№")
75        ("&permil;" . "‰")
76        ("&brvbar;" . "¦")
77
78        ;; Diacritics
79        ("&acute;" . "´")
80        ("&acutedbl;" . "˝")
81        ("&grave;" . "`")
82        ("&breve;" . "˘")
83        ("&caron;" . "ˇ")
84        ("&cedilla;" . "¸")
85        ("&circumflex;" . "^")
86        ("&diaeresis;" . "¨")
87        ("&macron;" . "¯")
88
89        ;; Non-ASCII Letters (Excluding Accented Letters)
90        ("&aa;" . "å")
91        ("&AA;" . "Å")
92        ("&ae;" . "æ")
93        ("&AE;" . "Æ")
94        ("&dh;" . "ð")
95        ("&DH;" . "Ð")
96        ("&dj;" . "đ")
97        ("&DJ;" . "Đ")
98        ("&l;" . "ł")
99        ("&L;" . "Ł")
100        ("&ng;" . "ŋ")
101        ("&NG;" . "Ŋ")
102        ("&o;" . "ø")
103        ("&O;" . "Ø")
104        ("&oe;" . "œ")
105        ("&OE;" . "Œ")
106        ("&s;" . "ſ")
107        ("&ss;" . "ß")
108        ("&th;" . "þ")
109        ("&TH;" . "Þ")
110
111        ;; Mathematical symbols
112        ("&plus;" . "+")
113        ("&minus;" . "−")
114        ("&times;" . "×")
115        ("&div;" . "÷")
116        ("&sup1;" . "¹")
117        ("&sup2;" . "²")
118        ("&sup3;" . "³")
119        ("&sqrt;" . "√")
120        ("&increment;" . "∆")
121        ("&infty;" . "∞")
122        ("&sum;" . "∑")
123        ("&pm;" . "±")
124        ("&bulletop;" . "∙")
125        ("&partial;" . "∂")
126        ("&neg;" . "¬")
127
128        ;; Currency symbols
129        ("&currency;" . "¤")
130        ("&dollar;" . "$")
131        ("&euro;" . "€")
132        ("&pounds;" . "£")
133        ("&yen;" . "¥")
134        ("&cent;" . "¢"))))