summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2020-09-11 22:34:11 +0200
committerJan-Marek Glogowski <glogow@fbihome.de>2020-09-15 06:43:15 +0200
commit5ebc5f9df6972ac3d9ce7ed6a1504c48535c0881 (patch)
tree2ba3465762d98c9d3105da21264185870127896c /vcl
parent2967e7a87986b59fe48119749525d4084ac6a568 (diff)
Qt5 implement GetGlyphWidths
Basically implement it the same way then Windows and MacOS. Change-Id: I643581af49aeb9274505e90e12acbe5bcf0c98fb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102687 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/qt5/Qt5Graphics_Text.cxx8
1 files changed, 6 insertions, 2 deletions
diff --git a/vcl/qt5/Qt5Graphics_Text.cxx b/vcl/qt5/Qt5Graphics_Text.cxx
index 0b823858a9bb..351bb3023213 100644
--- a/vcl/qt5/Qt5Graphics_Text.cxx
+++ b/vcl/qt5/Qt5Graphics_Text.cxx
@@ -309,9 +309,13 @@ const void* Qt5Graphics::GetEmbedFontData(const PhysicalFontFace*, long* /*pData
void Qt5Graphics::FreeEmbedFontData(const void* /*pData*/, long /*nDataLen*/) {}
-void Qt5Graphics::GetGlyphWidths(const PhysicalFontFace* /*pPFF*/, bool /*bVertical*/,
- std::vector<sal_Int32>& /*rWidths*/, Ucs2UIntMap& /*rUnicodeEnc*/)
+void Qt5Graphics::GetGlyphWidths(const PhysicalFontFace* pFontFace, bool bVertical,
+ std::vector<sal_Int32>& rWidths, Ucs2UIntMap& rUnicodeEnc)
{
+ const Qt5FontFace* pQt5FontFace = static_cast<const Qt5FontFace*>(pFontFace);
+ const QRawFont aRawFont(QRawFont::fromFont(pQt5FontFace->CreateFont()));
+ Qt5TrueTypeFont aTTF(*pQt5FontFace, aRawFont);
+ SalGraphics::GetGlyphWidths(aTTF, *pFontFace, bVertical, rWidths, rUnicodeEnc);
}
namespace