diff options
author | Jan-Marek Glogowski <glogow@fbihome.de> | 2020-09-11 22:31:51 +0200 |
---|---|---|
committer | Jan-Marek Glogowski <glogow@fbihome.de> | 2020-09-15 06:42:56 +0200 |
commit | 2967e7a87986b59fe48119749525d4084ac6a568 (patch) | |
tree | 3c8f27ddc5278903639f5f7c09e1d028b6be0103 /vcl/win/gdi/salfont.cxx | |
parent | c7482bc2904401e7d975b5721ec861b8589253f9 (diff) |
Forward existing FontCharMap from PhysicalFontFace
Since removed code in the previous commit is primary used in
CreateFontSubset and GetGlyphWidths, you have a high chance, that
the CMAP was already used for displaying a font, so it's already
decoded and can be forwarded. Also the lookup should be faster in
general this way.
Change-Id: Icf4d8a1a84ff6ccdaccb7e870abe5df3837f9541
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102686
Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Tested-by: Jenkins
Diffstat (limited to 'vcl/win/gdi/salfont.cxx')
-rw-r--r-- | vcl/win/gdi/salfont.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/vcl/win/gdi/salfont.cxx b/vcl/win/gdi/salfont.cxx index f5f69f3eab33..bc7f83b8b6f2 100644 --- a/vcl/win/gdi/salfont.cxx +++ b/vcl/win/gdi/salfont.cxx @@ -1543,7 +1543,7 @@ public: ~ScopedTrueTypeFont(); - SFErrCodes open(void const * pBuffer, sal_uInt32 nLen, sal_uInt32 nFaceNum); + SFErrCodes open(void const * pBuffer, sal_uInt32 nLen, sal_uInt32 nFaceNum, const FontCharMapRef xCharMap = nullptr); TrueTypeFont * get() const { return m_pFont; } TrueTypeFont* operator->() { return m_pFont; } @@ -1561,10 +1561,10 @@ ScopedTrueTypeFont::~ScopedTrueTypeFont() } SFErrCodes ScopedTrueTypeFont::open(void const * pBuffer, sal_uInt32 nLen, - sal_uInt32 nFaceNum) + sal_uInt32 nFaceNum, const FontCharMapRef xCharMap) { OSL_ENSURE(m_pFont == nullptr, "already open"); - return OpenTTFontBuffer(pBuffer, nLen, nFaceNum, &m_pFont); + return OpenTTFontBuffer(pBuffer, nLen, nFaceNum, &m_pFont, xCharMap); } bool WinSalGraphics::CreateFontSubset( const OUString& rToFile, @@ -1629,7 +1629,7 @@ bool WinSalGraphics::CreateFontSubset( const OUString& rToFile, nFaceNum = ~0U; // indicate "TTC font extracts only" ScopedTrueTypeFont aSftTTF; - SFErrCodes nRC = aSftTTF.open( xRawFontData.get(), xRawFontData.size(), nFaceNum ); + SFErrCodes nRC = aSftTTF.open( xRawFontData.get(), xRawFontData.size(), nFaceNum, pFont->GetFontCharMap()); if( nRC != SFErrCodes::Ok ) return false; @@ -1745,7 +1745,7 @@ void WinSalGraphics::GetGlyphWidths( const PhysicalFontFace* pFont, nFaceNum = ~0U; // indicate "TTC font extracts only" ScopedTrueTypeFont aSftTTF; - SFErrCodes nRC = aSftTTF.open( xRawFontData.get(), xRawFontData.size(), nFaceNum ); + SFErrCodes nRC = aSftTTF.open(xRawFontData.get(), xRawFontData.size(), nFaceNum, pFont->GetFontCharMap()); if( nRC != SFErrCodes::Ok ) return; |