diff options
-rw-r--r-- | vcl/qt5/Qt5Graphics_GDI.cxx | 26 | ||||
-rw-r--r-- | vcl/qt5/Qt5Graphics_Text.cxx | 24 | ||||
-rw-r--r-- | vcl/qt5/Qt5Instance.cxx | 2 |
3 files changed, 49 insertions, 3 deletions
diff --git a/vcl/qt5/Qt5Graphics_GDI.cxx b/vcl/qt5/Qt5Graphics_GDI.cxx index a9f9175e6d48..c45b678d88a5 100644 --- a/vcl/qt5/Qt5Graphics_GDI.cxx +++ b/vcl/qt5/Qt5Graphics_GDI.cxx @@ -248,9 +248,31 @@ void Qt5Graphics::drawPolygon(sal_uInt32 nPoints, const SalPoint* pPtAry) aPainter.update(aPolygon.boundingRect()); } -void Qt5Graphics::drawPolyPolygon(sal_uInt32 /*nPoly*/, const sal_uInt32* /*pPoints*/, - PCONSTSALPOINT* /*pPtAry*/) +void Qt5Graphics::drawPolyPolygon(sal_uInt32 nPolyCount, const sal_uInt32* pPoints, + PCONSTSALPOINT* ppPtAry) { + // ignore invisible polygons + if (SALCOLOR_NONE == m_aFillColor && SALCOLOR_NONE == m_aLineColor) + return; + + QPainterPath aPath; + for (sal_uInt32 nPoly = 0; nPoly < nPolyCount; nPoly++) + { + const sal_uInt32 nPoints = pPoints[nPoly]; + if (nPoints > 1) + { + const SalPoint* pPtAry = ppPtAry[nPoly]; + aPath.moveTo(pPtAry->mnX, pPtAry->mnY); + pPtAry++; + for (sal_uInt32 nPoint = 1; nPoint < nPoints; nPoint++, pPtAry++) + aPath.lineTo(pPtAry->mnX, pPtAry->mnY); + aPath.closeSubpath(); + } + } + + Qt5Painter aPainter(*this, true); + aPainter.drawPath(aPath); + aPainter.update(aPath.boundingRect()); } bool Qt5Graphics::drawPolyPolygon(const basegfx::B2DPolyPolygon& rPolyPoly, double fTransparency) diff --git a/vcl/qt5/Qt5Graphics_Text.cxx b/vcl/qt5/Qt5Graphics_Text.cxx index 282432214589..92e9a416d74a 100644 --- a/vcl/qt5/Qt5Graphics_Text.cxx +++ b/vcl/qt5/Qt5Graphics_Text.cxx @@ -23,6 +23,8 @@ #include <Qt5Painter.hxx> #include <vcl/fontcharmap.hxx> +#include <unx/geninst.h> +#include <unx/fontmanager.hxx> #include <sallayout.hxx> #include <PhysicalFontCollection.hxx> @@ -89,11 +91,33 @@ bool Qt5Graphics::GetFontCapabilities(vcl::FontCapabilities& rFontCapabilities) void Qt5Graphics::GetDevFontList(PhysicalFontCollection* pPFC) { + static const bool bUseFontconfig = (nullptr == getenv("SAL_VCL_QT5_NO_FONTCONFIG")); + m_pFontCollection = pPFC; if (pPFC->Count()) return; QFontDatabase aFDB; + + if (bUseFontconfig) + { + ::std::vector<psp::fontID> aList; + psp::FastPrintFontInfo aInfo; + + psp::PrintFontManager& rMgr = psp::PrintFontManager::get(); + rMgr.getFontList(aList); + for (auto const& elem : aList) + { + if (!rMgr.getFontFastInfo(elem, aInfo)) + continue; + QString aFilename = toQString( + OStringToOUString(rMgr.getFontFileSysPath(aInfo.m_nID), RTL_TEXTENCODING_UTF8)); + aFDB.addApplicationFont(aFilename); + } + + SalGenericInstance::RegisterFontSubstitutors(pPFC); + } + for (auto& family : aFDB.families()) for (auto& style : aFDB.styles(family)) { diff --git a/vcl/qt5/Qt5Instance.cxx b/vcl/qt5/Qt5Instance.cxx index 40c737446c65..6ea2610e03f7 100644 --- a/vcl/qt5/Qt5Instance.cxx +++ b/vcl/qt5/Qt5Instance.cxx @@ -283,7 +283,7 @@ VCLPLUG_QT5_PUBLIC SalInstance* create_SalInstance() QApplication::setQuitOnLastWindowClosed(false); - const bool bUseCairo = (nullptr != getenv("SAL_VCL_QT5_USE_CAIRO")); + static const bool bUseCairo = (nullptr != getenv("SAL_VCL_QT5_USE_CAIRO")); Qt5Instance* pInstance = new Qt5Instance(new SalYieldMutex(), bUseCairo); // initialize SalData |