mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-17 14:04:52 +02:00
Use fc-list instead of fc-match to select fonts
This is because there is no way to force fc-match to return a monospace font. So if the user specifies a non-existent font we end up with some non-monospaced font, which looks terrible. Also, this makes the font selection logic or macOS and Linux similar.
This commit is contained in:
@@ -18,10 +18,7 @@ from kitty.utils import get_logical_dpi
|
||||
if isosx:
|
||||
from .core_text import get_font_files, font_for_text, face_from_font, font_for_family, save_medium_face
|
||||
else:
|
||||
from .fontconfig import get_font_files, font_for_text, face_from_font, font_for_family
|
||||
|
||||
def save_medium_face(f):
|
||||
pass
|
||||
from .fontconfig import get_font_files, font_for_text, face_from_font, font_for_family, save_medium_face
|
||||
|
||||
|
||||
def create_face(font):
|
||||
@@ -35,10 +32,10 @@ def create_symbol_map(opts):
|
||||
faces = []
|
||||
for family in val.values():
|
||||
if family not in family_map:
|
||||
font = font_for_family(family)
|
||||
font, bold, italic = font_for_family(family)
|
||||
o = create_face(font)
|
||||
family_map[family] = len(faces)
|
||||
faces.append((o, font.bold, font.italic))
|
||||
faces.append((o, bold, italic))
|
||||
sm = tuple((a, b, family_map[f]) for (a, b), f in val.items())
|
||||
return sm, tuple(faces)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user