[Libreoffice-commits] core.git: Branch 'private/timar/fontconfigcrash' - vcl/unx

Andras Timar (via logerrit) logerrit at kemper.freedesktop.org
Sat Jan 30 23:07:40 UTC 2021


 vcl/unx/generic/fontmanager/fontconfig.cxx |   11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

New commits:
commit 21c0aab3a710fd917d6ec6435dcb1ef5885f79e6
Author:     Andras Timar <andras.timar at collabora.com>
AuthorDate: Sun Jan 31 00:07:01 2021 +0100
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Sun Jan 31 00:07:01 2021 +0100

    debug 15
    
    Change-Id: If11d784ffb38038f587a62358f15babb29e2ce3e

diff --git a/vcl/unx/generic/fontmanager/fontconfig.cxx b/vcl/unx/generic/fontmanager/fontconfig.cxx
index 7684763c0cca..5405d54ca08b 100644
--- a/vcl/unx/generic/fontmanager/fontconfig.cxx
+++ b/vcl/unx/generic/fontmanager/fontconfig.cxx
@@ -20,7 +20,6 @@
 #include <stdlib.h>
 #include <memory>
 #include <iostream>
-#include <fstream>
 #include <unx/fontmanager.hxx>
 #include <unx/helper.hxx>
 #include <comphelper/sequence.hxx>
@@ -91,14 +90,12 @@ FontCfgWrapper::FontCfgWrapper()
 {
     std::cerr << "next: FcInit()" << std::endl;
     setenv("FC_DEBUG", "1024", 1);
-    std::ifstream conf("/etc/fonts/fonts.conf");
-    if(!conf)
+    if(getenv("SNAP"))
     {
-        std::cerr << "/etc/fonts/fonts.conf is not readable from LO core" << std::endl;
-        std::cerr << "Snap: " << getenv("SNAP") << std::endl;
+        std::string fontconfigPath(getenv("SNAP"));
+        fontconfigPath += "/etc/fonts";
+        setenv("FONTCONFIG_PATH", fontconfigPath.c_str(), 1);
     }
-    else
-        std::cerr << "/etc/fonts/fonts.conf is readable from LO core" << std::endl;
     FcInit();
     std::cerr << "FcInit() OK" << std::endl;
 }


More information about the Libreoffice-commits mailing list