mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-28 03:01:57 +02:00
@@ -7,7 +7,7 @@ from functools import lru_cache
|
|||||||
|
|
||||||
from kitty.fast_data_types import (
|
from kitty.fast_data_types import (
|
||||||
FC_SLANT_ITALIC, FC_SLANT_ROMAN, FC_WEIGHT_BOLD, FC_WEIGHT_REGULAR,
|
FC_SLANT_ITALIC, FC_SLANT_ROMAN, FC_WEIGHT_BOLD, FC_WEIGHT_REGULAR,
|
||||||
fc_list, fc_match,
|
fc_list, fc_match as fc_match_impl,
|
||||||
)
|
)
|
||||||
|
|
||||||
attr_map = {(False, False): 'font_family',
|
attr_map = {(False, False): 'font_family',
|
||||||
@@ -48,6 +48,11 @@ def family_name_to_key(family):
|
|||||||
return re.sub(r'\s+', ' ', family.lower())
|
return re.sub(r'\s+', ' ', family.lower())
|
||||||
|
|
||||||
|
|
||||||
|
@lru_cache()
|
||||||
|
def fc_match(family, bold, italic):
|
||||||
|
return fc_match_impl(family, bold, italic)
|
||||||
|
|
||||||
|
|
||||||
def find_best_match(family, bold=False, italic=False, monospaced=True):
|
def find_best_match(family, bold=False, italic=False, monospaced=True):
|
||||||
q = family_name_to_key(family)
|
q = family_name_to_key(family)
|
||||||
font_map = all_fonts_map(monospaced)
|
font_map = all_fonts_map(monospaced)
|
||||||
|
|||||||
Reference in New Issue
Block a user