From 71ac97f92e99f7e414342f640547dde19bf17823 Mon Sep 17 00:00:00 2001 From: moi15moi <80980684+moi15moi@users.noreply.github.com> Date: Mon, 21 Sep 2026 17:54:49 -0400 Subject: [PATCH] [collect_fonts] Log all types of mismatch This is a regression that was introduced in https://github.com/moi15moi/FontCollector/commit/1064060a5f710735e39e6f57c07ce7a6a3e936dc. Fix https://github.com/moi15moi/FontCollector/issues/99 --- font_collector/collect_fonts.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/font_collector/collect_fonts.py b/font_collector/collect_fonts.py index f7d57cc..7d9e830 100644 --- a/font_collector/collect_fonts.py +++ b/font_collector/collect_fonts.py @@ -55,17 +55,17 @@ def collect_subtitle_fonts( f"Used on lines: {' '.join(str(line) for line in usage_data.ordered_lines)}" ) else: - log_msg = "" + log_msgs = [] if font_result.need_faux_bold: - log_msg = f"Faux bold used for '{style.fontname}' (requested weight {style.weight}-{(font_weight_to_name(style.weight))}, got {font_result.font_face.weight}-{(font_weight_to_name(font_result.font_face.weight))})." + log_msgs.append(f"Faux bold used for '{style.fontname}' (requested weight {style.weight}-{(font_weight_to_name(style.weight))}, got {font_result.font_face.weight}-{(font_weight_to_name(font_result.font_face.weight))}).") elif font_result.mismatch_bold: - log_msg = f"Mismatched weight for '{style.fontname}' (requested weight {style.weight}-{(font_weight_to_name(style.weight))}, got {font_result.font_face.weight}-{(font_weight_to_name(font_result.font_face.weight))})." + log_msgs.append(f"Mismatched weight for '{style.fontname}' (requested weight {style.weight}-{(font_weight_to_name(style.weight))}, got {font_result.font_face.weight}-{(font_weight_to_name(font_result.font_face.weight))}).") if font_result.mismatch_italic: - log_msg = f"Mismatched italic for '{style.fontname}' (requested {'' if style.italic else 'non-'}italic, got {'' if font_result.font_face.is_italic else 'non-'}italic)." + log_msgs.append(f"Mismatched italic for '{style.fontname}' (requested {'' if style.italic else 'non-'}italic, got {'' if font_result.font_face.is_italic else 'non-'}italic).") - if log_msg: + if log_msgs: _logger.warning( - f"{log_msg}\n" + "\n".join(log_msgs) + "\n" f"Used on lines: {' '.join(str(line) for line in usage_data.ordered_lines)}" )