v.0.1.1 rm fontHeight_NxM
This commit is contained in:
@@ -10,8 +10,3 @@ const std::vector<uint16_t> &getFontChar_16x16(char c)
|
||||
}
|
||||
return font_16x16.at(' '); // Fallback to space
|
||||
}
|
||||
|
||||
const uint8_t fontHeight_16x16()
|
||||
{
|
||||
return 16;
|
||||
}
|
||||
|
||||
@@ -115,6 +115,5 @@ const std::map<uint8_t, std::vector<uint16_t>> font_16x16 = {
|
||||
|
||||
// Declarations only
|
||||
const std::vector<uint16_t> &getFontChar_16x16(char c);
|
||||
const uint8_t fontHeight_16x16();
|
||||
|
||||
#endif
|
||||
@@ -10,8 +10,3 @@ const std::vector<uint8_t> &getFontChar_5x7(char c)
|
||||
}
|
||||
return font_5x7.at(' '); // Fallback to space
|
||||
}
|
||||
|
||||
const uint8_t fontHeight_5x7()
|
||||
{
|
||||
return 7;
|
||||
}
|
||||
|
||||
@@ -117,6 +117,5 @@ const std::map<uint8_t, std::vector<uint8_t>> font_5x7 = {
|
||||
|
||||
// Declarations only
|
||||
const vector<uint8_t> &getFontChar_5x7(char c);
|
||||
const uint8_t fontHeight_5x7();
|
||||
|
||||
#endif
|
||||
@@ -10,8 +10,3 @@ const std::vector<uint8_t> &getFontChar_8x8(char c)
|
||||
}
|
||||
return font_8x8.at(' '); // Fallback to space
|
||||
}
|
||||
|
||||
const uint8_t fontHeight_8x8()
|
||||
{
|
||||
return 8;
|
||||
}
|
||||
|
||||
@@ -112,6 +112,5 @@ const std::map<uint8_t, std::vector<uint8_t>> font_8x8 = {
|
||||
|
||||
// Declarations only
|
||||
const std::vector<uint8_t> &getFontChar_8x8(char c);
|
||||
const uint8_t fontHeight_8x8();
|
||||
|
||||
#endif
|
||||
@@ -59,17 +59,19 @@ void LedMatrix::drawPixel(int x, int y, CRGB color)
|
||||
uint8_t LedMatrix::drawChar(int x, int y, char c, CRGB color)
|
||||
{
|
||||
#ifdef USE_FONT_5x7
|
||||
const u_int8_t font_width = 5;
|
||||
const std::map<uint8_t, std::vector<uint8_t>> &font = font_5x7;
|
||||
#elifdef USE_FONT_8x8
|
||||
const u_int8_t font_width = 8;
|
||||
const std::map<uint8_t, std::vector<uint8_t>> &font = font_8x8;
|
||||
#elifdef USE_FONT_16x16
|
||||
const std::map<uint8_t, std::vector<uint8_t>> &font = font_16x16;
|
||||
const u_int8_t font_width = 16;
|
||||
const std::map<uint8_t, std::vector<uint16_t>> &font = font_16x16;
|
||||
#endif
|
||||
const vector<uint8_t> &fontData_ = getFontChar(c, font);
|
||||
const uint8_t *fontData = fontData_.data();
|
||||
const u_int8_t char_width_pixel = charWidth(fontData);
|
||||
const u_int8_t font_height = getFontHeight();
|
||||
const u_int8_t font_width = 5;
|
||||
|
||||
for (u_int8_t row = 0; row < font_height; row++)
|
||||
{
|
||||
@@ -118,7 +120,7 @@ const uint8_t LedMatrix::getTextWidth(const char *text)
|
||||
#elifdef USE_FONT_8x8
|
||||
const std::map<uint8_t, std::vector<uint8_t>> &font = font_8x8;
|
||||
#elifdef USE_FONT_16x16
|
||||
const std::map<uint8_t, std::vector<uint8_t>> &font = font_16x16;
|
||||
const std::map<uint8_t, std::vector<uint16_t>> &font = font_16x16;
|
||||
#endif
|
||||
const vector<uint8_t> &fontData_ = getFontChar(text[i], font);
|
||||
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
#define USE_FONT_5x7
|
||||
// #define USE_FONT_8x8
|
||||
// #define USE_FONT_5x7
|
||||
#define USE_FONT_8x8
|
||||
// #define USE_FONT_16x16
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
Reference in New Issue
Block a user