]> git.donarmstrong.com Git - lilypond.git/blob - scm/encoding.scm
Run grand-replace for 2009.
[lilypond.git] / scm / encoding.scm
1 ;;;; encoding.scm -- font encoding
2 ;;;;
3 ;;;;  source file of the GNU LilyPond music typesetter
4 ;;;;
5 ;;;; (c) 2004--2009 Jan Nieuwenhuizen <janneke@gnu.org>
6
7 (define-public latin1-coding-vector
8   #(.notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef
9     .notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef
10     .notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef
11     .notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef
12     %% 0x20
13     space exclam quotedbl numbersign dollar percent ampersand quoteright
14     parenleft parenright asterisk plus comma hyphen period slash
15     zero one two three four five six seven
16     eight nine colon semicolon less equal greater question
17     %% 0x40
18     at A B C D E F G
19     H I J K L M N O
20     P Q R S T U V W
21     X Y Z bracketleft backslash bracketright asciicircum underscore
22     %% 0x60
23     `quoteleft a b c d e f g
24     h i j k l m n o
25     p q r s t u v w
26     x y z braceleft bar braceright asciitilde .notdef
27     %% 0x80
28     .notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef
29     .notdef .notdef .notdef .notdef .notdef .notdef .notdef .notdef
30     dotlessi grave acute circumflex tilde macron breve dotaccent
31     dieresis .notdef ring cedilla .notdef hungarumlaut ogonek caron
32     %% 0xA0
33     space exclamdown cent sterling currency yen brokenbar section
34     dieresis copyright ordfeminine guillemotleft logicalnot hyphen registered macron
35     degree plusminus twosuperior threesuperior acute mu paragraph periodcentered
36     cedilla onesuperior ordmasculine guillemotright onequarter onehalf threequarters questiondown
37     %% 0xC0
38     Agrave Aacute Acircumflex Atilde Adieresis Aring AE Ccedilla
39     Egrave Eacute Ecircumflex Edieresis Igrave Iacute Icircumflex Idieresis
40     Eth Ntilde Ograve Oacute Ocircumflex Otilde Odieresis multiply
41     Oslash Ugrave Uacute Ucircumflex Udieresis Yacute Thorn germandbls
42     %% 0xE0
43     agrave aacute acircumflex atilde adieresis aring ae ccedilla
44     egrave eacute ecircumflex edieresis igrave iacute icircumflex idieresis
45     eth ntilde ograve oacute ocircumflex otilde odieresis divide
46     oslash ugrave uacute ucircumflex udieresis yacute thorn ydieresis))
47
48
49 (define-public (decode-byte-string str)
50   "Return vector of glyphname symbols that correspond to string,
51 assuming that STR is byte-coded using ENCODING-NAME."
52
53   (let* ((len (string-length str))
54          (output-vector (make-vector len '.notdef)))
55     (do
56         ((idx 0 (1+ idx)))
57         ((>= idx len) output-vector)
58       (vector-set! output-vector idx
59                    (vector-ref latin1-coding-vector
60                                (char->integer (string-ref str idx)))))))