Update font description and add native font dialog setting to config

This commit is contained in:
Veronica Berglyd Olsen
2024-05-22 23:31:28 +02:00
parent cc32674b0f
commit 1fe7ca3db8
4 changed files with 9 additions and 3 deletions
+3 -1
View File
@@ -405,7 +405,9 @@ def describeFont(font: QFont) -> str:
"""Describe a font in a way that can be displayed on the GUI."""
if isinstance(font, QFont):
info = QFontInfo(font)
return f"{font.family()} {info.styleName()} @ {font.pointSize()} pt"
family = info.family()
styles = [v for v in info.styleName().split() if v not in family]
return " ".join([f"{info.pointSize()} pt", family] + styles)
return "Error"