Move Windows font overrides away from translations

Determine which font to use with a dedicated function instead
This commit is contained in:
Alexander Babikov
2024-03-20 16:48:09 +05:00
parent 8e06b5449f
commit ae7d4454cb
27 changed files with 24 additions and 144 deletions

View File

@@ -153,6 +153,25 @@ ProgSettings::on_pushButton_released()
ui->comboBox->setCurrentIndex(0);
}
#ifdef Q_OS_WINDOWS
/* Return the standard font name on Windows, which is overridden per-language
to prevent CJK fonts with embedded bitmaps being chosen as a fallback. */
QString
ProgSettings::getFontName(uint32_t lcid)
{
if (lcid == 0x0804) /* zh-CN */
return "Microsoft YaHei";
else if (lcid == 0x0404) /* zh-TW */
return "Microsoft JhengHei";
else if (lcid == 0x0411) /* ja-JP */
return "Meiryo UI";
else if (lcid == 0x0412) /* ko-KR */
return "Malgun Gothic";
else
return "Segoe UI";
}
#endif
void
ProgSettings::loadTranslators(QObject *parent)
{