mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-08-04 06:36:24 +00:00
Add a simple function for listing basic font data
This commit is contained in:
parent
8a607fa34c
commit
ccc3bee9af
1 changed files with 9 additions and 0 deletions
|
|
@ -502,5 +502,14 @@ def develop(family: str = '') -> None:
|
|||
s('Bold-Italic:', ff['bi'])
|
||||
|
||||
|
||||
def list_fonts(monospaced: bool = True) -> dict[str, list[dict[str, str]]]:
|
||||
ans: dict[str, list[dict[str, str]]] = {}
|
||||
for key, descriptors in all_fonts_map(monospaced)['family_map'].items():
|
||||
entries = ans.setdefault(key, [])
|
||||
for d in descriptors:
|
||||
entries.append({'family': d['family'], 'psname': d['postscript_name'], 'path': d['path'], 'style': d['style']})
|
||||
return ans
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
develop()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue