Skip to content

Commit

Permalink
Temporarily disable google font downloads
Browse files Browse the repository at this point in the history
This isn't available since Google removed the static downloads,
we'll need another approach to handle this

Refs google/fonts#7481
Refs #57070
  • Loading branch information
nyalldawson committed Apr 11, 2024
1 parent 15c2b80 commit 2554a90
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/core/textrenderer/qgsfontmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1795,6 +1795,8 @@ QString QgsFontManager::urlForFontDownload( const QString &family, QString &matc
QStringLiteral( "Zilla Slab Highlight" ),
};

// temporarily unavailable -- see https://github.com/google/fonts/issues/7481
#if 0
auto cleanFontFamily = []( const QString & family ) -> QString
{
const thread_local QRegularExpression charsToRemove( QStringLiteral( "[^a-z]" ) );
Expand All @@ -1807,6 +1809,7 @@ QString QgsFontManager::urlForFontDownload( const QString &family, QString &matc

matchedFamily.clear();
const QString cleanedFamily = cleanFontFamily( family );

for ( const QString &candidate : sGoogleFonts )
{
if ( cleanFontFamily( candidate ) == cleanedFamily )
Expand All @@ -1817,6 +1820,11 @@ QString QgsFontManager::urlForFontDownload( const QString &family, QString &matc
return QStringLiteral( "https://fonts.google.com/download?family=%1" ).arg( paramName );
}
}
#else
( void )family;
matchedFamily.clear();
#endif

return QString();
}

Expand Down

0 comments on commit 2554a90

Please sign in to comment.