viewertexteditor: force weight and italic

Windows seems to require this for some reason
This commit is contained in:
itsmattkc
2022-03-30 15:06:33 -07:00
parent 102b782215
commit 7c68efb0ce
+9
View File
@@ -218,8 +218,17 @@ void ViewerTextEditor::SetFamily(const QString &s)
void ViewerTextEditor::SetStyle(const QString &s)
{
ViewerTextEditorToolBar *toolbar = static_cast<ViewerTextEditorToolBar *>(sender());
QTextCharFormat f;
// NOTE: Windows appears to require setting weight and italic manually instead of just the style name
QFontDatabase fd;
f.setFontWeight(fd.weight(toolbar->GetFontFamily(), s));
f.setFontItalic(fd.italic(toolbar->GetFontFamily(), s));
f.setFontStyleName(s);
MergeCharFormat(f);
}