Revert "Add UI_PrintStringYOffset to shift big-font"

This reverts commit d5edba1fc2.
This commit is contained in:
Armel FAUVEAU committed 2026-04-27 15:03:44 +02:00
1 parent d5edba1fc2
commit cac63f978e
3 files changed
+3 -46

No files matched your search

-40
View File
@@ -98,46 +98,6 @@ void UI_PrintString(const char *pString, uint8_t Start, uint8_t End, uint8_t Lin
}
}
// Same as UI_PrintString but shifts the glyph down by YOffset pixels (0..7).
// When YOffset > 0, a third page (Line+2) is also written. Bits are OR-ed
// so existing framebuffer content outside the glyph footprint is preserved.
void UI_PrintStringYOffset(const char *pString, uint8_t Start, uint8_t End, uint8_t Line, uint8_t Width, uint8_t YOffset)
{
size_t i;
size_t Length = strlen(pString);
if (End > Start)
Start += (((End - Start) - (Length * Width)) + 1) / 2;
YOffset &= 7;
for (i = 0; i < Length; i++)
{
const unsigned int ofs = (unsigned int)Start + (i * Width);
if (pString[i] > ' ' && pString[i] < 127)
{
const unsigned int index = pString[i] - ' ' - 1;
if (YOffset == 0)
{
memcpy(gFrameBuffer[Line + 0] + ofs, &gFontBig[index][0], 7);
memcpy(gFrameBuffer[Line + 1] + ofs, &gFontBig[index][7], 7);
}
else
{
for (unsigned int x = 0; x < 7; x++)
{
const uint8_t top = gFontBig[index][x];
const uint8_t bot = gFontBig[index][7 + x];
gFrameBuffer[Line + 0][ofs + x] |= (uint8_t)(top << YOffset);
gFrameBuffer[Line + 1][ofs + x] |= (uint8_t)(top >> (8 - YOffset)) | (uint8_t)(bot << YOffset);
gFrameBuffer[Line + 2][ofs + x] |= (uint8_t)(bot >> (8 - YOffset));
}
}
}
}
}
void UI_PrintStringSmall(const char *pString, uint8_t Start, uint8_t End, uint8_t Line, uint8_t char_width, const uint8_t *font)
{
const size_t Length = strlen(pString);
-1
View File
@@ -23,7 +23,6 @@
void UI_GenerateChannelString(char *pString, const uint16_t Channel);
void UI_GenerateChannelStringEx(char *pString, const bool bShowPrefix, const uint16_t ChannelNumber);
void UI_PrintString(const char *pString, uint8_t Start, uint8_t End, uint8_t Line, uint8_t Width);
void UI_PrintStringYOffset(const char *pString, uint8_t Start, uint8_t End, uint8_t Line, uint8_t Width, uint8_t YOffset);
void UI_PrintStringSmallNormal(const char *pString, uint8_t Start, uint8_t End, uint8_t Line);
void UI_PrintStringSmallNormalInverse(const char *pString, uint8_t Start, uint8_t End, uint8_t Line);
void UI_PrintStringSmallBold(const char *pString, uint8_t Start, uint8_t End, uint8_t Line);
+3 -5
View File
@@ -1597,8 +1597,7 @@ void UI_DisplayMain(void)
case MDF_CHANNEL: // show the channel number
sprintf(String, "CH-%04u", gEeprom.ScreenChannel[vfo_num] + 1);
//UI_PrintString(String, 36, 0, line, 8);
UI_PrintStringYOffset(String, 36, 0, line, 8, 3);
UI_PrintString(String, 36, 0, line, 8);
break;
case MDF_NAME: // show the channel name
@@ -1612,15 +1611,14 @@ void UI_DisplayMain(void)
if (gEeprom.CHANNEL_DISPLAY_MODE == MDF_NAME) {
String[10] = 0;
UI_PrintStringYOffset(String, 33, 0, line, 8, 3);
UI_PrintString(String, 33, 0, line, 8);
}
else {
#ifdef ENABLE_FEAT_F4HWN
if (isMainOnly())
{
String[10] = 0;
//UI_PrintString(String, 33, 0, line, 8);
UI_PrintStringYOffset(String, 33, 0, line, 8, 3);
UI_PrintString(String, 33, 0, line, 8);
}
else
{