Skip to content

Commit 85ebd31

Browse files
authored
Only show one warning for skipped fonts (#6880)
1 parent abc82bd commit 85ebd31

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

code/graphics/software/font.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -460,13 +460,15 @@ namespace
460460
FontType type;
461461
SCP_string fontName;
462462

463+
SCP_vector<SCP_string> skipped_font_names;
464+
463465
while (parse_type(type, fontName))
464466
{
465467
switch (type)
466468
{
467469
case VFNT_FONT:
468470
if (Unicode_text_mode) {
469-
Warning(LOCATION, "Bitmap fonts are not supported in Unicode text mode! Font %s will be ignored.", fontName.c_str());
471+
skipped_font_names.push_back(fontName);
470472
skip_to_start_of_string_one_of({"$TrueType:", "$Font:", "#End"});
471473
} else {
472474
parse_vfnt_font(fontName);
@@ -481,6 +483,14 @@ namespace
481483
}
482484
}
483485

486+
// check if we skipped any fonts
487+
if (!skipped_font_names.empty()) {
488+
Warning(LOCATION, "One or more bitmap fonts were skipped because they are not supported in Unicode text mode. The list of fonts is in the debug log.");
489+
for (const auto& skippedFont : skipped_font_names) {
490+
mprintf(("Warning: Skipped bitmap font: %s\n", skippedFont.c_str()));
491+
}
492+
}
493+
484494
// done parsing
485495
required_string("#End");
486496
}

0 commit comments

Comments
 (0)