mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-27 18:51:41 +02:00
...
This commit is contained in:
@@ -76,11 +76,10 @@ def find_best_match(family, bold=False, italic=False, monospaced=True):
|
|||||||
# happens if the family name is an alias, so we search with
|
# happens if the family name is an alias, so we search with
|
||||||
# the actual family name to see if we can find all the
|
# the actual family name to see if we can find all the
|
||||||
# fonts in the family.
|
# fonts in the family.
|
||||||
full_name_candidates = font_map['family_map'].get(family_name_to_key(candidates[0]['family']))
|
family_name_candidates = font_map['family_map'].get(family_name_to_key(candidates[0]['family']))
|
||||||
if full_name_candidates and len(full_name_candidates) > 1:
|
if family_name_candidates and len(family_name_candidates) > 1:
|
||||||
candidates = full_name_candidates
|
candidates = family_name_candidates
|
||||||
candidates.sort(key=score)
|
return sorted(candidates, key=score)[0]
|
||||||
return candidates[0]
|
|
||||||
|
|
||||||
# Use fc-match with a generic family
|
# Use fc-match with a generic family
|
||||||
family = 'monospace' if monospaced else 'sans-serif'
|
family = 'monospace' if monospaced else 'sans-serif'
|
||||||
|
|||||||
Reference in New Issue
Block a user