mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-17 03:18:07 +00:00
Replace EmojiTwo by OpenMoji because Linux display no characters.
Use 2 ttf files because Linux/Windows cannot use the same. Remove a font loading warning.
This commit is contained in:
parent
98e92e291c
commit
f1c9301533
7 changed files with 46 additions and 11 deletions
|
|
@ -267,14 +267,7 @@ App::App(int &argc, char *argv[])
|
|||
// If not OpenGL, createRender is never call.
|
||||
QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGL);
|
||||
setWindowIcon(QIcon(Constants::WindowIconPath));
|
||||
lInfo() << "Loading Fonts";
|
||||
QDirIterator it(":/font/", QDirIterator::Subdirectories);
|
||||
while (it.hasNext()) {
|
||||
QString ttf = it.next();
|
||||
// lDebug()<< ttf;
|
||||
auto id = QFontDatabase::addApplicationFont(ttf);
|
||||
}
|
||||
|
||||
initFonts();
|
||||
//-------------------
|
||||
mLinphoneThread = new Thread(this);
|
||||
|
||||
|
|
@ -644,6 +637,42 @@ void App::initCppInterfaces() {
|
|||
|
||||
//------------------------------------------------------------
|
||||
|
||||
void App::initFonts() {
|
||||
lInfo() << "Loading Fonts";
|
||||
QStringList allFamilies;
|
||||
QDirIterator it(":/font/", QDirIterator::Subdirectories);
|
||||
while (it.hasNext()) {
|
||||
QString ttf = it.next();
|
||||
if (it.fileInfo().isFile()) {
|
||||
auto id = QFontDatabase::addApplicationFont(ttf);
|
||||
allFamilies << QFontDatabase::applicationFontFamilies(id);
|
||||
}
|
||||
}
|
||||
#ifdef Q_OS_LINUX
|
||||
QDirIterator itFonts(":/linux/font/", QDirIterator::Subdirectories);
|
||||
while (itFonts.hasNext()) {
|
||||
QString ttf = itFonts.next();
|
||||
if (itFonts.fileInfo().isFile()) {
|
||||
auto id = QFontDatabase::addApplicationFont(ttf);
|
||||
allFamilies << QFontDatabase::applicationFontFamilies(id);
|
||||
}
|
||||
}
|
||||
#else
|
||||
QDirIterator itFonts(":/other/font/", QDirIterator::Subdirectories);
|
||||
while (itFonts.hasNext()) {
|
||||
QString ttf = itFonts.next();
|
||||
if (itFonts.fileInfo().isFile()) {
|
||||
auto id = QFontDatabase::addApplicationFont(ttf);
|
||||
allFamilies << QFontDatabase::applicationFontFamilies(id);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
allFamilies.removeDuplicates();
|
||||
lInfo() << "Font families loaded:\n\t" << allFamilies.join("\n\t");
|
||||
}
|
||||
|
||||
//------------------------------------------------------------
|
||||
|
||||
void App::clean() {
|
||||
mDateUpdateTimer.stop();
|
||||
if (mEngine) {
|
||||
|
|
|
|||
|
|
@ -113,6 +113,7 @@ public:
|
|||
void init();
|
||||
void initCore();
|
||||
void initCppInterfaces();
|
||||
void initFonts();
|
||||
void restart();
|
||||
bool autoStartEnabled();
|
||||
void setSysTrayIcon();
|
||||
|
|
|
|||
Binary file not shown.
BIN
Linphone/data/font/OpenMoji-color-cbdt.ttf
Normal file
BIN
Linphone/data/font/OpenMoji-color-cbdt.ttf
Normal file
Binary file not shown.
BIN
Linphone/data/font/OpenMoji-color-colr0_svg.ttf
Normal file
BIN
Linphone/data/font/OpenMoji-color-colr0_svg.ttf
Normal file
Binary file not shown.
|
|
@ -1,6 +1,5 @@
|
|||
<RCC>
|
||||
<qresource prefix="/">
|
||||
<file>font/EmojiTwoCOLRv0.ttf</file>
|
||||
<file>font/Noto_Sans/NotoSans-Black.ttf</file>
|
||||
<file>font/Noto_Sans/NotoSans-BlackItalic.ttf</file>
|
||||
<file>font/Noto_Sans/NotoSans-Bold.ttf</file>
|
||||
|
|
@ -20,4 +19,10 @@
|
|||
<file>font/Noto_Sans/NotoSans-Thin.ttf</file>
|
||||
<file>font/Noto_Sans/NotoSans-ThinItalic.ttf</file>
|
||||
</qresource>
|
||||
<qresource prefix="/linux">
|
||||
<file>font/OpenMoji-color-cbdt.ttf</file>
|
||||
</qresource>
|
||||
<qresource prefix="/other">
|
||||
<file>font/OpenMoji-color-colr0_svg.ttf</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
|
|
|||
|
|
@ -38,8 +38,8 @@ QtObject {
|
|||
property double dp: 1
|
||||
|
||||
// Warning: Qt 6.8.1 (current version) and previous versions, Qt only support COLRv0 fonts. Don't try to use v1.
|
||||
property string emojiFont: "EmojiTwo COLRv0"
|
||||
property string flagFont: "EmojiTwo COLRv0"
|
||||
property string emojiFont: "OpenMoji Color"
|
||||
property string flagFont: "OpenMoji Color"
|
||||
property string defaultFont: "Noto Sans"
|
||||
|
||||
property color numericPadPressedButtonColor: "#EEF7F8"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue