vcl/headless/svptext.cxx | 3 +-- vcl/inc/fontsubset.hxx | 8 ++++---- vcl/inc/headless/svpgdi.hxx | 1 - vcl/inc/qt5/QtGraphics.hxx | 2 +- vcl/inc/quartz/salgdi.h | 1 - vcl/inc/salgdi.hxx | 7 +++---- vcl/inc/textrender.hxx | 1 - vcl/inc/unx/fontmanager.hxx | 1 - vcl/inc/unx/freetypetextrender.hxx | 1 - vcl/inc/unx/genpspgraphics.h | 1 - vcl/inc/unx/salgdi.h | 1 - vcl/inc/win/salgdi.h | 1 - vcl/qt5/QtGraphics_Text.cxx | 7 +++---- vcl/quartz/salgdicommon.cxx | 8 ++++---- vcl/source/fontsubset/cff.cxx | 14 ++++---------- vcl/source/fontsubset/fontsubset.cxx | 15 +++++++-------- vcl/source/gdi/pdfwriter_impl.cxx | 4 ++-- vcl/source/gdi/salgdilayout.cxx | 23 ++++------------------- vcl/unx/generic/fontmanager/fontmanager.cxx | 23 +---------------------- vcl/unx/generic/gdi/font.cxx | 3 +-- vcl/unx/generic/gdi/freetypetextrender.cxx | 2 -- vcl/unx/generic/print/genpspgraphics.cxx | 2 -- vcl/win/gdi/salfont.cxx | 8 ++++---- 23 files changed, 39 insertions(+), 98 deletions(-)
New commits: commit 394655636307de3ba3c4b2d52f3c1abf4b900e18 Author: Khaled Hosny <kha...@aliftype.com> AuthorDate: Mon Sep 5 22:36:20 2022 +0200 Commit: خالد حسني <kha...@aliftype.com> CommitDate: Tue Sep 6 15:09:57 2022 +0200 vcl: Drop unused SalGraphics::CreateFontSubset() argument pWidths is always nullptr. Change-Id: I1c666f146865786269e9513cbb6c8ffdc7df96e7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139461 Tested-by: Jenkins Reviewed-by: خالد حسني <kha...@aliftype.com> diff --git a/vcl/headless/svptext.cxx b/vcl/headless/svptext.cxx index 269061ea831d..26d0d3966f4e 100644 --- a/vcl/headless/svptext.cxx +++ b/vcl/headless/svptext.cxx @@ -67,11 +67,10 @@ bool SvpSalGraphics::CreateFontSubset( const vcl::font::PhysicalFontFace* pFont, const sal_GlyphId* pGlyphIds, const sal_uInt8* pEncoding, - sal_Int32* pWidths, int nGlyphCount, FontSubsetInfo& rInfo) { - return m_aTextRenderImpl.CreateFontSubset(rToFile, pFont, pGlyphIds, pEncoding, pWidths, nGlyphCount, rInfo); + return m_aTextRenderImpl.CreateFontSubset(rToFile, pFont, pGlyphIds, pEncoding, nGlyphCount, rInfo); } const void* SvpSalGraphics::GetEmbedFontData(const vcl::font::PhysicalFontFace* pFont, tools::Long* pDataLen) diff --git a/vcl/inc/fontsubset.hxx b/vcl/inc/fontsubset.hxx index 2aed0a393e82..fef6603cd2fd 100644 --- a/vcl/inc/fontsubset.hxx +++ b/vcl/inc/fontsubset.hxx @@ -59,7 +59,7 @@ public: bool CreateFontSubset( FontType nOutFontTypeMask, FILE* pOutFile, const char* pOutFontName, const sal_GlyphId* pGlyphIds, const sal_uInt8* pEncodedIds, - int nReqGlyphCount, sal_Int32* pOutGlyphWidths = nullptr ); + int nReqGlyphCount); public: // TODO: make subsetter results private and provide accessor methods instead // subsetter-provided subset details needed by e.g. Postscript or PDF @@ -85,9 +85,9 @@ private: const sal_uInt8* mpReqEncodedIds; int mnReqGlyphCount; - bool CreateFontSubsetFromCff( sal_Int32* pOutGlyphWidths ); - bool CreateFontSubsetFromSfnt( sal_Int32* pOutGlyphWidths ); - static bool CreateFontSubsetFromType1( const sal_Int32* pOutGlyphWidths ); + bool CreateFontSubsetFromCff(); + bool CreateFontSubsetFromSfnt(); + static bool CreateFontSubsetFromType1(); }; int VCL_DLLPUBLIC TestFontSubset(const void* data, sal_uInt32 size); diff --git a/vcl/inc/headless/svpgdi.hxx b/vcl/inc/headless/svpgdi.hxx index 83db19878f4d..441ccf201861 100644 --- a/vcl/inc/headless/svpgdi.hxx +++ b/vcl/inc/headless/svpgdi.hxx @@ -81,7 +81,6 @@ public: const vcl::font::PhysicalFontFace*, const sal_GlyphId* pGlyphIds, const sal_uInt8* pEncoding, - sal_Int32* pWidths, int nGlyphs, FontSubsetInfo& rInfo ) override; diff --git a/vcl/inc/qt5/QtGraphics.hxx b/vcl/inc/qt5/QtGraphics.hxx index d7b25a9a150a..e8f5fdd9a58e 100644 --- a/vcl/inc/qt5/QtGraphics.hxx +++ b/vcl/inc/qt5/QtGraphics.hxx @@ -233,7 +233,7 @@ public: const OUString& rFontName) override; virtual bool CreateFontSubset(const OUString& rToFile, const vcl::font::PhysicalFontFace* pFont, const sal_GlyphId* pGlyphIds, const sal_uInt8* pEncoding, - sal_Int32* pWidths, int nGlyphs, + int nGlyphs, FontSubsetInfo& rInfo // out parameter ) override; diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h index e2bd63306158..c809e9d39670 100644 --- a/vcl/inc/quartz/salgdi.h +++ b/vcl/inc/quartz/salgdi.h @@ -552,7 +552,6 @@ public: const vcl::font::PhysicalFontFace* pFont, const sal_GlyphId* pGlyphIds, const sal_uInt8* pEncoding, - sal_Int32* pWidths, int nGlyphs, FontSubsetInfo& rInfo // out parameter ) override; diff --git a/vcl/inc/salgdi.hxx b/vcl/inc/salgdi.hxx index 4b2304ac8efd..cad89819efa8 100644 --- a/vcl/inc/salgdi.hxx +++ b/vcl/inc/salgdi.hxx @@ -178,7 +178,6 @@ public: const vcl::font::PhysicalFontFace* pFont, const sal_GlyphId* pGlyphIDs, const sal_uInt8* pEncoding, - sal_Int32* pWidths, int nGlyphs, FontSubsetInfo& rInfo ) = 0; @@ -653,13 +652,13 @@ protected: vcl::WidgetDrawInterface* forWidget() { return m_pWidgetDraw ? m_pWidgetDraw.get() : this; } static bool CreateTTFfontSubset(vcl::AbstractTrueTypeFont& aTTF, const OString& rSysPath, - const bool bVertical, const sal_GlyphId* pGlyphIds, - const sal_uInt8* pEncoding, sal_Int32* pGlyphWidths, + const sal_GlyphId* pGlyphIds, + const sal_uInt8* pEncoding, int nGlyphCount); static bool CreateCFFfontSubset(const unsigned char* pFontBytes, int nByteLength, const OString& rSysPath, const sal_GlyphId* pGlyphIds, - const sal_uInt8* pEncoding, sal_Int32* pGlyphWidths, + const sal_uInt8* pEncoding, int nGlyphCount, FontSubsetInfo& rInfo); static void FillFontSubsetInfo(const vcl::TTGlobalFontInfo& rTTInfo, const OUString& pPSName, diff --git a/vcl/inc/textrender.hxx b/vcl/inc/textrender.hxx index 5d27b4e86238..cb6594c8a6f7 100644 --- a/vcl/inc/textrender.hxx +++ b/vcl/inc/textrender.hxx @@ -47,7 +47,6 @@ public: const vcl::font::PhysicalFontFace*, const sal_GlyphId* pGlyphIDs, const sal_uInt8* pEncoding, - sal_Int32* pWidths, int nGlyphs, FontSubsetInfo& rInfo) = 0; diff --git a/vcl/inc/unx/fontmanager.hxx b/vcl/inc/unx/fontmanager.hxx index cea59cda9d0c..f9b1930175da 100644 --- a/vcl/inc/unx/fontmanager.hxx +++ b/vcl/inc/unx/fontmanager.hxx @@ -282,7 +282,6 @@ public: const OUString& rOutFile, const sal_GlyphId* pGlyphIDs, const sal_uInt8* pNewEncoding, - sal_Int32* pWidths, int nGlyphs ); diff --git a/vcl/inc/unx/freetypetextrender.hxx b/vcl/inc/unx/freetypetextrender.hxx index e154585e7dd4..0c7323885a60 100644 --- a/vcl/inc/unx/freetypetextrender.hxx +++ b/vcl/inc/unx/freetypetextrender.hxx @@ -52,7 +52,6 @@ public: const vcl::font::PhysicalFontFace*, const sal_GlyphId* pGlyphIDs, const sal_uInt8* pEncoding, - sal_Int32* pWidths, int nGlyphs, FontSubsetInfo& rInfo) override; diff --git a/vcl/inc/unx/genpspgraphics.h b/vcl/inc/unx/genpspgraphics.h index 252573a02ae4..da1df08b8895 100644 --- a/vcl/inc/unx/genpspgraphics.h +++ b/vcl/inc/unx/genpspgraphics.h @@ -94,7 +94,6 @@ public: const vcl::font::PhysicalFontFace*, const sal_GlyphId* pGlyphIDs, const sal_uInt8* pEncoding, - sal_Int32* pWidths, int nGlyphs, FontSubsetInfo& rInfo ) override; virtual const void* GetEmbedFontData(const vcl::font::PhysicalFontFace*, tools::Long* pDataLen) override; diff --git a/vcl/inc/unx/salgdi.h b/vcl/inc/unx/salgdi.h index cb8d551c6ead..0b217a784131 100644 --- a/vcl/inc/unx/salgdi.h +++ b/vcl/inc/unx/salgdi.h @@ -127,7 +127,6 @@ public: const vcl::font::PhysicalFontFace*, const sal_GlyphId* pGlyphIDs, const sal_uInt8* pEncoding, - sal_Int32* pWidths, int nGlyphs, FontSubsetInfo& rInfo ) override; diff --git a/vcl/inc/win/salgdi.h b/vcl/inc/win/salgdi.h index 605f07ad9ec8..5b60e6e9ebff 100644 --- a/vcl/inc/win/salgdi.h +++ b/vcl/inc/win/salgdi.h @@ -364,7 +364,6 @@ public: const vcl::font::PhysicalFontFace*, const sal_GlyphId* pGlyphIDs, const sal_uInt8* pEncoding, - sal_Int32* pWidths, int nGlyphs, FontSubsetInfo& rInfo // out parameter ) override; diff --git a/vcl/qt5/QtGraphics_Text.cxx b/vcl/qt5/QtGraphics_Text.cxx index 2ee3d9a71569..c8c59bc48cc3 100644 --- a/vcl/qt5/QtGraphics_Text.cxx +++ b/vcl/qt5/QtGraphics_Text.cxx @@ -226,7 +226,7 @@ const sal_uInt8* QtTrueTypeFont::table(sal_uInt32 ord, sal_uInt32& size) const bool QtGraphics::CreateFontSubset(const OUString& rToFile, const vcl::font::PhysicalFontFace* pFontFace, const sal_GlyphId* pGlyphIds, const sal_uInt8* pEncoding, - sal_Int32* pGlyphWidths, int nGlyphCount, FontSubsetInfo& rInfo) + int nGlyphCount, FontSubsetInfo& rInfo) { OUString aSysPath; if (osl_File_E_None != osl_getSystemPathFromFileURL(rToFile.pData, &aSysPath.pData)) @@ -243,7 +243,7 @@ bool QtGraphics::CreateFontSubset(const OUString& rToFile, if (!aCFFtable.isEmpty()) return SalGraphics::CreateCFFfontSubset( reinterpret_cast<const sal_uInt8*>(aCFFtable.data()), aCFFtable.size(), aToFile, - pGlyphIds, pEncoding, pGlyphWidths, nGlyphCount, rInfo); + pGlyphIds, pEncoding, nGlyphCount, rInfo); // fill details about the subsetted font rInfo.m_nFontType = FontType::SFNT_TTF; @@ -258,8 +258,7 @@ bool QtGraphics::CreateFontSubset(const OUString& rToFile, if (GetTTGlobalFontHeadInfo(&aTTF, nXmin, nYmin, nXmax, nYmax, nMacStyleFlags)) rInfo.m_aFontBBox = tools::Rectangle(Point(nXmin, nYmin), Point(nXmax, nYmax)); - return SalGraphics::CreateTTFfontSubset(aTTF, aToFile, false /* use FontSelectPattern? */, - pGlyphIds, pEncoding, pGlyphWidths, nGlyphCount); + return SalGraphics::CreateTTFfontSubset(aTTF, aToFile, pGlyphIds, pEncoding, nGlyphCount); } const void* QtGraphics::GetEmbedFontData(const vcl::font::PhysicalFontFace*, diff --git a/vcl/quartz/salgdicommon.cxx b/vcl/quartz/salgdicommon.cxx index 197f4b38f6bf..992db536e7d5 100644 --- a/vcl/quartz/salgdicommon.cxx +++ b/vcl/quartz/salgdicommon.cxx @@ -49,7 +49,7 @@ using namespace vcl; bool AquaSalGraphics::CreateFontSubset( const OUString& rToFile, const vcl::font::PhysicalFontFace* pFontData, const sal_GlyphId* pGlyphIds, const sal_uInt8* pEncoding, - sal_Int32* pGlyphWidths, const int nGlyphCount, + const int nGlyphCount, FontSubsetInfo& rInfo ) { // TODO: move more of the functionality here into the generic subsetter code @@ -71,7 +71,7 @@ bool AquaSalGraphics::CreateFontSubset( const OUString& rToFile, // NOTE: assuming that all glyphids requested on Aqua are fully translated if (bCffOnly) return SalGraphics::CreateCFFfontSubset(aBuffer.data(), aBuffer.size(), aToFile, pGlyphIds, - pEncoding, pGlyphWidths, nGlyphCount, rInfo); + pEncoding, nGlyphCount, rInfo); // TODO: modernize psprint's horrible fontsubset C-API // this probably only makes sense after the switch to another SCM @@ -91,8 +91,8 @@ bool AquaSalGraphics::CreateFontSubset( const OUString& rToFile, // write subset into destination file bool bRet - = SalGraphics::CreateTTFfontSubset(*pSftFont, aToFile, false /* use FontSelectPattern? */, - pGlyphIds, pEncoding, pGlyphWidths, nGlyphCount); + = SalGraphics::CreateTTFfontSubset(*pSftFont, aToFile, + pGlyphIds, pEncoding, nGlyphCount); ::CloseTTFont(pSftFont); return bRet; } diff --git a/vcl/source/fontsubset/cff.cxx b/vcl/source/fontsubset/cff.cxx index 7d418ef2694c..379e239a5c76 100644 --- a/vcl/source/fontsubset/cff.cxx +++ b/vcl/source/fontsubset/cff.cxx @@ -274,7 +274,7 @@ public: bool initialCffRead(); void emitAsType1( class Type1Emitter&, const sal_GlyphId* pGlyphIds, const U8* pEncoding, - sal_Int32* pGlyphWidths, int nGlyphCount, FontSubsetInfo& ); + int nGlyphCount, FontSubsetInfo& ); private: int convert2Type1Ops( CffLocal*, const U8* pType2Ops, int nType2Len, U8* pType1Ops); @@ -1745,7 +1745,7 @@ void Type1Emitter::emitValVector( const char* pLineHead, const char* pLineTail, void CffSubsetterContext::emitAsType1( Type1Emitter& rEmitter, const sal_GlyphId* pReqGlyphIds, const U8* pReqEncoding, - sal_Int32* pGlyphWidths, int nGlyphCount, FontSubsetInfo& rFSInfo) + int nGlyphCount, FontSubsetInfo& rFSInfo) { // prepare some fontdirectory details static const int nUniqueIdBase = 4100000; // using private-interchange UniqueIds @@ -1982,12 +1982,6 @@ void CffSubsetterContext::emitAsType1( Type1Emitter& rEmitter, pOut += sprintf( pOut, " ND\n"); rEmitter.emitAllCrypted(); // provide individual glyphwidths if requested - if( pGlyphWidths ) { - ValType aCharWidth = maCharWidth; - if( maFontMatrix.size() >= 4) - aCharWidth *= 1000.0F * maFontMatrix[0]; - pGlyphWidths[i] = static_cast<sal_Int32>(aCharWidth); - } } pOut += sprintf( pOut, "end end\nreadonly put\nput\n"); pOut += sprintf( pOut, "dup/FontName get exch definefont pop\n"); @@ -2040,7 +2034,7 @@ void CffSubsetterContext::emitAsType1( Type1Emitter& rEmitter, rFSInfo.m_aPSName = OUString( rEmitter.maSubsetName, strlen(rEmitter.maSubsetName), RTL_TEXTENCODING_UTF8 ); } -bool FontSubsetInfo::CreateFontSubsetFromCff( sal_Int32* pOutGlyphWidths ) +bool FontSubsetInfo::CreateFontSubsetFromCff() { CffSubsetterContext aCff( mpInFontBytes, mnInByteLength); bool bRC = aCff.initialCffRead(); @@ -2054,7 +2048,7 @@ bool FontSubsetInfo::CreateFontSubsetFromCff( sal_Int32* pOutGlyphWidths ) aType1Emitter.setSubsetName( mpReqFontName); aCff.emitAsType1( aType1Emitter, mpReqGlyphIds, mpReqEncodedIds, - pOutGlyphWidths, mnReqGlyphCount, *this); + mnReqGlyphCount, *this); return true; } diff --git a/vcl/source/fontsubset/fontsubset.cxx b/vcl/source/fontsubset/fontsubset.cxx index bd663d8bc0d7..3b016a9b0dce 100644 --- a/vcl/source/fontsubset/fontsubset.cxx +++ b/vcl/source/fontsubset/fontsubset.cxx @@ -68,8 +68,7 @@ void FontSubsetInfo::LoadFont( vcl::TrueTypeFont* pSftTTFont ) bool FontSubsetInfo::CreateFontSubset( FontType nReqFontTypeMask, FILE* pOutFile, const char* pReqFontName, - const sal_GlyphId* pReqGlyphIds, const sal_uInt8* pReqEncodedIds, int nReqGlyphCount, - sal_Int32* pOutGlyphWidths) + const sal_GlyphId* pReqGlyphIds, const sal_uInt8* pReqEncodedIds, int nReqGlyphCount) { // prepare request details needed by all underlying subsetters mnReqFontTypeMask = nReqFontTypeMask; @@ -89,15 +88,15 @@ bool FontSubsetInfo::CreateFontSubset( case FontType::SFNT_TTF: case FontType::SFNT_CFF: case FontType::ANY_SFNT: - bOK = CreateFontSubsetFromSfnt( pOutGlyphWidths); + bOK = CreateFontSubsetFromSfnt(); break; case FontType::CFF_FONT: - bOK = CreateFontSubsetFromCff( pOutGlyphWidths); + bOK = CreateFontSubsetFromCff(); break; case FontType::TYPE1_PFA: case FontType::TYPE1_PFB: case FontType::ANY_TYPE1: - bOK = CreateFontSubsetFromType1( pOutGlyphWidths); + bOK = CreateFontSubsetFromType1(); break; case FontType::NO_FONT: default: @@ -109,7 +108,7 @@ bool FontSubsetInfo::CreateFontSubset( } // TODO: move function to sft.cxx to replace dummy implementation -bool FontSubsetInfo::CreateFontSubsetFromSfnt( sal_Int32* pOutGlyphWidths ) +bool FontSubsetInfo::CreateFontSubsetFromSfnt() { // handle SFNT_CFF fonts sal_uInt32 nCffLength = 0; @@ -117,7 +116,7 @@ bool FontSubsetInfo::CreateFontSubsetFromSfnt( sal_Int32* pOutGlyphWidths ) if (pCffBytes) { LoadFont( FontType::CFF_FONT, pCffBytes, nCffLength); - const bool bOK = CreateFontSubsetFromCff( pOutGlyphWidths); + const bool bOK = CreateFontSubsetFromCff(); return bOK; } @@ -153,7 +152,7 @@ bool FontSubsetInfo::CreateFontSubsetFromSfnt( sal_Int32* pOutGlyphWidths ) } // TODO: replace dummy implementation -bool FontSubsetInfo::CreateFontSubsetFromType1( const sal_Int32* /*pOutGlyphWidths*/) +bool FontSubsetInfo::CreateFontSubsetFromType1() { SAL_WARN("vcl.fonts", "CreateFontSubsetFromType1: replace dummy implementation."); diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 1e7869dfe1dc..8ba0f07e9c52 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -2346,7 +2346,7 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitSystemFont( const vcl::font: // We are interested only in filling aInfo sal_GlyphId aGlyphIds[256] = { 0 }; sal_uInt8 pEncoding[256] = { 0 }; - pGraphics->CreateFontSubset(aTmpName, pFont, aGlyphIds, pEncoding, nullptr, 256, aInfo); + pGraphics->CreateFontSubset(aTmpName, pFont, aGlyphIds, pEncoding, 256, aInfo); osl_removeFile( aTmpName.pData ); // write font descriptor @@ -2690,7 +2690,7 @@ bool PDFWriterImpl::emitFonts() } } FontSubsetInfo aSubsetInfo; - if( pGraphics->CreateFontSubset( aTmpName, subset.first, aGlyphIds, pEncoding, nullptr, nGlyphs, aSubsetInfo ) ) + if( pGraphics->CreateFontSubset( aTmpName, subset.first, aGlyphIds, pEncoding, nGlyphs, aSubsetInfo ) ) { // create font stream osl::File aFontFile(aTmpName); diff --git a/vcl/source/gdi/salgdilayout.cxx b/vcl/source/gdi/salgdilayout.cxx index 6267c5a705d7..5bb6e43c3420 100644 --- a/vcl/source/gdi/salgdilayout.cxx +++ b/vcl/source/gdi/salgdilayout.cxx @@ -929,8 +929,8 @@ OUString SalGraphics::getRenderBackendName() const } bool SalGraphics::CreateTTFfontSubset(vcl::AbstractTrueTypeFont& rTTF, const OString& rSysPath, - const bool bVertical, const sal_GlyphId* pGlyphIds, - const sal_uInt8* pEncoding, sal_Int32* pGlyphWidths, + const sal_GlyphId* pGlyphIds, + const sal_uInt8* pEncoding, const int nOrigGlyphCount) { // Multiple questions: @@ -982,21 +982,6 @@ bool SalGraphics::CreateTTFfontSubset(vcl::AbstractTrueTypeFont& rTTF, const OSt aTempEncs[0] = 0; } - if (pGlyphWidths) - { - std::unique_ptr<sal_uInt16[]> pMetrics - = GetTTSimpleGlyphMetrics(&rTTF, aShortIDs, nGlyphCount, bVertical); - if (!pMetrics) - return false; - - sal_uInt16 nNotDefAdv = pMetrics[0]; - pMetrics[0] = pMetrics[nNotDef]; - pMetrics[nNotDef] = nNotDefAdv; - for (i = 0; i < nOrigGlyphCount; ++i) - pGlyphWidths[i] = pMetrics[i]; - pMetrics.reset(); - } - // write subset into destination file return (CreateTTFromTTGlyphs(&rTTF, rSysPath.getStr(), aShortIDs, aTempEncs, nGlyphCount) == vcl::SFErrCodes::Ok); @@ -1004,7 +989,7 @@ bool SalGraphics::CreateTTFfontSubset(vcl::AbstractTrueTypeFont& rTTF, const OSt bool SalGraphics::CreateCFFfontSubset(const unsigned char* pFontBytes, int nByteLength, const OString& rSysPath, const sal_GlyphId* pGlyphIds, - const sal_uInt8* pEncoding, sal_Int32* pGlyphWidths, + const sal_uInt8* pEncoding, int nGlyphCount, FontSubsetInfo& rInfo) { FILE* pOutFile = fopen(rSysPath.getStr(), "wb"); @@ -1012,7 +997,7 @@ bool SalGraphics::CreateCFFfontSubset(const unsigned char* pFontBytes, int nByte return false; rInfo.LoadFont(FontType::CFF_FONT, pFontBytes, nByteLength); bool bRet = rInfo.CreateFontSubset(FontType::TYPE1_PFB, pOutFile, nullptr, pGlyphIds, pEncoding, - nGlyphCount, pGlyphWidths); + nGlyphCount); fclose(pOutFile); return bRet; } diff --git a/vcl/unx/generic/fontmanager/fontmanager.cxx b/vcl/unx/generic/fontmanager/fontmanager.cxx index 4ee863a3a401..e0131081481b 100644 --- a/vcl/unx/generic/fontmanager/fontmanager.cxx +++ b/vcl/unx/generic/fontmanager/fontmanager.cxx @@ -945,7 +945,6 @@ bool PrintFontManager::createFontSubset( const OUString& rOutFile, const sal_GlyphId* pGlyphIds, const sal_uInt8* pNewEncoding, - sal_Int32* pWidths, int nGlyphs ) { @@ -1022,7 +1021,7 @@ bool PrintFontManager::createFontSubset( const bool bOK = rInfo.CreateFontSubset( FontType::TYPE1_PFB, pOutFile, pGlyphSetName, - aRequestedGlyphIds, pEnc, nGlyphs, pWidths ); + aRequestedGlyphIds, pEnc, nGlyphs); fclose( pOutFile ); // For OTC, values from hhea or OS2 are better psp::PrintFontInfo aFontInfo; @@ -1051,26 +1050,6 @@ bool PrintFontManager::createFontSubset( rInfo.m_aFontBBox = tools::Rectangle( Point( xMin, yMin ), Size( xMax-xMin, yMax-yMin ) ); rInfo.m_nCapHeight = yMax; // Well ... - if (pWidths) - { - // fill in glyph advance widths - std::unique_ptr<sal_uInt16[]> pMetrics = GetTTSimpleGlyphMetrics( pTTFont, - pGID, - nGlyphs, - false/*bVertical*/ ); - if( pMetrics ) - { - for( int i = 0; i < nGlyphs; i++ ) - pWidths[pOldIndex[i]] = pMetrics[i]; - pMetrics.reset(); - } - else - { - CloseTTFont( pTTFont ); - return false; - } - } - bool bSuccess = ( SFErrCodes::Ok == CreateTTFromTTGlyphs( pTTFont, aToFile.getStr(), pGID, diff --git a/vcl/unx/generic/gdi/font.cxx b/vcl/unx/generic/gdi/font.cxx index f0d714758d0f..bf0ca5c98ffb 100644 --- a/vcl/unx/generic/gdi/font.cxx +++ b/vcl/unx/generic/gdi/font.cxx @@ -86,13 +86,12 @@ bool X11SalGraphics::CreateFontSubset( const vcl::font::PhysicalFontFace* pFont, const sal_GlyphId* pGlyphIds, const sal_uInt8* pEncoding, - sal_Int32* pWidths, int nGlyphCount, FontSubsetInfo& rInfo ) { return mxTextRenderImpl->CreateFontSubset(rToFile, pFont, - pGlyphIds, pEncoding, pWidths, nGlyphCount, rInfo); + pGlyphIds, pEncoding, nGlyphCount, rInfo); } const void* X11SalGraphics::GetEmbedFontData(const vcl::font::PhysicalFontFace* pFont, tools::Long* pDataLen) diff --git a/vcl/unx/generic/gdi/freetypetextrender.cxx b/vcl/unx/generic/gdi/freetypetextrender.cxx index f4b4abe30785..555bd2586eb9 100644 --- a/vcl/unx/generic/gdi/freetypetextrender.cxx +++ b/vcl/unx/generic/gdi/freetypetextrender.cxx @@ -132,7 +132,6 @@ bool FreeTypeTextRenderImpl::CreateFontSubset( const vcl::font::PhysicalFontFace* pFont, const sal_GlyphId* pGlyphIds, const sal_uInt8* pEncoding, - sal_Int32* pWidths, int nGlyphCount, FontSubsetInfo& rInfo ) @@ -150,7 +149,6 @@ bool FreeTypeTextRenderImpl::CreateFontSubset( rToFile, pGlyphIds, pEncoding, - pWidths, nGlyphCount ); return bSuccess; } diff --git a/vcl/unx/generic/print/genpspgraphics.cxx b/vcl/unx/generic/print/genpspgraphics.cxx index 5d30288be282..6632c4f077e1 100644 --- a/vcl/unx/generic/print/genpspgraphics.cxx +++ b/vcl/unx/generic/print/genpspgraphics.cxx @@ -320,7 +320,6 @@ bool GenPspGraphics::CreateFontSubset( const vcl::font::PhysicalFontFace* pFont, const sal_GlyphId* pGlyphIds, const sal_uInt8* pEncoding, - sal_Int32* pWidths, int nGlyphCount, FontSubsetInfo& rInfo ) @@ -338,7 +337,6 @@ bool GenPspGraphics::CreateFontSubset( rToFile, pGlyphIds, pEncoding, - pWidths, nGlyphCount ); return bSuccess; } diff --git a/vcl/win/gdi/salfont.cxx b/vcl/win/gdi/salfont.cxx index 0d0cc316e611..3cc5f3bedd32 100644 --- a/vcl/win/gdi/salfont.cxx +++ b/vcl/win/gdi/salfont.cxx @@ -1525,7 +1525,7 @@ static DWORD CalcTag( const char p[5]) { return (p[0]+(p[1]<<8)+(p[2]<<16)+(p[3] bool WinSalGraphics::CreateFontSubset( const OUString& rToFile, const vcl::font::PhysicalFontFace* pFont, const sal_GlyphId* pGlyphIds, const sal_uInt8* pEncoding, - sal_Int32* pGlyphWidths, int nGlyphCount, FontSubsetInfo& rInfo ) + int nGlyphCount, FontSubsetInfo& rInfo ) { ScopedFontHDC aScopedFontHDC(*this, *pFont); HDC hDC = aScopedFontHDC.hdc(); @@ -1553,7 +1553,7 @@ bool WinSalGraphics::CreateFontSubset( const OUString& rToFile, const RawFontData aRawCffData(hDC, nCffTag); if (aRawCffData.get()) return SalGraphics::CreateCFFfontSubset(aRawCffData.get(), aRawCffData.size(), aToFile, - pGlyphIds, pEncoding, pGlyphWidths, nGlyphCount, + pGlyphIds, pEncoding, nGlyphCount, rInfo); // get raw font file data @@ -1577,8 +1577,8 @@ bool WinSalGraphics::CreateFontSubset( const OUString& rToFile, FillFontSubsetInfo(aTTInfo, aPSName, rInfo); // write subset into destination file - return SalGraphics::CreateTTFfontSubset(*aSftTTF.get(), aToFile, aScopedFontHDC.fsp().mbVertical, - pGlyphIds, pEncoding, pGlyphWidths, nGlyphCount); + return SalGraphics::CreateTTFfontSubset(*aSftTTF.get(), aToFile, + pGlyphIds, pEncoding, nGlyphCount); } const void* WinSalGraphics::GetEmbedFontData(const vcl::font::PhysicalFontFace* pFont, tools::Long* pDataLen)