CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
Loading...
Searching...
No Matches
Fonts.cpp
Go to the documentation of this file.
1
4
5#include "cdc_views/Fonts.h"
6
9#include <Fonts/FreeMonoBold18pt7b.h>
10#include <Fonts/FreeMonoBold24pt7b.h>
11
12namespace cdc::ui {
13
14namespace {
15
16const GFXfont* const kFonts[kFontIdCount] = {
17 nullptr, // FontId::Builtin
18 &FreeMonoBold9pt8b, // FontId::Bold9pt
19 &FreeMonoBold12pt8b, // FontId::Bold12pt
20 &FreeMonoBold18pt7b, // FontId::Bold18pt
21 &FreeMonoBold24pt7b, // FontId::Bold24pt
22};
23
24} // namespace
25
26const GFXfont* getGfxFont(FontId id) {
27 return getGfxFont(static_cast<uint8_t>(id));
28}
29
30const GFXfont* getGfxFont(uint8_t id) {
31 if (id >= kFontIdCount) return nullptr;
32 return kFonts[id];
33}
34
35} // namespace cdc::ui
const GFXfont FreeMonoBold12pt8b
const GFXfont FreeMonoBold9pt8b
Centralized key-code constants for cdc_views.
Definition IModule.h:8
const GFXfont * getGfxFont(FontId id)
Resolves a FontId to its underlying GFX font pointer.
Definition Fonts.cpp:26
constexpr uint8_t kFontIdCount
Number of entries in the canonical font table.
Definition Fonts.h:24
FontId
Canonical font identifier shared by firmware UI and plugin host API.
Definition Fonts.h:15