1 ;;;; encoding.scm -- font encoding
3 ;;;; source file of the GNU LilyPond music typesetter
5 ;;;; (c) 2004--2008 Jan Nieuwenhuizen <janneke@gnu.org>
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
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
21 X Y Z bracketleft backslash bracketright asciicircum underscore
23 `quoteleft a b c d e f g
26 x y z braceleft bar braceright asciitilde .notdef
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
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
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
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))
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."
53 (let* ((len (string-length str))
54 (output-vector (make-vector len '.notdef)))
57 ((>= idx len) output-vector)
58 (vector-set! output-vector idx
59 (vector-ref latin1-coding-vector
60 (char->integer (string-ref str idx)))))))