Skip to content

Commit

Permalink
Revert "[Fix] External font loading problem with text cursor accessin…
Browse files Browse the repository at this point in the history
…g unaccessible textbase"

This reverts commit 78c2a4a to fix the issue reporeted in https://musescore.org/en/node/368828
  • Loading branch information
Jojo-Schmitz committed Sep 16, 2024
1 parent 0cd06b4 commit 4f02df4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
1 change: 0 additions & 1 deletion libmscore/mscore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,6 @@ void MScore::init()
":/fonts/finalebroadway/FinaleBroadwayText.otf",
};

// Include internal fonts into QFontDatabase
for (unsigned i = 0; i < sizeof(fonts)/sizeof(*fonts); ++i) {
QString str(fonts[i]);
if (-1 == QFontDatabase::addApplicationFont(str)) {
Expand Down
18 changes: 6 additions & 12 deletions libmscore/sym.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6429,6 +6429,11 @@ void ScoreFont::draw(SymId id, QPainter* painter, const QSizeF& mag, const QPoin

if (MScore::pdfPrinting) {
if (font == 0) {
QString s(_fontPath+_filename);
if (-1 == QFontDatabase::addApplicationFont(s)) {
qDebug("Mscore: fatal error: cannot load internal font <%s>", qPrintable(s));
return;
}
font = new QFont;
font->setWeight(QFont::Normal);
font->setItalic(false);
Expand Down Expand Up @@ -6557,7 +6562,7 @@ const char* Sym::id2name(SymId id)
// load default score font
//---------------------------------------------------------

void Ms::ScoreFont::initScoreFonts()
void ScoreFont::initScoreFonts()
{
QJsonObject glyphNamesJson(ScoreFont::initGlyphNamesJson());
if (glyphNamesJson.empty())
Expand Down Expand Up @@ -6670,17 +6675,6 @@ void ScoreFont::scanUserFonts(const QString& path, bool system)

_allScoreFonts = _builtinScoreFonts;
_allScoreFonts << _userScoreFonts << _systemScoreFonts;

// Include external fonts into QFontDatabase
for (auto& usrFont : _userScoreFonts) {
QString s(usrFont._fontPath + usrFont._filename);
if (-1 == QFontDatabase::addApplicationFont(s)) {
if (!MScore::testMode)
qDebug("Mscore: fatal error: cannot load external font <%s>", qPrintable(s));
if (!MScore::debugMode && !MScore::testMode)
exit(-1);
}
}
}

//---------------------------------------------------------
Expand Down

0 comments on commit 4f02df4

Please sign in to comment.