Fix bolding with packaged fonts

This commit is contained in:
Ilya Fedin 2020-05-10 19:08:03 +04:00 committed by John Preston
parent 95b49979fb
commit d05d9b214d

View file

@ -313,13 +313,17 @@ FontData::FontData(int size, uint32 flags, int family, Font *other)
}
f.setPixelSize(size);
f.setBold((_flags & FontBold) || (_flags & FontSemibold));
f.setItalic(_flags & FontItalic);
f.setUnderline(_flags & FontUnderline);
f.setStrikeOut(_flags & FontStrikeOut);
if ((_flags & FontBold) || (_flags & FontSemibold)) {
#ifdef DESKTOP_APP_USE_PACKAGED_FONTS
f.setWeight(QFont::DemiBold);
#else // DESKTOP_APP_USE_PACKAGED_FONTS
f.setBold(true);
f.setStyleName("Semibold");
#endif // !DESKTOP_APP_USE_PACKAGED_FONTS
}
m = QFontMetrics(f);