The text is blurry
Solved
Qt for WebAssembly
-
I solved this problem,.
The qt webAssembly don't have font, if we want to use chinese character, we need to pack the font file, the add to the application's font.
and we need to set the font hint preference, otherwise the font become blurry.int fontId = QFontDatabase::addApplicationFont(QStringLiteral(":/font/msyh.ttc")); QStringList fontFamilies = QFontDatabase::applicationFontFamilies(fontId); if (fontFamilies.size() > 0) { QFont font; font.setFamily(fontFamilies[0]);//设置全局字体 font.setHintingPreference(QFont::PreferFullHinting); QApplication::setFont(font); }
-
-
@Gaobo said in The text is blurry:
QFont::PreferFullHinting
Is QFont::PreferFullHinting a necessary setting? I tested it. After modifying the settings, some words were cleared and some words were blurred.
The most obvious ones are "唐" and "像"