Accomodate the fact that arch linux fira code ttf package excludes the variable version. Sigh.

This commit is contained in:
Kovid Goyal 2024-06-24 21:03:29 +05:30
parent a43188e778
commit 3a8362ca2b
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -53,7 +53,7 @@ def s(family: str, *expected: str, alternate=None) -> None:
self.ae(expected, actual)
except AssertionError:
if alternate:
self.ae(tuple(map(alternate, expected)), actual)
self.ae(alternate, actual)
else:
raise
@ -76,7 +76,10 @@ def t(family, psprefix, bold='Bold', italic='Italic', bi='', reg='Regular', allo
t('Source Code Pro', 'SourceCodePro', 'Semibold', 'It')
t('sourcecodeVf', 'SourceCodeVF', 'Semibold')
t('fira code', 'FiraCodeRoman', 'SemiBold', 'Regular', 'SemiBold')
# The Arch ttf-fira-code package excludes the variable fonts for some reason
t('fira code', 'FiraCodeRoman', 'SemiBold', 'Regular', 'SemiBold', alternate=(
'FiraCode-Regular', 'FiraCode-SemiBold', 'FiraCode-Retina', 'FiraCode-SemiBold'))
t('hack', 'Hack')
# some ubuntu systems (such as the build VM) have only the regular and
# bold faces of DejaVu Sans Mono installed.