vcl/inc/unx/fontmanager.hxx | 6 +----- vcl/unx/generic/fontmanager/fontconfig.cxx | 14 ++++---------- vcl/unx/generic/fontmanager/fontmanager.cxx | 11 ++--------- vcl/unx/generic/fontmanager/helper.cxx | 11 ++--------- 4 files changed, 9 insertions(+), 33 deletions(-)
New commits: commit a7c51323b7343f82b5aea6098f5d5e31a8bad0e9 Author: Khaled Hosny <khaledho...@eglug.org> Date: Thu Dec 29 22:15:01 2016 +0200 Drop check for ancient FontConfig releases FontConfig 2.4.1 that fixes this bug was released 10 years ago. Change-Id: Ib0970d3916909fe14eb4e3ed1425f925a13160ad diff --git a/vcl/unx/generic/fontmanager/fontconfig.cxx b/vcl/unx/generic/fontmanager/fontconfig.cxx index 4d9fae1..9a58e91 100644 --- a/vcl/unx/generic/fontmanager/fontconfig.cxx +++ b/vcl/unx/generic/fontmanager/fontconfig.cxx @@ -221,8 +221,7 @@ FcFontSet* FontCfgWrapper::getFontSet() { m_pOutlineSet = FcFontSetCreate(); addFontSet( FcSetSystem ); - if( FcGetVersion() > 20400 ) // #i85462# prevent crashes - addFontSet( FcSetApplication ); + addFontSet( FcSetApplication ); ::std::sort(m_pOutlineSet->fonts,m_pOutlineSet->fonts+m_pOutlineSet->nfont,SortFont()); } @@ -659,11 +658,6 @@ void PrintFontManager::deinitFontconfig() void PrintFontManager::addFontconfigDir( const OString& rDirName ) { - // workaround for a stability problems in older FC versions - // when handling application specific fonts - const int nVersion = FcGetVersion(); - if( nVersion <= 20400 ) - return; const char* pDirName = rDirName.getStr(); bool bDirOk = (FcConfigAppFontAddDir(FcConfigGetCurrent(), reinterpret_cast<FcChar8 const *>(pDirName) ) == FcTrue); commit aef0a650d35620692b2451c684d38a2b3fecf5a0 Author: Khaled Hosny <khaledho...@eglug.org> Date: Thu Dec 29 21:52:36 2016 +0200 Simplify this a bit The return value from addFontconfigDir() was effectively unused after the recent changes in this code. Change-Id: I99796442fe3bcaf767f3b804afd417b9d043c2a9 diff --git a/vcl/inc/unx/fontmanager.hxx b/vcl/inc/unx/fontmanager.hxx index d922301..bf5e7b0 100644 --- a/vcl/inc/unx/fontmanager.hxx +++ b/vcl/inc/unx/fontmanager.hxx @@ -205,12 +205,8 @@ class VCL_PLUGIN_PUBLIC PrintFontManager since fontconfig is asked for font substitutes before OOo will check for font availability and fontconfig will happily substitute fonts it doesn't know (e.g. "Arial Narrow" -> "DejaVu Sans Book"!) it becomes necessary to tell the library about all the hidden font treasures - - @returns - true if libfontconfig accepted the directory - false else (e.g. no libfontconfig found) */ - static bool addFontconfigDir(const OString& rDirectory); + static void addFontconfigDir(const OString& rDirectory); std::set<OString> m_aPreviousLangSupportRequests; #if ENABLE_DBUS diff --git a/vcl/unx/generic/fontmanager/fontconfig.cxx b/vcl/unx/generic/fontmanager/fontconfig.cxx index 3c594f5..4d9fae1 100644 --- a/vcl/unx/generic/fontmanager/fontconfig.cxx +++ b/vcl/unx/generic/fontmanager/fontconfig.cxx @@ -657,13 +657,13 @@ void PrintFontManager::deinitFontconfig() FontCfgWrapper::release(); } -bool PrintFontManager::addFontconfigDir( const OString& rDirName ) +void PrintFontManager::addFontconfigDir( const OString& rDirName ) { // workaround for a stability problems in older FC versions // when handling application specific fonts const int nVersion = FcGetVersion(); if( nVersion <= 20400 ) - return false; + return; const char* pDirName = rDirName.getStr(); bool bDirOk = (FcConfigAppFontAddDir(FcConfigGetCurrent(), reinterpret_cast<FcChar8 const *>(pDirName) ) == FcTrue); @@ -672,7 +672,7 @@ bool PrintFontManager::addFontconfigDir( const OString& rDirName ) #endif if( !bDirOk ) - return false; + return; // load dir-specific fc-config file too if available const OString aConfFileName = rDirName + "/fc_local.conf"; @@ -686,7 +686,7 @@ bool PrintFontManager::addFontconfigDir( const OString& rDirName ) fprintf( stderr, "FcConfigParseAndLoad( \"%s\") => %d\n", aConfFileName.getStr(), bCfgOk ); } - return true; + return; } static void addtopattern(FcPattern *pPattern, diff --git a/vcl/unx/generic/fontmanager/fontmanager.cxx b/vcl/unx/generic/fontmanager/fontmanager.cxx index 8e7ab17..bff7e4e 100644 --- a/vcl/unx/generic/fontmanager/fontmanager.cxx +++ b/vcl/unx/generic/fontmanager/fontmanager.cxx @@ -759,15 +759,8 @@ void PrintFontManager::initialize() { OString aToken = aPath.getToken( 0, ';', nIndex ); normPath( aToken ); - if ( aToken.isEmpty() ) - { - continue; - } - // if registering an app-specific fontdir with fontconfig fails - // and fontconfig-based substitutions are enabled - // then trying to use these app-specific fonts doesn't make sense - if( !addFontconfigDir( aToken ) ) - continue; + if (!aToken.isEmpty()) + addFontconfigDir(aToken); } while( nIndex >= 0 ); } commit bd26052f4b07e2fb7aa2a6996cfdb7777134c043 Author: Khaled Hosny <khaledho...@eglug.org> Date: Thu Dec 29 21:39:30 2016 +0200 Use SAL_INFO Change-Id: Iac57a7e9afe476fc27eddaf123a3ca4a293a7034 diff --git a/vcl/unx/generic/fontmanager/helper.cxx b/vcl/unx/generic/fontmanager/helper.cxx index 2a130f4..d79c0bc 100644 --- a/vcl/unx/generic/fontmanager/helper.cxx +++ b/vcl/unx/generic/fontmanager/helper.cxx @@ -76,13 +76,8 @@ OUString const & getOfficePath( whichOfficePath ePath ) } // ensure user path exists aUPath += "/user/psprint"; - #if OSL_DEBUG_LEVEL > 1 - oslFileError eErr = - #endif + SAL_INFO("vcl.fonts", "Trying to create: " << aUPath); osl_createDirectoryPath( aUPath.pData, nullptr, nullptr ); - #if OSL_DEBUG_LEVEL > 1 - fprintf( stderr, "try to create \"%s\" = %d\n", OUStringToOString( aUPath, RTL_TEXTENCODING_UTF8 ).getStr(), eErr ); - #endif } switch( ePath ) @@ -228,9 +223,7 @@ OUString const & psp::getFontPath() } aPath = aPathBuffer.makeStringAndClear(); -#if OSL_DEBUG_LEVEL > 1 - fprintf( stderr, "initializing font path to \"%s\"\n", OUStringToOString( aPath, RTL_TEXTENCODING_ISO_8859_1 ).getStr() ); -#endif + SAL_INFO("vcl.fonts", "Initializing font path to: " << aPath); } return aPath; } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits