Linux: Fix a regression in the previous release that caused automatic selection of fonts when using aliases such as "monospace" to not work
Fix #1209
This commit is contained in:
parent
36b3582825
commit
35653ef4b4
@ -9,6 +9,10 @@ Changelog
|
||||
- Fix passing input via the pipe action to a program without a window not
|
||||
working.
|
||||
|
||||
- Linux: Fix a regression in the previous release that caused automatic
|
||||
selection of fonts when using aliases such as "monospace" to not work
|
||||
(:iss:`1209`)
|
||||
|
||||
0.13.0 [2018-12-05]
|
||||
------------------------------
|
||||
|
||||
|
||||
@ -72,6 +72,13 @@ def find_best_match(family, bold=False, italic=False, monospaced=True):
|
||||
if val:
|
||||
candidates = font_map[map_key].get(family_name_to_key(val))
|
||||
if candidates:
|
||||
if len(candidates) == 1:
|
||||
# happens if the family name is an alias, so we search with
|
||||
# the actual family name to see if we can find all the
|
||||
# fonts in the family.
|
||||
full_name_candidates = font_map['family_map'].get(family_name_to_key(candidates[0]['family']))
|
||||
if full_name_candidates and len(full_name_candidates) > 1:
|
||||
candidates = full_name_candidates
|
||||
candidates.sort(key=score)
|
||||
return candidates[0]
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user