mirror of
https://github.com/eddyem/stm32samples.git
synced 2025-12-06 02:35:23 +03:00
222 lines
8.2 KiB
C
222 lines
8.2 KiB
C
/*
|
||
* This file is part of the LED_screen project.
|
||
* Copyright 2019 Edward V. Emelianov <eddy@sao.ru, edward.emelianoff@gmail.com>
|
||
*
|
||
* This program is free software: you can redistribute it and/or modify
|
||
* it under the terms of the GNU General Public License as published by
|
||
* the Free Software Foundation, either version 3 of the License, or
|
||
* (at your option) any later version.
|
||
*
|
||
* This program is distributed in the hope that it will be useful,
|
||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
* GNU General Public License for more details.
|
||
*
|
||
* You should have received a copy of the GNU General Public License
|
||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||
*/
|
||
|
||
// this file should be included JUST ONCE!
|
||
// only in fonts.c
|
||
|
||
#define FONTNUMB8BYTES 8
|
||
#define FONTNUMB8HEIGHT 8
|
||
#define FONTNUMB8BASELINE 0
|
||
|
||
// this array shows position of every koi8-r symbol in font10_table
|
||
const uint8_t fontNumb8_encoding[256] = {
|
||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, // 0..31
|
||
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 47
|
||
2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0, 0, 0, 0, 0, 0, // 63
|
||
0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, // 79
|
||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 95
|
||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 111
|
||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 127
|
||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 143
|
||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 159
|
||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 175
|
||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 191
|
||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 207
|
||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 223
|
||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 239
|
||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 255
|
||
};
|
||
|
||
const uint8_t fontNumb8_table[] = {
|
||
// 0 0x00 - empty
|
||
0,
|
||
________,
|
||
________,
|
||
________,
|
||
________,
|
||
________,
|
||
________,
|
||
________,
|
||
________,
|
||
// 1 0x20 - ' '
|
||
4,
|
||
________,
|
||
________,
|
||
________,
|
||
________,
|
||
________,
|
||
________,
|
||
________,
|
||
________,
|
||
// 2 0x30 - '0'
|
||
6,
|
||
_XXX____,
|
||
XX_XX___,
|
||
X___X___,
|
||
X___X___,
|
||
X___X___,
|
||
X___X___,
|
||
XX_XX___,
|
||
_XXX____,
|
||
// 3 0x31 - '1'
|
||
6,
|
||
_XX_____,
|
||
X_X_____,
|
||
__X_____,
|
||
__X_____,
|
||
__X_____,
|
||
__X_____,
|
||
__X_____,
|
||
XXXXX___,
|
||
// 4 0x32 - '2'
|
||
6,
|
||
_XXX____,
|
||
X___X___,
|
||
____X___,
|
||
____X___,
|
||
___X____,
|
||
__X_____,
|
||
_X______,
|
||
XXXXX___,
|
||
// 5 0x33 - '3'
|
||
6,
|
||
XXXX____,
|
||
____X___,
|
||
____X___,
|
||
_XXX____,
|
||
____X___,
|
||
____X___,
|
||
____X___,
|
||
XXXX____,
|
||
// 6 0x34 - '4'
|
||
7,
|
||
___XX___,
|
||
___XX___,
|
||
__X_X___,
|
||
_X__X___,
|
||
_X__X___,
|
||
XXXXXX__,
|
||
____X___,
|
||
____X___,
|
||
// 7 0x35 - '5'
|
||
5,
|
||
XXXX____,
|
||
X_______,
|
||
X_______,
|
||
XXX_____,
|
||
___X____,
|
||
___X____,
|
||
___X____,
|
||
XXX_____,
|
||
// 8 0x36 - '6'
|
||
6,
|
||
_XXX____,
|
||
X___X___,
|
||
X_______,
|
||
XXXX____,
|
||
X___X___,
|
||
X___X___,
|
||
X___X___,
|
||
_XXX____,
|
||
// 9 0x37 - '7'
|
||
5,
|
||
XXXX____,
|
||
___X____,
|
||
__X_____,
|
||
__X_____,
|
||
__X_____,
|
||
_X______,
|
||
_X______,
|
||
_X______,
|
||
// 10 0x38 - '8'
|
||
6,
|
||
_XXX____,
|
||
X___X___,
|
||
X___X___,
|
||
_XXX____,
|
||
X___X___,
|
||
X___X___,
|
||
X___X___,
|
||
_XXX____,
|
||
// 11 0x39 - '9'
|
||
6,
|
||
_XXX____,
|
||
X___X___,
|
||
X___X___,
|
||
X___X___,
|
||
_XXXX___,
|
||
____X___,
|
||
X___X___,
|
||
_XXX____,
|
||
// 12 0x41 - 'A'
|
||
6,
|
||
__X_____,
|
||
_X_X____,
|
||
_X_X____,
|
||
_X_X____,
|
||
X___X___,
|
||
XXXXX___,
|
||
X___X___,
|
||
X___X___,
|
||
// 13 0x4f - 'O'
|
||
7,
|
||
__XX____,
|
||
_X__X___,
|
||
X____X__,
|
||
X____X__,
|
||
X____X__,
|
||
X____X__,
|
||
_X__X___,
|
||
__XX____,
|
||
};
|
||
|
||
/*
|
||
32 (0x20) - 64 (0x40) - @ 96 (0x60) - ` 128 (0x80) - <20> 160 (0xa0) - <20> 192 (0xc0) - <20> 224 (0xe0) - <20>
|
||
33 (0x21) - ! 65 (0x41) - A 97 (0x61) - a 129 (0x81) - <20> 161 (0xa1) - <20> 193 (0xc1) - <20> 225 (0xe1) - <20>
|
||
34 (0x22) - " 66 (0x42) - B 98 (0x62) - b 130 (0x82) - <20> 162 (0xa2) - <20> 194 (0xc2) - <20> 226 (0xe2) - <20>
|
||
35 (0x23) - # 67 (0x43) - C 99 (0x63) - c 131 (0x83) - <20> 163 (0xa3) - <20> 195 (0xc3) - <20> 227 (0xe3) - <20>
|
||
36 (0x24) - $ 68 (0x44) - D 100 (0x64) - d 132 (0x84) - <20> 164 (0xa4) - <20> 196 (0xc4) - <20> 228 (0xe4) - <20>
|
||
37 (0x25) - % 69 (0x45) - E 101 (0x65) - e 133 (0x85) - <20> 165 (0xa5) - <20> 197 (0xc5) - <20> 229 (0xe5) - <20>
|
||
38 (0x26) - & 70 (0x46) - F 102 (0x66) - f 134 (0x86) - <20> 166 (0xa6) - <20> 198 (0xc6) - <20> 230 (0xe6) - <20>
|
||
39 (0x27) - ' 71 (0x47) - G 103 (0x67) - g 135 (0x87) - <20> 167 (0xa7) - <20> 199 (0xc7) - <20> 231 (0xe7) - <20>
|
||
40 (0x28) - ( 72 (0x48) - H 104 (0x68) - h 136 (0x88) - <20> 168 (0xa8) - <20> 200 (0xc8) - <20> 232 (0xe8) - <20>
|
||
41 (0x29) - ) 73 (0x49) - I 105 (0x69) - i 137 (0x89) - <20> 169 (0xa9) - <20> 201 (0xc9) - <20> 233 (0xe9) - <20>
|
||
42 (0x2a) - * 74 (0x4a) - J 106 (0x6a) - j 138 (0x8a) - <20> 170 (0xaa) - <20> 202 (0xca) - <20> 234 (0xea) - <20>
|
||
43 (0x2b) - + 75 (0x4b) - K 107 (0x6b) - k 139 (0x8b) - <20> 171 (0xab) - <20> 203 (0xcb) - <20> 235 (0xeb) - <20>
|
||
44 (0x2c) - , 76 (0x4c) - L 108 (0x6c) - l 140 (0x8c) - <20> 172 (0xac) - <20> 204 (0xcc) - <20> 236 (0xec) - <20>
|
||
45 (0x2d) - - 77 (0x4d) - M 109 (0x6d) - m 141 (0x8d) - <20> 173 (0xad) - <20> 205 (0xcd) - <20> 237 (0xed) - <20>
|
||
46 (0x2e) - . 78 (0x4e) - N 110 (0x6e) - n 142 (0x8e) - <20> 174 (0xae) - <20> 206 (0xce) - <20> 238 (0xee) - <20>
|
||
47 (0x2f) - / 79 (0x4f) - O 111 (0x6f) - o 143 (0x8f) - <20> 175 (0xaf) - <20> 207 (0xcf) - <20> 239 (0xef) - <20>
|
||
48 (0x30) - 0 80 (0x50) - P 112 (0x70) - p 144 (0x90) - <20> 176 (0xb0) - <20> 208 (0xd0) - <20> 240 (0xf0) - <20>
|
||
49 (0x31) - 1 81 (0x51) - Q 113 (0x71) - q 145 (0x91) - <20> 177 (0xb1) - <20> 209 (0xd1) - <20> 241 (0xf1) - <20>
|
||
50 (0x32) - 2 82 (0x52) - R 114 (0x72) - r 146 (0x92) - <20> 178 (0xb2) - <20> 210 (0xd2) - <20> 242 (0xf2) - <20>
|
||
51 (0x33) - 3 83 (0x53) - S 115 (0x73) - s 147 (0x93) - <20> 179 (0xb3) - <20> 211 (0xd3) - <20> 243 (0xf3) - <20>
|
||
52 (0x34) - 4 84 (0x54) - T 116 (0x74) - t 148 (0x94) - <20> 180 (0xb4) - <20> 212 (0xd4) - <20> 244 (0xf4) - <20>
|
||
53 (0x35) - 5 85 (0x55) - U 117 (0x75) - u 149 (0x95) - <20> 181 (0xb5) - <20> 213 (0xd5) - <20> 245 (0xf5) - <20>
|
||
54 (0x36) - 6 86 (0x56) - V 118 (0x76) - v 150 (0x96) - <20> 182 (0xb6) - <20> 214 (0xd6) - <20> 246 (0xf6) - <20>
|
||
55 (0x37) - 7 87 (0x57) - W 119 (0x77) - w 151 (0x97) - <20> 183 (0xb7) - <20> 215 (0xd7) - <20> 247 (0xf7) - <20>
|
||
56 (0x38) - 8 88 (0x58) - X 120 (0x78) - x 152 (0x98) - <20> 184 (0xb8) - <20> 216 (0xd8) - <20> 248 (0xf8) - <20>
|
||
57 (0x39) - 9 89 (0x59) - Y 121 (0x79) - y 153 (0x99) - <20> 185 (0xb9) - <20> 217 (0xd9) - <20> 249 (0xf9) - <20>
|
||
58 (0x3a) - : 90 (0x5a) - Z 122 (0x7a) - z 154 (0x9a) - 186 (0xba) - <20> 218 (0xda) - <20> 250 (0xfa) - <20>
|
||
59 (0x3b) - ; 91 (0x5b) - [ 123 (0x7b) - { 155 (0x9b) - <20> 187 (0xbb) - <20> 219 (0xdb) - <20> 251 (0xfb) - <20>
|
||
60 (0x3c) - < 92 (0x5c) - \ 124 (0x7c) - | 156 (0x9c) - <20> 188 (0xbc) - <20> 220 (0xdc) - <20> 252 (0xfc) - <20>
|
||
61 (0x3d) - = 93 (0x5d) - ] 125 (0x7d) - } 157 (0x9d) - <20> 189 (0xbd) - <20> 221 (0xdd) - <20> 253 (0xfd) - <20>
|
||
62 (0x3e) - > 94 (0x5e) - ^ 126 (0x7e) - ~ 158 (0x9e) - <20> 190 (0xbe) - <20> 222 (0xde) - <20> 254 (0xfe) - <20>
|
||
63 (0x3f) - ? 95 (0x5f) - _ 127 (0x7f) - 159 (0x9f) - <20> 191 (0xbf) - <20> 223 (0xdf) - <20> 255 (0xff) - <20>
|
||
*/
|