-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtableau-icons.typ
54 lines (49 loc) · 1.15 KB
/
tableau-icons.typ
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
#import "./_tableau-icons-ref.typ": *
/// Renders a tabular icon
///
/// - body (str): icon name
/// - fill (color): color of the icon
/// - width (length): width of the icon (icon is contained)
/// - height (length): height of the icon (icon is contained)
/// -> the desired icon with the parameters applied
///
///
///
/// - body (str): icon name
/// - fill (color): width of the icon (icon is contained)
/// - height (length): height of the icon (icon is contained)
/// - width ():
/// - args ():
/// ->
#let draw-icon(body, fill: rgb("#000000"), height: 1em, width: auto, ..args) = {
if (type(body) != str) {
panic("icon name not set")
}
if width == auto {
width = height
}
box(
height: height,
width: width,
align(
center + horizon,
if body in _tabler-icons-unicode {
text(
bottom-edge: "descender",
font: "tabler-icons",
fill: fill,
size: calc.min(height, width),
_tabler-icons-unicode.at(body),
)
} else {
text(
fill: red,
weight: "bold",
size: height,
[X],
)
},
),
..args,
)
}