blob: e5b896f4318a32c60134a81009a4cbf6a5e64ae3 [file] [log] [blame]
// Copyright 2016 The Android Open Source Project
// This software is licensed under the terms of the GNU General Public
// License version 2, as published by the Free Software Foundation, and
// may be copied, distributed, and modified under those terms.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
#include "android/skin/qt/init-qt.h"
#include "android/skin/qt/qt-settings.h"
#include "android/utils/debug.h"
#include <QCoreApplication>
#include <QFontDatabase>
void androidQtDefaultInit() {
Q_INIT_RESOURCE(resources);
// Give Qt the fonts from our resource file
QFontDatabase fontDb;
int fontId = fontDb.addApplicationFont(":/lib/fonts/Roboto");
if (fontId < 0) {
VERBOSE_PRINT(init,
"Count not load font resource: \":/lib/fonts/Roboto");
}
fontId = fontDb.addApplicationFont(":/lib/fonts/Roboto-Bold");
if (fontId < 0) {
VERBOSE_PRINT(
init,
"Count not load font resource: \":/lib/fonts/Roboto-Bold");
}
fontId = fontDb.addApplicationFont(":/lib/fonts/Roboto-Medium");
if (fontId < 0) {
VERBOSE_PRINT(
init,
"Count not load font resource: \":/lib/fonts/Roboto-Medium");
}
// Setup the application properties
QCoreApplication::setOrganizationName(Ui::Settings::ORG_NAME);
QCoreApplication::setOrganizationDomain(Ui::Settings::ORG_DOMAIN);
QCoreApplication::setApplicationName(Ui::Settings::APP_NAME);
}