forked from NiLuJe/FBInk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fbink_spleen.c
55 lines (49 loc) · 2.09 KB
/
fbink_spleen.c
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
/*
FBInk: FrameBuffer eInker, a tool to print text & images on eInk devices (Kobo/Kindle)
Copyright (C) 2018-2019 NiLuJe <[email protected]>
SPDX-License-Identifier: GPL-3.0-or-later
----
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 <https://www.gnu.org/licenses/>.
*/
#include "fbink_spleen.h"
static const uint16_t*
spleen_get_bitmap(uint32_t codepoint)
{
if (codepoint >= 0x20u && codepoint <= 0x7fu) {
return spleen_block1[codepoint - 0x20u];
} else if (codepoint >= 0xa0u && codepoint <= 0x17fu) {
return spleen_block2[codepoint - 0xa0u];
} else if (codepoint >= 0x2018u && codepoint <= 0x2019u) {
return spleen_block3[codepoint - 0x2018u];
} else if (codepoint >= 0x201cu && codepoint <= 0x201du) {
return spleen_block4[codepoint - 0x201cu];
} else if (codepoint == 0x2022u) {
return spleen_block5[0];
} else if (codepoint == 0x2026u) {
return spleen_block6[0];
} else if (codepoint == 0x20acu) {
return spleen_block7[0];
} else if (codepoint >= 0x2500u && codepoint <= 0x259fu) {
return spleen_block8[codepoint - 0x2500u];
} else if (codepoint >= 0x2630u && codepoint <= 0x2637u) {
return spleen_block9[codepoint - 0x2630u];
} else if (codepoint >= 0x2800u && codepoint <= 0x28ffu) {
return spleen_block10[codepoint - 0x2800u];
} else if (codepoint >= 0xe0a0u && codepoint <= 0xe0a2u) {
return spleen_block11[codepoint - 0xe0a0u];
} else if (codepoint >= 0xe0b0u && codepoint <= 0xe0b3u) {
return spleen_block12[codepoint - 0xe0b0u];
} else {
WARN("Codepoint U+%04X is not covered by this font", codepoint);
return spleen_block1[0];
}
}