Merge remote-tracking branch 'upstream/bold'
This commit is contained in:
commit
2e6262d1d4
5 changed files with 19 additions and 10 deletions
BIN
fonts/DAOpenSansSemiboldAsBold.ttf
Normal file
BIN
fonts/DAOpenSansSemiboldAsBold.ttf
Normal file
Binary file not shown.
BIN
fonts/DAOpenSansSemiboldItalicAsBold.ttf
Normal file
BIN
fonts/DAOpenSansSemiboldItalicAsBold.ttf
Normal file
Binary file not shown.
BIN
fonts/DAVazirMediumAsBold.ttf
Normal file
BIN
fonts/DAVazirMediumAsBold.ttf
Normal file
Binary file not shown.
|
|
@ -2,12 +2,12 @@
|
||||||
<qresource prefix="/gui/fonts">
|
<qresource prefix="/gui/fonts">
|
||||||
<file>DAOpenSansRegular.ttf</file>
|
<file>DAOpenSansRegular.ttf</file>
|
||||||
<file>DAOpenSansRegularItalic.ttf</file>
|
<file>DAOpenSansRegularItalic.ttf</file>
|
||||||
<file>DAOpenSansBold.ttf</file>
|
<file>DAOpenSansSemiboldAsBold.ttf</file>
|
||||||
<file>DAOpenSansBoldItalic.ttf</file>
|
<file>DAOpenSansSemiboldItalicAsBold.ttf</file>
|
||||||
<file>DAOpenSansSemibold.ttf</file>
|
<file>DAOpenSansSemibold.ttf</file>
|
||||||
<file>DAOpenSansSemiboldItalic.ttf</file>
|
<file>DAOpenSansSemiboldItalic.ttf</file>
|
||||||
<file>DAVazirRegular.ttf</file>
|
<file>DAVazirRegular.ttf</file>
|
||||||
<file>DAVazirBold.ttf</file>
|
<file>DAVazirMediumAsBold.ttf</file>
|
||||||
<file>DAVazirMedium.ttf</file>
|
<file>DAVazirMedium.ttf</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
<qresource prefix="/fc">
|
<qresource prefix="/fc">
|
||||||
|
|
|
||||||
|
|
@ -195,19 +195,27 @@ enum {
|
||||||
FontTypesCount,
|
FontTypesCount,
|
||||||
};
|
};
|
||||||
#ifndef DESKTOP_APP_USE_PACKAGED_FONTS
|
#ifndef DESKTOP_APP_USE_PACKAGED_FONTS
|
||||||
|
QString FontTypeFiles[FontTypesCount] = {
|
||||||
|
"DAOpenSansRegular",
|
||||||
|
"DAOpenSansRegularItalic",
|
||||||
|
"DAOpenSansSemiboldAsBold",
|
||||||
|
"DAOpenSansSemiboldItalicAsBold",
|
||||||
|
"DAOpenSansSemiboldAsBold",
|
||||||
|
"DAOpenSansSemiboldItalicAsBold",
|
||||||
|
};
|
||||||
QString FontTypeNames[FontTypesCount] = {
|
QString FontTypeNames[FontTypesCount] = {
|
||||||
"DAOpenSansRegular",
|
"DAOpenSansRegular",
|
||||||
"DAOpenSansRegularItalic",
|
"DAOpenSansRegularItalic",
|
||||||
"DAOpenSansBold",
|
"DAOpenSansSemibold",
|
||||||
"DAOpenSansBoldItalic",
|
"DAOpenSansSemiboldItalic",
|
||||||
"DAOpenSansSemibold",
|
"DAOpenSansSemibold",
|
||||||
"DAOpenSansSemiboldItalic",
|
"DAOpenSansSemiboldItalic",
|
||||||
};
|
};
|
||||||
QString FontTypePersianFallback[FontTypesCount] = {
|
QString FontTypePersianFallback[FontTypesCount] = {
|
||||||
"DAVazirRegular",
|
"DAVazirRegular",
|
||||||
"DAVazirRegular",
|
"DAVazirRegular",
|
||||||
"DAVazirBold",
|
"DAVazirMedium",
|
||||||
"DAVazirBold",
|
"DAVazirMedium",
|
||||||
"DAVazirMedium",
|
"DAVazirMedium",
|
||||||
"DAVazirMedium",
|
"DAVazirMedium",
|
||||||
};
|
};
|
||||||
|
|
@ -264,9 +272,10 @@ void StartFonts() {
|
||||||
|
|
||||||
bool areGood[FontTypesCount] = { false };
|
bool areGood[FontTypesCount] = { false };
|
||||||
for (auto i = 0; i != FontTypesCount; ++i) {
|
for (auto i = 0; i != FontTypesCount; ++i) {
|
||||||
|
const auto file = FontTypeFiles[i];
|
||||||
const auto name = FontTypeNames[i];
|
const auto name = FontTypeNames[i];
|
||||||
const auto flags = FontTypeFlags[i];
|
const auto flags = FontTypeFlags[i];
|
||||||
areGood[i] = LoadCustomFont(":/gui/fonts/" + name + ".ttf", name, flags);
|
areGood[i] = LoadCustomFont(":/gui/fonts/" + file + ".ttf", name, flags);
|
||||||
Overrides[i] = name;
|
Overrides[i] = name;
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
|
|
@ -390,12 +399,12 @@ FontData::FontData(int size, uint32 flags, int family, Font *other)
|
||||||
}
|
}
|
||||||
|
|
||||||
f.setPixelSize(size);
|
f.setPixelSize(size);
|
||||||
f.setBold(_flags & FontBold);
|
f.setBold((_flags & FontBold) || (_flags & FontSemibold));
|
||||||
f.setItalic(_flags & FontItalic);
|
f.setItalic(_flags & FontItalic);
|
||||||
f.setUnderline(_flags & FontUnderline);
|
f.setUnderline(_flags & FontUnderline);
|
||||||
f.setStrikeOut(_flags & FontStrikeOut);
|
f.setStrikeOut(_flags & FontStrikeOut);
|
||||||
|
|
||||||
if (_flags & FontSemibold) {
|
if ((_flags & FontBold) || (_flags & FontSemibold)) {
|
||||||
if (CustomSemiboldIsBold) {
|
if (CustomSemiboldIsBold) {
|
||||||
f.setBold(true);
|
f.setBold(true);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue