Font: optimise output for Windows

This commit is contained in:
李通洲
2023-01-18 18:01:09 +08:00
parent 5edab414d8
commit 10b997608b
2 changed files with 10 additions and 3 deletions
+1
View File
@@ -25,6 +25,7 @@ Features:
* Enhance `--percent-type` to allow hiding other texts (#387)
* Add Wifi module support for Linux
* Detect scaled resolutions (Windows, macOS)
* Optimise font module printing (Windows)
Logos:
* Raspbian (@IamNoRobot, #373)
+9 -3
View File
@@ -48,12 +48,18 @@ static void printFont(const FFFontResult* font)
const char* types[] = { "Caption", "Menu", "Message", "Status" };
for(uint32_t i = 0; i < sizeof(types) / sizeof(types[0]); ++i)
{
if(font->fonts[i].length > 0)
if(i == 0 || !ffStrbufEqual(&font->fonts[i - 1], &font->fonts[i]))
{
printf("%s [%s]", font->fonts[i].chars, types[i]);
break;
if(i > 0)
fputs("], ", stdout);
printf("%s [%s", font->fonts[i].chars, types[i]);
}
else
{
printf(" / %s", types[i]);
}
}
putchar(']');
}
#else