summaryrefslogtreecommitdiff
path: root/vcl/inc
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2020-03-02 10:04:24 +0100
committerMichael Weghorn <m.weghorn@posteo.de>2020-03-04 07:40:37 +0100
commit1000169ebca79478a05b4c23e760d99bd77e739e (patch)
treec6f41d0c3512771464defdc78fa97dee20434079 /vcl/inc
parentc98cd883be11ff931ae903469f56cfd5b5f4fd66 (diff)
Qt5 unify font attribute conversions
Adds conversion functions for VCLs FontWeight, FontWidth and FontItalic to Qt5FontFace and remove the partial "switch" tables from KF5SalFrame. And correctly handle the FontWidth in Qt5Font as the stretch value, so the default font in qt5 gets the correct stretch and doesn't look bold. Also contains commit b9a124aae67cbd64917f07f2dca6603f149c018b ("Qt5 just ignore invalid font attributes"). This ignores the *_DONTKNOW and _FORCE_EQUAL_SIZE values, except for the stretch, where we map DONTKNOW to QFont::AnyStretch. Change-Id: I698986416dff13e6dfaf9dfa7f95851b89e9137d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89813 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de> (cherry picked from commit 63ea1e811a3b3806b6b2408d759a449f4e086eb3) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89797 Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'vcl/inc')
-rw-r--r--vcl/inc/qt5/Qt5FontFace.hxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/vcl/inc/qt5/Qt5FontFace.hxx b/vcl/inc/qt5/Qt5FontFace.hxx
index c427a85445c3..ada4bbb5c1eb 100644
--- a/vcl/inc/qt5/Qt5FontFace.hxx
+++ b/vcl/inc/qt5/Qt5FontFace.hxx
@@ -19,6 +19,7 @@
#pragma once
+#include <vclpluginapi.h>
#include <PhysicalFontFace.hxx>
#include <tools/ref.hxx>
@@ -26,10 +27,10 @@
#include <vcl/fontcharmap.hxx>
#include <QtCore/QString>
+#include <QtGui/QFont>
class FontAttributes;
class FontSelectPattern;
-class QFont;
class Qt5FontFace : public PhysicalFontFace
{
@@ -38,6 +39,10 @@ public:
static Qt5FontFace* fromQFontDatabase(const QString& aFamily, const QString& aStyle);
static void fillAttributesFromQFont(const QFont& rFont, FontAttributes& rFA);
+ VCLPLUG_QT5_PUBLIC static FontWeight toFontWeight(const int nWeight);
+ VCLPLUG_QT5_PUBLIC static FontWidth toFontWidth(const int nStretch);
+ VCLPLUG_QT5_PUBLIC static FontItalic toFontItalic(const QFont::Style eStyle);
+
sal_IntPtr GetFontId() const override;
int GetFontTable(const char pTagName[5], unsigned char*) const;