Merge pull request #9 from ilya-fedin/font-size
This commit is contained in:
commit
aa3506eecb
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) {
|
QFont ResolveFont(uint32 flags, int size) {
|
||||||
static auto Database = QFontDatabase();
|
static auto Database = QFontDatabase();
|
||||||
|
|
||||||
|
const auto fontSettings = Ui::Integration::Instance().fontSettings();
|
||||||
const auto overrideIsEmpty = GetPossibleEmptyOverride(flags).isEmpty();
|
const auto overrideIsEmpty = GetPossibleEmptyOverride(flags).isEmpty();
|
||||||
|
|
||||||
const auto bold = ((flags & FontBold) || (flags & FontSemibold));
|
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();
|
const auto point = good.isEmpty() ? size : good.front();
|
||||||
result = Database.font(custom.family, custom.style, point);
|
result = Database.font(custom.family, custom.style, point);
|
||||||
} else {
|
} else {
|
||||||
const auto fontSettings = Ui::Integration::Instance().fontSettings();
|
|
||||||
if (!fontSettings.useSystemFont || !overrideIsEmpty) {
|
if (!fontSettings.useSystemFont || !overrideIsEmpty) {
|
||||||
result.setFamily(GetFontOverride(flags));
|
result.setFamily(GetFontOverride(flags));
|
||||||
}
|
}
|
||||||
|
|
@ -80,7 +80,7 @@ QFont ResolveFont(uint32 flags, int size) {
|
||||||
|
|
||||||
result.setUnderline(flags & FontUnderline);
|
result.setUnderline(flags & FontUnderline);
|
||||||
result.setStrikeOut(flags & FontStrikeOut);
|
result.setStrikeOut(flags & FontStrikeOut);
|
||||||
result.setPixelSize(size);
|
result.setPixelSize(size + fontSettings.fontSize);
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ struct CustomFontSettings {
|
||||||
QString mainFont;
|
QString mainFont;
|
||||||
QString semiboldFont;
|
QString semiboldFont;
|
||||||
QString monospaceFont;
|
QString monospaceFont;
|
||||||
|
int fontSize = 0;
|
||||||
bool semiboldIsBold = false;
|
bool semiboldIsBold = false;
|
||||||
bool useSystemFont = false;
|
bool useSystemFont = false;
|
||||||
bool useOriginalMetrics = false;
|
bool useOriginalMetrics = false;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue