Add callbacks for fonts init.

This commit is contained in:
John Preston 2020-03-30 12:16:01 +04:00
parent 23009b62ad
commit 246aa24530
3 changed files with 20 additions and 1 deletions

View file

@ -36,6 +36,12 @@ void Integration::textActionsUpdated() {
void Integration::activationFromTopPanel() {
}
void Integration::startFontsBegin() {
}
void Integration::startFontsEnd() {
}
std::shared_ptr<ClickHandler> Integration::createLinkHandler(
EntityType type,
const QString &text,

View file

@ -39,6 +39,9 @@ public:
virtual void textActionsUpdated();
virtual void activationFromTopPanel();
virtual void startFontsBegin();
virtual void startFontsEnd();
[[nodiscard]] virtual std::shared_ptr<ClickHandler> createLinkHandler(
EntityType type,
const QString &text,

View file

@ -6,8 +6,9 @@
//
#include "ui/style/style_core_font.h"
#include "base/algorithm.h"
#include "ui/ui_log.h"
#include "base/algorithm.h"
#include "ui/integration.h"
#include <QtCore/QMap>
#include <QtCore/QVector>
@ -137,6 +138,11 @@ void StartFonts() {
style_InitFontsResource();
const auto integrationExists = Ui::Integration::Exists();
if (integrationExists) {
Ui::Integration::Instance().startFontsBegin();
}
#ifndef DESKTOP_APP_USE_PACKAGED_FONTS
bool areGood[FontTypesCount] = { false };
for (auto i = 0; i != FontTypesCount; ++i) {
@ -173,6 +179,10 @@ void StartFonts() {
QFont::insertSubstitutions(name, list);
}
#endif // Q_OS_MAC
if (integrationExists) {
Ui::Integration::Instance().startFontsEnd();
}
}
QString GetPossibleEmptyOverride(const QString &familyName, int32 flags) {