From 1780028420f76e387bbda24c4d58867bfa3ccd4e Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 15 May 2024 11:57:22 +0530 Subject: [PATCH] fontconfig: Prefer semi-bold as bold weight even for system selection --- kitty/fast_data_types.pyi | 2 ++ kitty/fonts/fontconfig.py | 4 +++- kitty_tests/fonts.py | 5 ++--- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/kitty/fast_data_types.pyi b/kitty/fast_data_types.pyi index a865cea45..4114efc70 100644 --- a/kitty/fast_data_types.pyi +++ b/kitty/fast_data_types.pyi @@ -288,6 +288,8 @@ FC_MONO: int = 100 FC_DUAL: int FC_WEIGHT_REGULAR: int FC_WEIGHT_BOLD: int +FC_WEIGHT_SEMIBOLD: int +FC_WEIGHT_MEDIUM: int FC_WIDTH_NORMAL: int FC_SLANT_ROMAN: int FC_SLANT_ITALIC: int diff --git a/kitty/fonts/fontconfig.py b/kitty/fonts/fontconfig.py index e4d92b1fb..14356f40b 100644 --- a/kitty/fonts/fontconfig.py +++ b/kitty/fonts/fontconfig.py @@ -9,11 +9,13 @@ from kitty.fast_data_types import ( FC_MONO, FC_SLANT_ITALIC, FC_SLANT_ROMAN, - FC_WEIGHT_BOLD, FC_WEIGHT_REGULAR, FC_WIDTH_NORMAL, fc_list, ) +from kitty.fast_data_types import ( + FC_WEIGHT_SEMIBOLD as FC_WEIGHT_BOLD, +) from kitty.fast_data_types import fc_match as fc_match_impl from kitty.typing import FontConfigPattern diff --git a/kitty_tests/fonts.py b/kitty_tests/fonts.py index ea70f5282..e45d6560c 100644 --- a/kitty_tests/fonts.py +++ b/kitty_tests/fonts.py @@ -42,10 +42,9 @@ class Selection(BaseTest): s(family, *expected) if has_source_code_pro: - both('Source Code Pro', 'SourceCodePro-Regular', 'SourceCodePro-Bold', 'SourceCodePro-It', 'SourceCodePro-BoldIt') + both('Source Code Pro', 'SourceCodePro-Regular', 'SourceCodePro-Semibold', 'SourceCodePro-It', 'SourceCodePro-SemiboldIt') if has_source_code_vf: - s('sourcecodeVf', 'SourceCodeVF-Regular', 'SourceCodeVF-Bold', 'SourceCodeVF-Italic', 'SourceCodeVF-BoldItalic') - s('family=sourcecodeVf', 'SourceCodeVF-Regular', 'SourceCodeVF-Semibold', 'SourceCodeVF-Italic', 'SourceCodeVF-SemiboldItalic') + both('sourcecodeVf', 'SourceCodeVF-Regular', 'SourceCodeVF-Semibold', 'SourceCodeVF-Italic', 'SourceCodeVF-SemiboldItalic') class Rendering(BaseTest):