Fixes for hiroschima font

This commit is contained in:
2022-01-14 01:19:53 +01:00
parent cfc8dc2d6b
commit 7eac3fae5d
4 changed files with 6 additions and 5 deletions

View File

@@ -2618,7 +2618,7 @@ void TFT_eSprite::printToSprite(std::string_view string)
** Function name: printToSprite
** Description: Write a string to the sprite cursor position
***************************************************************************************/
void TFT_eSprite::printToSprite(char *cbuffer, uint16_t len) //std::string_view string)
void TFT_eSprite::printToSprite(const char *cbuffer, uint16_t len) //std::string_view string)
{
if(!fontLoaded) return;

View File

@@ -144,6 +144,7 @@ class TFT_eSprite : public TFT_eSPI {
// Print string to sprite using loaded font at cursor position
void printToSprite(std::string_view string);
// Print indexed glyph to sprite using loaded font at x,y
void printToSprite(const char *cbuffer, uint16_t len);
int16_t printToSprite(int16_t x, int16_t y, uint16_t index);
private:

View File

@@ -135,9 +135,9 @@ SPI3_HOST = 2
#ifdef SMOOTH_FONT
// Call up the SPIFFS (SPI FLASH Filing System) for the anti-aliased fonts
#define FS_NO_GLOBALS
#include <FS.h>
#include "SPIFFS.h" // ESP32 only
#define FONT_FS_AVAILABLE
//#include <FS.h>
//#include "SPIFFS.h" // ESP32 only
//#define FONT_FS_AVAILABLE
#endif
////////////////////////////////////////////////////////////////////////////////////////

View File

@@ -5041,7 +5041,7 @@ int16_t TFT_eSPI::drawString(std::string_view string, int32_t poX, int32_t poY,
if (padX && !_fillbg) _fillbg = true;
while (n < len) {
uint16_t uniCode = decodeUTF8((uint8_t*)ptr, &n, len - n);
uint16_t uniCode = decodeUTF8((const uint8_t*)std::begin(string), &n, len - n);
drawGlyph(uniCode);
}
_fillbg = fillbg; // restore state