diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2018-10-28 13:41:10 +0100 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2018-10-30 20:42:19 +0100 |
commit | 996d7f36ddcd6d518f4b44d132b3c5e3300f0c24 (patch) | |
tree | 5fb211f185c06dac6c2ff620b4c5982dca25dc86 /vcl/qt5 | |
parent | 0ea92ad5332ddb6583c82275071c3be3939ebf28 (diff) |
Move SalGraphics glyph functions into FontInstance
As we already rely on the GlyphItem's font instance, consequently
this removes the SalGraphics GlyphItem based functions. Also
unifies the glyph bound rect cache handling.
An interesting aspect is the rotated glyph bounding box handling
moved from CairoTextRender to FreetypeFont. It doesn't look like
an implementation detail for Cairo, so it may have been a bug.
Change-Id: I81bbb5d8ee98fb77a1eee05568c456f9e4553023
Reviewed-on: https://gerrit.libreoffice.org/62503
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'vcl/qt5')
-rw-r--r-- | vcl/qt5/Qt5Font.cxx | 9 | ||||
-rw-r--r-- | vcl/qt5/Qt5Graphics_Text.cxx | 13 |
2 files changed, 9 insertions, 13 deletions
diff --git a/vcl/qt5/Qt5Font.cxx b/vcl/qt5/Qt5Font.cxx index 04516dffa367..be00f7a9ec5f 100644 --- a/vcl/qt5/Qt5Font.cxx +++ b/vcl/qt5/Qt5Font.cxx @@ -101,4 +101,13 @@ hb_font_t* Qt5Font::ImplInitHbFont() return InitHbFont(hb_face_create_for_tables(getFontTable, this, nullptr)); } +bool Qt5Font::GetGlyphOutline(sal_GlyphId, basegfx::B2DPolyPolygon&, bool) const { return false; } + +bool Qt5Font::ImplGetGlyphBoundRect(sal_GlyphId nId, tools::Rectangle& rRect, bool) const +{ + QRawFont aRawFont(QRawFont::fromFont(*this)); + rRect = toRectangle(aRawFont.boundingRect(nId).toAlignedRect()); + return true; +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/qt5/Qt5Graphics_Text.cxx b/vcl/qt5/Qt5Graphics_Text.cxx index 79b5c8fe1f8e..ba7133f7b53e 100644 --- a/vcl/qt5/Qt5Graphics_Text.cxx +++ b/vcl/qt5/Qt5Graphics_Text.cxx @@ -152,19 +152,6 @@ void Qt5Graphics::GetGlyphWidths(const PhysicalFontFace* /*pPFF*/, bool /*bVerti { } -bool Qt5Graphics::GetGlyphBoundRect(const GlyphItem& rGlyph, tools::Rectangle& rRect) -{ - Qt5Font* pFont = static_cast<Qt5Font*>(rGlyph.m_pFontInstance); - if (!pFont) - return false; - - QRawFont aRawFont(QRawFont::fromFont(*pFont)); - rRect = toRectangle(aRawFont.boundingRect(rGlyph.m_aGlyphId).toAlignedRect()); - return true; -} - -bool Qt5Graphics::GetGlyphOutline(const GlyphItem&, basegfx::B2DPolyPolygon&) { return false; } - class Qt5CommonSalLayout : public GenericSalLayout { public: |