forked from kost/dcled
-
Notifications
You must be signed in to change notification settings - Fork 1
/
fonts.h
30 lines (25 loc) · 849 Bytes
/
fonts.h
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
// dcled-hidapi - userland driver for the Dream Cheeky LED Message Board
// Copyright 2018 Jahn Fuchs <[email protected]>
// Distributed under the MIT License. See accompanying LICENSE file.
#pragma once
#include <string>
namespace dcled
{
// Currently all fonts are compiled into the program, might change later.
namespace font {
struct Font {
static constexpr uint8_t DEFAULT_CHAR[7] = {0xAA, 0x55, 0xAA, 0x55, 0xAA, 0x55, 0xAA};
auto operator[](uint8_t c) const { return (c < 32) ? DEFAULT_CHAR : data[c-32]; }
const uint8_t width;
const uint8_t height = 7;
const std::string name;
const std::string desc;
const std::string author;
const uint8_t data[224][7];
};
// The default font
extern const Font Default;
// A smaller font
extern const Font Small;
}
}