This commit is contained in:
parhelia512 2025-09-30 01:28:29 +08:00
parent d655b14f69
commit 4942c25f18
4 changed files with 10 additions and 6 deletions

View File

@ -222,6 +222,10 @@ set(PROJECT_SOURCES
src/dataStore/ProxyEntity.cpp src/dataStore/ProxyEntity.cpp
) )
if (NOT APPLE AND Qt6_VERSION VERSION_GREATER_EQUAL 6.9.0)
list(APPEND PROJECT_SOURCES res/EmojiFont.qrc)
endif ()
# Qt exe # Qt exe
qt_add_executable(Throne qt_add_executable(Throne
MANUAL_FINALIZATION MANUAL_FINALIZATION

5
res/EmojiFont.qrc Normal file
View File

@ -0,0 +1,5 @@
<RCC>
<qresource prefix="/font">
<file alias="notoEmoji">font/NotoColorEmoji.ttf</file>
</qresource>
</RCC>

View File

@ -24,7 +24,4 @@
<file alias="Tun.png">public/Tun.png</file> <file alias="Tun.png">public/Tun.png</file>
<file>dashboard-notice.html</file> <file>dashboard-notice.html</file>
</qresource> </qresource>
<qresource prefix="/font">
<file alias="notoEmoji">font/NotoColorEmoji.ttf</file>
</qresource>
</RCC> </RCC>

View File

@ -69,15 +69,13 @@ int main(int argc, char* argv[]) {
QApplication::setQuitOnLastWindowClosed(false); QApplication::setQuitOnLastWindowClosed(false);
QApplication a(argc, argv); QApplication a(argc, argv);
#ifndef Q_OS_MACOS #if !defined(Q_OS_MACOS) && (QT_VERSION >= QT_VERSION_CHECK(6,9,0))
// Load the emoji fonts // Load the emoji fonts
int fontId = QFontDatabase::addApplicationFont(":/font/notoEmoji"); int fontId = QFontDatabase::addApplicationFont(":/font/notoEmoji");
if (fontId >= 0) if (fontId >= 0)
{ {
#if (QT_VERSION >= QT_VERSION_CHECK(6,9,0))
QStringList fontFamilies = QFontDatabase::applicationFontFamilies(fontId); QStringList fontFamilies = QFontDatabase::applicationFontFamilies(fontId);
QFontDatabase::setApplicationEmojiFontFamilies(fontFamilies); QFontDatabase::setApplicationEmojiFontFamilies(fontFamilies);
#endif
} else } else
{ {
qDebug() << "could not load noto font!"; qDebug() << "could not load noto font!";