-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathcharmap.lisp
149 lines (116 loc) · 3.38 KB
/
charmap.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
;;;; charmap.lisp
;;;;
;;;; Copyright (c) 2014 Robert Smith
;;;;
;;;; This file defines "charmaps", which are used to swap in and out
;;;; different drawing styles.
(in-package #:formulador)
;;; First, some characters.
(defconstant +box-drawings-light-horizontal+ (code-char #x2500))
(defconstant +box-drawings-light-vertical+ (code-char #x2502))
(defconstant +box-drawings-light-down-and-right+ (code-char #x250C))
(defconstant +box-drawings-light-down-and-left+ (code-char #x2510))
(defconstant +box-drawings-light-up-and-right+ (code-char #x2514))
(defconstant +box-drawings-light-up-and-left+ (code-char #x2518))
;;; Vinculum Charmaps
(defvar *ascii-vinculum-charmap* #\-)
(defvar *unicode-vinculum-charmap* +box-drawings-light-horizontal+)
;;; Paren Charmaps
(defstruct paren-charmap
small-open
small-close
top-open
middle-open
bottom-open
top-close
middle-close
bottom-close)
(defvar *ascii-paren-charmap*
(make-paren-charmap
:small-open #\(
:small-close #\)
:top-open #\/
:middle-open #\|
:bottom-open #\\
:top-close #\\
:middle-close #\|
:bottom-close #\/))
(defvar *ascii-absolute-value-charmap*
(make-paren-charmap
:small-open #\|
:small-close #\|
:top-open #\|
:middle-open #\|
:bottom-open #\|
:top-close #\|
:middle-close #\|
:bottom-close #\|))
(defvar *unicode-absolute-value-charmap*
(make-paren-charmap
:small-open #\|
:small-close #\|
:top-open +box-drawings-light-vertical+
:middle-open +box-drawings-light-vertical+
:bottom-open +box-drawings-light-vertical+
:top-close +box-drawings-light-vertical+
:middle-close +box-drawings-light-vertical+
:bottom-close +box-drawings-light-vertical+))
(defvar *unicode-paren-charmap*
(make-paren-charmap
:small-open #\(
:small-close #\)
:top-open (code-char #x239B)
:middle-open (code-char #x239C)
:bottom-open (code-char #x239D)
:top-close (code-char #x239E)
:middle-close (code-char #x239F)
:bottom-close (code-char #x23A0)))
(defvar *unicode-bracket-charmap*
(make-paren-charmap
:small-open #\[
:small-close #\]
:top-open (code-char #x23A1)
:middle-open (code-char #x23A2)
:bottom-open (code-char #x23A3)
:top-close (code-char #x23A4)
:middle-close (code-char #x23A5)
:bottom-close (code-char #x23A6)))
(defstruct frame-charmap
top-left-corner
top-right-corner
bottom-left-corner
bottom-right-corner
left-edge
right-edge
top-edge
bottom-edge)
(defvar *ascii-plain-frame-charmap*
(make-frame-charmap
:top-left-corner #\+
:top-right-corner #\+
:bottom-left-corner #\+
:bottom-right-corner #\+
:left-edge #\|
:right-edge #\|
:top-edge #\-
:bottom-edge #\-))
(defvar *macsyma-frame-charmap*
(make-frame-charmap
:top-left-corner #\"
:top-right-corner #\"
:bottom-left-corner #\"
:bottom-right-corner #\"
:left-edge #\"
:right-edge #\"
:top-edge #\"
:bottom-edge #\"))
(defvar *unicode-plain-frame-charmap*
(make-frame-charmap
:top-left-corner +box-drawings-light-down-and-right+
:top-right-corner +box-drawings-light-down-and-left+
:bottom-left-corner +box-drawings-light-up-and-right+
:bottom-right-corner +box-drawings-light-up-and-left+
:left-edge +box-drawings-light-vertical+
:right-edge +box-drawings-light-vertical+
:top-edge +box-drawings-light-horizontal+
:bottom-edge +box-drawings-light-horizontal+))