v.0.1.0 fonts as vectors
This commit is contained in:
11
lib/Utils/src/fonts.cpp
Normal file
11
lib/Utils/src/fonts.cpp
Normal file
@@ -0,0 +1,11 @@
|
||||
#include "fonts.hpp"
|
||||
|
||||
const std::vector<uint8_t> &getFontChar(char c, const std::map<uint8_t, std::vector<uint8_t>> &font)
|
||||
{
|
||||
auto it = font.find(c);
|
||||
if (it != font.end())
|
||||
{
|
||||
return it->second;
|
||||
}
|
||||
return font.at(' '); // Fallback to space
|
||||
}
|
||||
10
lib/Utils/src/fonts.hpp
Normal file
10
lib/Utils/src/fonts.hpp
Normal file
@@ -0,0 +1,10 @@
|
||||
#ifndef FONTS_HPP
|
||||
#define FONTS_HPP
|
||||
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <stdint.h>
|
||||
|
||||
const std::vector<uint8_t> &getFontChar(char c, const std::map<uint8_t, std::vector<uint8_t>> &font);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user