Allow to change font size
This commit is contained in:
parent
b63ea44056
commit
0f744f1d97
2 changed files with 3 additions and 2 deletions
|
|
@ -29,6 +29,7 @@ void SetCustomFonts(const CustomFont ®ular, const CustomFont &bold) {
|
|||
QFont ResolveFont(uint32 flags, int size) {
|
||||
static auto Database = QFontDatabase();
|
||||
|
||||
const auto fontSettings = Ui::Integration::Instance().fontSettings();
|
||||
const auto overrideIsEmpty = GetPossibleEmptyOverride(flags).isEmpty();
|
||||
|
||||
const auto bold = ((flags & FontBold) || (flags & FontSemibold));
|
||||
|
|
@ -47,7 +48,6 @@ QFont ResolveFont(uint32 flags, int size) {
|
|||
const auto point = good.isEmpty() ? size : good.front();
|
||||
result = Database.font(custom.family, custom.style, point);
|
||||
} else {
|
||||
const auto fontSettings = Ui::Integration::Instance().fontSettings();
|
||||
if (!fontSettings.useSystemFont || !overrideIsEmpty) {
|
||||
result.setFamily(GetFontOverride(flags));
|
||||
}
|
||||
|
|
@ -80,7 +80,7 @@ QFont ResolveFont(uint32 flags, int size) {
|
|||
|
||||
result.setUnderline(flags & FontUnderline);
|
||||
result.setStrikeOut(flags & FontStrikeOut);
|
||||
result.setPixelSize(size);
|
||||
result.setPixelSize(size + fontSettings.fontSize);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ struct CustomFontSettings {
|
|||
QString mainFont;
|
||||
QString semiboldFont;
|
||||
QString monospaceFont;
|
||||
int fontSize = 0;
|
||||
bool semiboldIsBold = false;
|
||||
bool useSystemFont = false;
|
||||
bool useOriginalMetrics = false;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue