tdf#151273, tdf#151925: Don’t use QFont text layout by default
We were enabling QFont for qt5 VCL plugin by default, but it is buggy
and some distributions seem to enabled qt5 VCL plugin even if we don't
recommend it.
Since the QFont code is incomplete and no one is working on it, lets
make people’s life easier by making it always off by default.
This removed the SAL_VCL_QT5_USE_CAIRO envvar and replaces it with
SAL_VCL_QT_USE_QFONT that does the reverse. Also SAL_VCL_KF5_USE_QFONT
is dropped in favor of SAL_VCL_QT_USE_QFONT.
Change-Id: Id7471acd12fe277908f567140b63ae8d27b03033
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154222
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@libreoffice.org>
diff --git a/static/emscripten/environment.js b/static/emscripten/environment.js
index bc60fdd..7d04fd7 100644
--- a/static/emscripten/environment.js
+++ b/static/emscripten/environment.js
@@ -1,5 +1,4 @@
if (!('preRun' in Module)) Module['preRun'] = [];
Module.preRun.push(function() {
ENV.SAL_LOG = "+WARN"
ENV.SAL_VCL_QT5_USE_CAIRO = "1"
});
diff --git a/vcl/README.vars.md b/vcl/README.vars.md
index a2ede5a..0fa1a95 100644
--- a/vcl/README.vars.md
+++ b/vcl/README.vars.md
@@ -63,11 +63,7 @@ will be used to write the log under `instdir/uitest/`.
* `QT_SCALE_FACTOR=2` - for HiDPI testing (also supports float)
* `SAL_VCL_QT5_NO_FONTCONFIG` - ignore fontconfig provided font substitutions
* `SAL_VCL_QT5_NO_NATIVE` - disable `QStyle`'d controls
* `SAL_VCL_QT5_USE_CAIRO` - use cairo for text rendering and fonts (default for kf5, but not qt5)
## Kf5
* `SAL_VCL_KF5_USE_QFONT` - use `QFont` for text rendering (default for qt5, but not kf5)
* `SAL_VCL_QT_USE_QFONT` - use `QFont` for text layout and rendering (default is to use cairo)
## Mac
diff --git a/vcl/qt5/QtInstance.cxx b/vcl/qt5/QtInstance.cxx
index 9c4d3de..df3df5d 100644
--- a/vcl/qt5/QtInstance.cxx
+++ b/vcl/qt5/QtInstance.cxx
@@ -751,7 +751,7 @@ void QtInstance::setActivePopup(QtFrame* pFrame)
extern "C" {
VCLPLUG_QT_PUBLIC SalInstance* create_SalInstance()
{
static const bool bUseCairo = (nullptr != getenv("SAL_VCL_QT5_USE_CAIRO"));
static const bool bUseCairo = (nullptr == getenv("SAL_VCL_QT_USE_QFONT"));
std::unique_ptr<char* []> pFakeArgv;
std::unique_ptr<int> pFakeArgc;
diff --git a/vcl/unx/kf5/KFSalInstance.cxx b/vcl/unx/kf5/KFSalInstance.cxx
index bec23cc..b52faf4 100644
--- a/vcl/unx/kf5/KFSalInstance.cxx
+++ b/vcl/unx/kf5/KFSalInstance.cxx
@@ -73,7 +73,7 @@ KFSalInstance::createPicker(css::uno::Reference<css::uno::XComponentContext> con
extern "C" {
VCLPLUG_KF_PUBLIC SalInstance* create_SalInstance()
{
static const bool bUseCairo = (nullptr == getenv("SAL_VCL_KF5_USE_QFONT"));
static const bool bUseCairo = (nullptr == getenv("SAL_VCL_QT_USE_QFONT"));
std::unique_ptr<char* []> pFakeArgv;
std::unique_ptr<int> pFakeArgc;