mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-23 00:38:10 +02:00
Work on listing available styles for a family
This commit is contained in:
@@ -6,6 +6,7 @@ from kitty.typing import CoreTextFont, FontConfigPattern
|
||||
|
||||
class ListedFont(TypedDict):
|
||||
family: str
|
||||
style: str
|
||||
full_name: str
|
||||
postscript_name: str
|
||||
is_monospace: bool
|
||||
|
||||
@@ -47,7 +47,7 @@ def list_fonts() -> Generator[ListedFont, None, None]:
|
||||
if not fn:
|
||||
fn = f'{f} {fd["style"]}'.strip()
|
||||
yield {'family': f, 'full_name': fn, 'postscript_name': fd['postscript_name'] or '', 'is_monospace': fd['monospace'],
|
||||
'is_variable': fd['variable'], 'descriptor': fd}
|
||||
'is_variable': fd['variable'], 'descriptor': fd, 'style': fd['style']}
|
||||
|
||||
|
||||
def create_scorer(bold: bool = False, italic: bool = False, monospaced: bool = True, prefer_variable: bool = False) -> Scorer:
|
||||
|
||||
@@ -61,6 +61,7 @@ def list_fonts(only_variable: bool = False) -> Generator[ListedFont, None, None]
|
||||
yield {
|
||||
'family': f, 'full_name': fn, 'postscript_name': str(fd.get('postscript_name', '')),
|
||||
'is_monospace': is_mono, 'descriptor': fd, 'is_variable': fd.get('variable', False),
|
||||
'style': fd['style'],
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user