[Libreoffice-commits] core.git: vcl/qt5

Jan-Marek Glogowski (via logerrit) logerrit at kemper.freedesktop.org
Sat Mar 23 12:57:17 UTC 2019


 vcl/qt5/Qt5Graphics_Text.cxx |   15 ---------------
 1 file changed, 15 deletions(-)

New commits:
commit 9ad2443bfe127dfe8e8940461119d36872b6c186
Author:     Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Sat Mar 23 01:15:27 2019 +0000
Commit:     Jan-Marek Glogowski <glogow at fbihome.de>
CommitDate: Sat Mar 23 13:56:15 2019 +0100

    tdf#123072 Qt5 don't register unknown PSP fonts
    
    LO's own font handling backend has some additional font styles,
    which are unknown to Qt, probably because it uses some stricter
    handling to decide which fonts are "usable", and because Qt seems
    to not know about some style types AFAIK.
    
    The main problem is QFontDatabase::addApplicationFont, as this
    seems to parse the whole font instead of a kind of registration,
    which takes ages for something like the Noto CJK style variants.
    
    As a workaround this drops the registration of all the additional
    PSP fonts. Both Qt5 and PSP use fontconfig but there is definitly
    some difference here, which needs to be resolved in some other
    way at some point.
    
    Change-Id: Id63cd0258ff56ee988323551820500b2c72a12be
    Reviewed-on: https://gerrit.libreoffice.org/69576
    Tested-by: Jenkins
    Reviewed-by: Jan-Marek Glogowski <glogow at fbihome.de>

diff --git a/vcl/qt5/Qt5Graphics_Text.cxx b/vcl/qt5/Qt5Graphics_Text.cxx
index 5943b32c611b..693f67fe2df0 100644
--- a/vcl/qt5/Qt5Graphics_Text.cxx
+++ b/vcl/qt5/Qt5Graphics_Text.cxx
@@ -97,9 +97,6 @@ void Qt5Graphics::GetDevFontList(PhysicalFontCollection* pPFC)
         return;
 
     QFontDatabase aFDB;
-    QStringList aFontFamilyList;
-    if (bUseFontconfig)
-        aFontFamilyList = aFDB.families();
     GlyphCache& rGC = GlyphCache::GetInstance();
     psp::PrintFontManager& rMgr = psp::PrintFontManager::get();
     ::std::vector<psp::fontID> aList;
@@ -120,18 +117,6 @@ void Qt5Graphics::GetDevFontList(PhysicalFontCollection* pPFC)
         aDFA.IncreaseQualityBy(4096);
         const OString& rFileName = rMgr.getFontFileSysPath(aInfo.m_nID);
         rGC.AddFontFile(rFileName, nFaceNum, nVariantNum, aInfo.m_nID, aDFA);
-
-        // register font files unknown to Qt
-        if (bUseFontconfig)
-        {
-            QString aFilename = toQString(
-                OStringToOUString(rMgr.getFontFileSysPath(aInfo.m_nID), RTL_TEXTENCODING_UTF8));
-            QRawFont aRawFont(aFilename, 0.0);
-            QString aFamilyName = aRawFont.familyName();
-            if (!aFontFamilyList.contains(aFamilyName)
-                || !aFDB.styles(aFamilyName).contains(aRawFont.styleName()))
-                QFontDatabase::addApplicationFont(aFilename);
-        }
     }
 
     if (bUseFontconfig)


More information about the Libreoffice-commits mailing list