mirror of
https://github.com/Bodmer/TFT_eSPI.git
synced 2025-08-06 14:14:44 +02:00
Fix issue #216
This commit is contained in:
10
TFT_eSPI.cpp
10
TFT_eSPI.cpp
@@ -4156,8 +4156,9 @@ int16_t TFT_eSPI::drawString(const char *string, int poX, int poY, int font)
|
|||||||
uint16_t cheight = 8 * textsize;
|
uint16_t cheight = 8 * textsize;
|
||||||
|
|
||||||
#ifdef LOAD_GFXFF
|
#ifdef LOAD_GFXFF
|
||||||
if (font == 1) {
|
bool freeFont = (font == 1 && gfxFont && !fontLoaded);
|
||||||
if(gfxFont) {
|
|
||||||
|
if (freeFont) {
|
||||||
cheight = glyph_ab * textsize;
|
cheight = glyph_ab * textsize;
|
||||||
poY += cheight; // Adjust for baseline datum of free fonts
|
poY += cheight; // Adjust for baseline datum of free fonts
|
||||||
baseline = cheight;
|
baseline = cheight;
|
||||||
@@ -4168,7 +4169,6 @@ int16_t TFT_eSPI::drawString(const char *string, int poX, int poY, int font)
|
|||||||
cheight += glyph_bb * textsize;
|
cheight += glyph_bb * textsize;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (textdatum || padX)
|
if (textdatum || padX)
|
||||||
@@ -4250,7 +4250,7 @@ int16_t TFT_eSPI::drawString(const char *string, int poX, int poY, int font)
|
|||||||
|
|
||||||
int8_t xo = 0;
|
int8_t xo = 0;
|
||||||
#ifdef LOAD_GFXFF
|
#ifdef LOAD_GFXFF
|
||||||
if ((font == 1) && (gfxFont) && (textcolor!=textbgcolor))
|
if (freeFont && (textcolor!=textbgcolor))
|
||||||
{
|
{
|
||||||
cheight = (glyph_ab + glyph_bb) * textsize;
|
cheight = (glyph_ab + glyph_bb) * textsize;
|
||||||
// Get the offset for the first character only to allow for negative offsets
|
// Get the offset for the first character only to allow for negative offsets
|
||||||
@@ -4306,7 +4306,7 @@ int16_t TFT_eSPI::drawString(const char *string, int poX, int poY, int font)
|
|||||||
{
|
{
|
||||||
int16_t padXc = poX+cwidth+xo;
|
int16_t padXc = poX+cwidth+xo;
|
||||||
#ifdef LOAD_GFXFF
|
#ifdef LOAD_GFXFF
|
||||||
if ((font == 1) && (gfxFont))
|
if (freeFont)
|
||||||
{
|
{
|
||||||
poX +=xo; // Adjust for negative offset start character
|
poX +=xo; // Adjust for negative offset start character
|
||||||
poY -= glyph_ab * textsize;
|
poY -= glyph_ab * textsize;
|
||||||
|
Reference in New Issue
Block a user