diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2020-01-13 03:32:31 +0300 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2020-01-14 13:29:59 +0100 |
commit | 25f4cc12fb59284392914c93a0ae6ad199ecc069 (patch) | |
tree | 68271ae91888a2d044fc96029c74daedb5fbcdc6 /vcl/unx | |
parent | 4e0a6e43f48ef2d39433bdd8af3b6fd1906e2940 (diff) |
tdf#128226: make OpenSymbol font an internal resource
OpenSymbol is crucial for Math; so it is not just some font that
could be used if present, but part of program resources. As such,
it must be available with other program resources, and not depend
on user preferences, like uninstallation of the font from system.
This patch puts it into program/resource/common/fonts, and adds
that path to the paths used for private fonts. This is in addition
to share/fonts/truetype, which is optional, and is usually absent
on most Linux and Windows installations (on Linux, it is usually
in a separate package installing it to system fonts; on Windows,
it is also installed to system by MSI).
Change-Id: Ibf5e12e70dacb62b965035645fc53e9d83cd8793
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86649
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Reviewed-by: Rene Engelhard <rene@debian.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Tested-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'vcl/unx')
-rw-r--r-- | vcl/unx/generic/fontmanager/helper.cxx | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/vcl/unx/generic/fontmanager/helper.cxx b/vcl/unx/generic/fontmanager/helper.cxx index c586dcce7d7f..c28753e33b35 100644 --- a/vcl/unx/generic/fontmanager/helper.cxx +++ b/vcl/unx/generic/fontmanager/helper.cxx @@ -182,21 +182,25 @@ OUString const & psp::getFontPath() OUString aConfigPath( getOfficePath( whichOfficePath::ConfigPath ) ); OUString aInstallationRootPath( getOfficePath( whichOfficePath::InstallationRootPath ) ); OUString aUserPath( getOfficePath( whichOfficePath::UserPath ) ); + if (!aInstallationRootPath.isEmpty()) + { + // internal font resources, required for normal operation, like OpenSymbol + aPathBuffer.append(aInstallationRootPath + + "/" LIBO_SHARE_RESOURCE_FOLDER "/common/fonts;"); + } if( !aConfigPath.isEmpty() ) { // #i53530# Path from CustomDataUrl will completely - // replace net and user paths if the path exists - aPathBuffer.append(aConfigPath); - aPathBuffer.append("/" LIBO_SHARE_FOLDER "/fonts"); + // replace net share and user paths if the path exists + OUString sPath = aConfigPath + "/" LIBO_SHARE_FOLDER "/fonts"; // check existence of config path struct stat aStat; - if( 0 != stat( OUStringToOString( aPathBuffer.makeStringAndClear(), osl_getThreadTextEncoding() ).getStr(), &aStat ) + if( 0 != stat( OUStringToOString( sPath, osl_getThreadTextEncoding() ).getStr(), &aStat ) || ! S_ISDIR( aStat.st_mode ) ) aConfigPath.clear(); else { - aPathBuffer.append(aConfigPath); - aPathBuffer.append("/" LIBO_SHARE_FOLDER "/fonts"); + aPathBuffer.append(sPath); } } if( aConfigPath.isEmpty() ) |