Detect the lack of semibold style
This commit is contained in:
parent
cb57bef3f0
commit
7fcfaa9dd5
1 changed files with 8 additions and 0 deletions
|
|
@ -227,6 +227,14 @@ bool LoadCustomFont(const QString &filePath) {
|
|||
result.setWeight(((flags & FontBold) || (flags & FontSemibold))
|
||||
? QFont::DemiBold
|
||||
: QFont::Normal);
|
||||
if (result.bold()) {
|
||||
const auto style = QFontInfo(result).styleName();
|
||||
if (!style.isEmpty() && !style.startsWith(
|
||||
"Semibold",
|
||||
Qt::CaseInsensitive)) {
|
||||
result.setBold(true);
|
||||
}
|
||||
}
|
||||
result.setItalic(flags & FontItalic);
|
||||
result.setUnderline(flags & FontUnderline);
|
||||
result.setStrikeOut(flags & FontStrikeOut);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue