Dont log an error when the default famil "monospace" is not found

This commit is contained in:
Kovid Goyal
2024-05-17 13:02:03 +05:30
parent 0028d7f04b
commit ff89f5187d

View File

@@ -195,7 +195,8 @@ def find_best_match(
# Let CoreText choose the font if the family exists, otherwise
# fallback to Menlo
if q not in font_map['family_map']:
log_error(f'The font {family} was not found, falling back to Menlo')
if family != "monospace":
log_error(f'The font {family} was not found, falling back to Menlo')
q = 'menlo'
candidates = scorer.sorted_candidates(font_map['family_map'][q])
return candidates[0]