src/util/gui/font-metrics.c (view raw)
1/* Copyright (c) 2013-2015 Jeffrey Pfau
2 *
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6#include "util/gui/font.h"
7
8const struct GUIFontGlyphMetric defaultFontMetrics[128] = {
9 { 0, 0, { 0, 0, 0, 0 }}, // 0x00
10 { 0, 0, { 0, 0, 0, 0 }}, // 0x01
11 { 0, 0, { 0, 0, 0, 0 }}, // 0x02
12 { 0, 0, { 0, 0, 0, 0 }}, // 0x03
13 { 0, 0, { 0, 0, 0, 0 }}, // 0x04
14 { 0, 0, { 0, 0, 0, 0 }}, // 0x05
15 { 0, 0, { 0, 0, 0, 0 }}, // 0x06
16 { 0, 0, { 0, 0, 0, 0 }}, // 0x07
17 { 0, 0, { 0, 0, 0, 0 }}, // 0x08
18 { 0, 0, { 0, 0, 0, 0 }}, // 0x09
19 { 0, 0, { 0, 0, 0, 0 }}, // 0x0A
20 { 0, 0, { 0, 0, 0, 0 }}, // 0x0B
21 { 0, 0, { 0, 0, 0, 0 }}, // 0x0C
22 { 0, 0, { 0, 0, 0, 0 }}, // 0x0D
23 { 0, 0, { 0, 0, 0, 0 }}, // 0x0E
24 { 0, 0, { 0, 0, 0, 0 }}, // 0x0F
25 { 0, 0, { 0, 0, 0, 0 }}, // 0x10
26 { 0, 0, { 0, 0, 0, 0 }}, // 0x11
27 { 0, 0, { 0, 0, 0, 0 }}, // 0x12
28 { 0, 0, { 0, 0, 0, 0 }}, // 0x13
29 { 0, 0, { 0, 0, 0, 0 }}, // 0x14
30 { 0, 0, { 0, 0, 0, 0 }}, // 0x15
31 { 0, 0, { 0, 0, 0, 0 }}, // 0x16
32 { 0, 0, { 0, 0, 0, 0 }}, // 0x17
33 { 0, 0, { 0, 0, 0, 0 }}, // 0x18
34 { 0, 0, { 0, 0, 0, 0 }}, // 0x19
35 { 0, 0, { 0, 0, 0, 0 }}, // 0x1A
36 { 0, 0, { 0, 0, 0, 0 }}, // 0x1B
37 { 0, 0, { 0, 0, 0, 0 }}, // 0x1C
38 { 0, 0, { 0, 0, 0, 0 }}, // 0x1D
39 { 0, 0, { 0, 0, 0, 0 }}, // 0x1E
40 { 0, 0, { 0, 0, 0, 0 }}, // 0x1F
41 { 8, 1, { 0, 0, 0, 0 }}, // 0x20 " "
42 { 10, 11, { 2, 3, 3, 3 }}, // 0x21 "!"
43 { 10, 5, { 2, 3, 9, 3 }}, // 0x22 """
44 { 12, 11, { 2, 2, 3, 2 }}, // 0x23 "#"
45 { 10, 13, { 1, 3, 2, 3 }}, // 0x24 "&"
46 { 14, 11, { 2, 1, 3, 1 }}, // 0x25 "%"
47 { 10, 11, { 2, 3, 3, 3 }}, // 0x26 "&"
48 { 4, 5, { 2, 6, 9, 6 }}, // 0x27 "'"
49 { 6, 11, { 2, 5, 3, 5 }}, // 0x28 "("
50 { 6, 11, { 2, 5, 3, 5 }}, // 0x29 ")"
51 { 8, 7, { 2, 4, 5, 4 }}, // 0x2A "*"
52 { 10, 9, { 3, 3, 4, 3 }}, // 0x2B "+"
53 { 4, 5, { 9, 6, 2, 6 }}, // 0x2C ","
54 { 6, 3, { 6, 4, 7, 4 }}, // 0x2D "-"
55 { 4, 4, { 9, 6, 3, 6 }}, // 0x2E "."
56 { 8, 11, { 2, 4, 3, 4 }}, // 0x2F "/"
57 { 10, 11, { 2, 3, 3, 3 }}, // 0x30 "0"
58 { 10, 11, { 2, 4, 3, 4 }}, // 0x31 "1"
59 { 10, 11, { 2, 3, 3, 3 }}, // 0x32 "2"
60 { 10, 11, { 2, 3, 3, 3 }}, // 0x33 "3"
61 { 10, 11, { 2, 3, 3, 3 }}, // 0x34 "4"
62 { 10, 11, { 2, 3, 3, 3 }}, // 0x35 "5"
63 { 10, 11, { 2, 3, 3, 3 }}, // 0x36 "6"
64 { 10, 11, { 2, 3, 3, 3 }}, // 0x37 "7"
65 { 10, 11, { 2, 3, 3, 3 }}, // 0x38 "8"
66 { 10, 11, { 2, 3, 3, 3 }}, // 0x39 "9"
67 { 4, 11, { 2, 6, 3, 6 }}, // 0x3A ":"
68 { 4, 12, { 2, 6, 2, 6 }}, // 0x3B ";"
69 { 8, 11, { 2, 4, 3, 4 }}, // 0x3C "<"
70 { 10, 7, { 4, 3, 5, 3 }}, // 0x3D "="
71 { 8, 11, { 2, 4, 3, 4 }}, // 0x3E ">"
72 { 10, 11, { 2, 3, 3, 3 }}, // 0x3F "?"
73 { 10, 11, { 2, 3, 3, 3 }}, // 0x40 "@"
74 { 10, 11, { 2, 3, 3, 3 }}, // 0x41 "A"
75 { 10, 11, { 2, 3, 3, 3 }}, // 0x42 "B"
76 { 10, 11, { 2, 3, 3, 3 }}, // 0x43 "C"
77 { 10, 11, { 2, 3, 3, 3 }}, // 0x44 "D"
78 { 10, 11, { 2, 3, 3, 3 }}, // 0x45 "E"
79 { 10, 11, { 2, 3, 3, 3 }}, // 0x46 "F"
80 { 10, 11, { 2, 3, 3, 3 }}, // 0x47 "G"
81 { 10, 11, { 2, 3, 3, 3 }}, // 0x48 "H"
82 { 6, 11, { 2, 5, 3, 5 }}, // 0x49 "I"
83 { 7, 11, { 2, 5, 3, 4 }}, // 0x4A "J"
84 { 9, 11, { 2, 3, 3, 4 }}, // 0x4B "K"
85 { 8, 11, { 2, 4, 3, 4 }}, // 0x4C "L"
86 { 11, 11, { 2, 3, 3, 2 }}, // 0x4D "M"
87 { 10, 11, { 2, 3, 3, 3 }}, // 0x4E "N"
88 { 10, 11, { 2, 3, 3, 3 }}, // 0x4F "O"
89 { 10, 11, { 2, 3, 3, 3 }}, // 0x50 "P"
90 { 10, 11, { 2, 3, 3, 3 }}, // 0x51 "Q"
91 { 10, 11, { 2, 3, 3, 3 }}, // 0x52 "R"
92 { 10, 11, { 2, 3, 3, 3 }}, // 0x53 "S"
93 { 10, 11, { 2, 3, 3, 3 }}, // 0x54 "T"
94 { 10, 11, { 2, 3, 3, 3 }}, // 0x55 "U"
95 { 10, 11, { 2, 3, 3, 3 }}, // 0x56 "V"
96 { 11, 11, { 2, 3, 3, 2 }}, // 0x57 "W"
97 { 10, 11, { 2, 3, 3, 3 }}, // 0x58 "X"
98 { 10, 11, { 2, 3, 3, 3 }}, // 0x59 "Y"
99 { 10, 11, { 2, 3, 3, 3 }}, // 0x5A "Z"
100 { 6, 11, { 2, 5, 3, 5 }}, // 0x5B "["
101 { 8, 11, { 2, 4, 3, 4 }}, // 0x5C "\"
102 { 6, 11, { 2, 5, 3, 5 }}, // 0x5D "]"
103 { 8, 7, { 2, 4, 7, 4 }}, // 0x5E "^"
104 { 10, 3, { 10, 3, 3, 3 }}, // 0x5F "_"
105 { 6, 5, { 8, 6, 3, 4 }}, // 0x60 "`"
106 { 8, 7, { 6, 4, 3, 4 }}, // 0x61 "a"
107 { 8, 11, { 2, 4, 3, 4 }}, // 0x62 "b"
108 { 8, 7, { 6, 4, 3, 4 }}, // 0x63 "c"
109 { 8, 11, { 2, 4, 3, 4 }}, // 0x64 "d"
110 { 8, 7, { 6, 4, 3, 4 }}, // 0x65 "e"
111 { 7, 11, { 2, 5, 3, 4 }}, // 0x66 "f"
112 { 8, 9, { 6, 4, 1, 4 }}, // 0x67 "g"
113 { 8, 11, { 2, 4, 3, 4 }}, // 0x68 "h"
114 { 6, 11, { 2, 5, 3, 5 }}, // 0x69 "i"
115 { 7, 13, { 2, 5, 1, 4 }}, // 0x6A "j"
116 { 8, 11, { 2, 4, 3, 4 }}, // 0x6B "k"
117 { 5, 11, { 2, 5, 3, 6 }}, // 0x6C "l"
118 { 10, 7, { 6, 3, 3, 3 }}, // 0x6D "m"
119 { 8, 7, { 6, 4, 3, 4 }}, // 0x6E "n"
120 { 8, 7, { 6, 4, 3, 4 }}, // 0x6F "o"
121 { 8, 9, { 6, 4, 1, 4 }}, // 0x70 "p"
122 { 8, 9, { 6, 4, 1, 4 }}, // 0x71 "q"
123 { 8, 7, { 6, 4, 3, 4 }}, // 0x72 "r"
124 { 8, 7, { 6, 4, 3, 4 }}, // 0x73 "s"
125 { 8, 9, { 4, 4, 3, 4 }}, // 0x74 "t"
126 { 8, 7, { 6, 4, 3, 4 }}, // 0x75 "u"
127 { 8, 7, { 6, 4, 3, 4 }}, // 0x76 "v"
128 { 9, 7, { 6, 4, 3, 3 }}, // 0x77 "w"
129 { 8, 7, { 6, 4, 3, 4 }}, // 0x78 "x"
130 { 8, 9, { 6, 4, 1, 4 }}, // 0x79 "y"
131 { 8, 7, { 6, 4, 3, 4 }}, // 0x7A "z"
132 { 7, 11, { 2, 5, 3, 4 }}, // 0x7B "{"
133 { 4, 11, { 2, 6, 3, 6 }}, // 0x7C "|"
134 { 7, 11, { 2, 4, 3, 5 }}, // 0x7D "}"
135 { 10, 5, { 5, 3, 6, 3 }}, // 0x7E "}"
136 { 0, 0, { 0, 0, 0, 0 }}, // 0x7F
137};
138
139const struct GUIIconMetric defaultIconMetrics[] = {
140 [GUI_ICON_BATTERY_FULL] = { 0, 0, 32, 16 },
141 [GUI_ICON_BATTERY_HIGH] = { 32, 0, 32, 16 },
142 [GUI_ICON_BATTERY_HALF] = { 64, 0, 32, 16 },
143 [GUI_ICON_BATTERY_LOW] = { 96, 0, 32, 16 },
144 [GUI_ICON_BATTERY_EMPTY] = { 128, 0, 32, 16 },
145 [GUI_ICON_SCROLLBAR_BUTTON] = { 6, 16, 4, 5 },
146 [GUI_ICON_SCROLLBAR_TRACK] = { 23, 16, 2, 16 },
147 [GUI_ICON_SCROLLBAR_THUMB] = { 38, 16, 4, 16 },
148 [GUI_ICON_CURSOR] = { 48, 16, 16, 16 },
149 [GUI_ICON_POINTER] = { 68, 20, 8, 8 },
150 [GUI_ICON_BUTTON_CIRCLE] = { 2, 34, 12, 11 },
151 [GUI_ICON_BUTTON_CROSS] = { 18, 34, 12, 11 },
152 [GUI_ICON_BUTTON_TRIANGLE] = { 34, 34, 12, 11 },
153 [GUI_ICON_BUTTON_SQUARE] = { 50, 34, 12, 11 },
154 [GUI_ICON_BUTTON_HOME] = { 66, 34, 12, 11 },
155};