fontconfig: Prefer semi-bold as bold weight even for system selection

This commit is contained in:
Kovid Goyal
2024-05-15 11:57:22 +05:30
parent ea65ede572
commit 1780028420
3 changed files with 7 additions and 4 deletions

View File

@@ -288,6 +288,8 @@ FC_MONO: int = 100
FC_DUAL: int FC_DUAL: int
FC_WEIGHT_REGULAR: int FC_WEIGHT_REGULAR: int
FC_WEIGHT_BOLD: int FC_WEIGHT_BOLD: int
FC_WEIGHT_SEMIBOLD: int
FC_WEIGHT_MEDIUM: int
FC_WIDTH_NORMAL: int FC_WIDTH_NORMAL: int
FC_SLANT_ROMAN: int FC_SLANT_ROMAN: int
FC_SLANT_ITALIC: int FC_SLANT_ITALIC: int

View File

@@ -9,11 +9,13 @@ from kitty.fast_data_types import (
FC_MONO, FC_MONO,
FC_SLANT_ITALIC, FC_SLANT_ITALIC,
FC_SLANT_ROMAN, FC_SLANT_ROMAN,
FC_WEIGHT_BOLD,
FC_WEIGHT_REGULAR, FC_WEIGHT_REGULAR,
FC_WIDTH_NORMAL, FC_WIDTH_NORMAL,
fc_list, 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.fast_data_types import fc_match as fc_match_impl
from kitty.typing import FontConfigPattern from kitty.typing import FontConfigPattern

View File

@@ -42,10 +42,9 @@ class Selection(BaseTest):
s(family, *expected) s(family, *expected)
if has_source_code_pro: 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: if has_source_code_vf:
s('sourcecodeVf', 'SourceCodeVF-Regular', 'SourceCodeVF-Bold', 'SourceCodeVF-Italic', 'SourceCodeVF-BoldItalic') both('sourcecodeVf', 'SourceCodeVF-Regular', 'SourceCodeVF-Semibold', 'SourceCodeVF-Italic', 'SourceCodeVF-SemiboldItalic')
s('family=sourcecodeVf', 'SourceCodeVF-Regular', 'SourceCodeVF-Semibold', 'SourceCodeVF-Italic', 'SourceCodeVF-SemiboldItalic')
class Rendering(BaseTest): class Rendering(BaseTest):