summaryrefslogtreecommitdiff
path: root/vcl/inc/qt5/Qt5Font.hxx
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2017-12-26 15:58:21 +0100
committerKhaled Hosny <khaledhosny@eglug.org>2018-05-07 23:03:37 +0200
commit083b7ca26bbf4b9bad2922520caaf5c0227dac5e (patch)
treeb33576cd90c64cb2ede5ab1a930b11828f110105 /vcl/inc/qt5/Qt5Font.hxx
parent1ca1886d46f38a0759ab466e6a4a8c3c0866c523 (diff)
Move PhysicalFontFace member of FontSelectPattern
A FontSelectPattern describes a general font request. It can be used to find the best matching LogicalFontInstance. The instance will be created based on a PhysicalFontFace, which is really a factory since commit 8b700794b2746070814e9ff416ecd7bbb1c902e7. Following this workflow, this moves the PhysicalFontFace pointer to the instance and makes it constant. Which leaves some special symbol font handling code in the hash and instance lookup code path. It used to query the font face directly from the instance. I'm not sure of the correct handling. The related commits where made to fix #i89002#, which has an attached test document. 1. commit 849f618270da313f9339dda29a9f35938434c91d 2. commit 8c9823d311fdf8092cc75873e4565325d204a658 The document is as broken as it was before the patch. The symbol substitution still works, but the 'Q's are missing when displaying a symbol font. I also don't understand all the reinterpret_casts for fake font ids. I guess this was used to prevent the crashes I see, where a PhysicalFontFace referenced in a valid LogicalFontInstance is freed and a later FontId check in the GlyphCache crashes. So this now checks for a valid cache instead. Change-Id: If8ee5a6288e66cfa4c419289fbdd5b5da128c6ea Reviewed-on: https://gerrit.libreoffice.org/47279 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
Diffstat (limited to 'vcl/inc/qt5/Qt5Font.hxx')
-rw-r--r--vcl/inc/qt5/Qt5Font.hxx12
1 files changed, 5 insertions, 7 deletions
diff --git a/vcl/inc/qt5/Qt5Font.hxx b/vcl/inc/qt5/Qt5Font.hxx
index 789c925a104c..1a1940fa7df0 100644
--- a/vcl/inc/qt5/Qt5Font.hxx
+++ b/vcl/inc/qt5/Qt5Font.hxx
@@ -22,25 +22,23 @@
#include <vcl/dllapi.h>
#include <QtGui/QFont>
-#include <fontselect.hxx>
+#include <fontinstance.hxx>
#include <hb-ot.h>
-class VCL_DLLPUBLIC Qt5Font : public QFont
+class VCL_DLLPUBLIC Qt5Font : public QFont, public LogicalFontInstance
{
- const FontSelectPattern m_aFontSelData;
hb_font_t* m_pHbFont;
public:
- Qt5Font(const FontSelectPattern& rFSP)
- : m_aFontSelData(rFSP)
+ Qt5Font(const PhysicalFontFace& rPFF, const FontSelectPattern& rFSP)
+ : LogicalFontInstance(rPFF, rFSP)
, m_pHbFont(nullptr)
{
}
- virtual ~Qt5Font();
+ virtual ~Qt5Font() override;
hb_font_t* GetHbFont() const { return m_pHbFont; }
void SetHbFont(hb_font_t* pHbFont) { m_pHbFont = pHbFont; }
- const FontSelectPattern& GetFontSelData() const { return m_aFontSelData; }
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */