From 911f3a122a6adc36ac25940b29627b26405e2379 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Mon, 26 Jan 2015 21:22:26 +0000 Subject: these are const inputs, we fill widths from pGlyphIds via pEncoding MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I32d8bbc5083223b540f76a928de505d611627957 Reviewed-on: https://gerrit.libreoffice.org/14196 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- vcl/generic/fontmanager/fontmanager.cxx | 4 ++-- vcl/generic/print/genpspgraphics.cxx | 4 ++-- vcl/headless/svptext.cxx | 4 ++-- vcl/inc/cairotextrender.hxx | 4 ++-- vcl/inc/fontmanager.hxx | 4 ++-- vcl/inc/generic/genpspgraphics.h | 4 ++-- vcl/inc/headless/svpgdi.hxx | 4 ++-- vcl/inc/quartz/salgdi.h | 4 ++-- vcl/inc/salgdi.hxx | 4 ++-- vcl/inc/textrender.hxx | 4 ++-- vcl/inc/unx/salgdi.h | 4 ++-- vcl/quartz/salgdicommon.cxx | 8 ++++---- vcl/source/gdi/pdfwriter_impl.cxx | 5 ++++- vcl/unx/generic/gdi/cairotextrender.cxx | 4 ++-- vcl/unx/generic/gdi/salgdi3.cxx | 4 ++-- vcl/win/source/gdi/salgdi3.cxx | 2 +- 16 files changed, 35 insertions(+), 32 deletions(-) (limited to 'vcl') diff --git a/vcl/generic/fontmanager/fontmanager.cxx b/vcl/generic/fontmanager/fontmanager.cxx index c6ee6ec505aa..cf74934ca8ab 100644 --- a/vcl/generic/fontmanager/fontmanager.cxx +++ b/vcl/generic/fontmanager/fontmanager.cxx @@ -1923,8 +1923,8 @@ bool PrintFontManager::createFontSubset( FontSubsetInfo& rInfo, fontID nFont, const OUString& rOutFile, - sal_GlyphId* pGlyphIds, - sal_uInt8* pNewEncoding, + const sal_GlyphId* pGlyphIds, + const sal_uInt8* pNewEncoding, sal_Int32* pWidths, int nGlyphs, bool bVertical diff --git a/vcl/generic/print/genpspgraphics.cxx b/vcl/generic/print/genpspgraphics.cxx index 0ad6b25169c3..a2cdf8bdd6a0 100644 --- a/vcl/generic/print/genpspgraphics.cxx +++ b/vcl/generic/print/genpspgraphics.cxx @@ -988,8 +988,8 @@ SalLayout* GenPspGraphics::GetTextLayout( ImplLayoutArgs& rArgs, int nFallbackLe bool GenPspGraphics::CreateFontSubset( const OUString& rToFile, const PhysicalFontFace* pFont, - sal_GlyphId* pGlyphIds, - sal_uInt8* pEncoding, + const sal_GlyphId* pGlyphIds, + const sal_uInt8* pEncoding, sal_Int32* pWidths, int nGlyphCount, FontSubsetInfo& rInfo diff --git a/vcl/headless/svptext.cxx b/vcl/headless/svptext.cxx index 3b0cf05c2bc3..b075399d27e2 100644 --- a/vcl/headless/svptext.cxx +++ b/vcl/headless/svptext.cxx @@ -296,8 +296,8 @@ bool SvpSalGraphics::AddTempDevFont( PhysicalFontCollection*, bool SvpSalGraphics::CreateFontSubset( const OUString& rToFile, const PhysicalFontFace* pFont, - sal_GlyphId* pGlyphIds, - sal_uInt8* pEncoding, + const sal_GlyphId* pGlyphIds, + const sal_uInt8* pEncoding, sal_Int32* pWidths, int nGlyphCount, FontSubsetInfo& rInfo diff --git a/vcl/inc/cairotextrender.hxx b/vcl/inc/cairotextrender.hxx index 87eede066651..e47b7b3f9982 100644 --- a/vcl/inc/cairotextrender.hxx +++ b/vcl/inc/cairotextrender.hxx @@ -103,8 +103,8 @@ public: virtual bool CreateFontSubset( const OUString& rToFile, const PhysicalFontFace*, - sal_GlyphId* pGlyphIDs, - sal_uInt8* pEncoding, + const sal_GlyphId* pGlyphIDs, + const sal_uInt8* pEncoding, sal_Int32* pWidths, int nGlyphs, FontSubsetInfo& rInfo) SAL_OVERRIDE; diff --git a/vcl/inc/fontmanager.hxx b/vcl/inc/fontmanager.hxx index 1de2e70fcfb6..2cf6e6ad713a 100644 --- a/vcl/inc/fontmanager.hxx +++ b/vcl/inc/fontmanager.hxx @@ -481,8 +481,8 @@ public: bool createFontSubset( FontSubsetInfo&, fontID nFont, const OUString& rOutFile, - sal_GlyphId* pGlyphIDs, - sal_uInt8* pNewEncoding, + const sal_GlyphId* pGlyphIDs, + const sal_uInt8* pNewEncoding, sal_Int32* pWidths, int nGlyphs, bool bVertical = false diff --git a/vcl/inc/generic/genpspgraphics.h b/vcl/inc/generic/genpspgraphics.h index 27e4a62c05e5..2982c8328228 100644 --- a/vcl/inc/generic/genpspgraphics.h +++ b/vcl/inc/generic/genpspgraphics.h @@ -102,8 +102,8 @@ public: virtual bool CreateFontSubset( const OUString& rToFile, const PhysicalFontFace*, - sal_GlyphId* pGlyphIDs, - sal_uInt8* pEncoding, + const sal_GlyphId* pGlyphIDs, + const sal_uInt8* pEncoding, sal_Int32* pWidths, int nGlyphs, FontSubsetInfo& rInfo ) SAL_OVERRIDE; diff --git a/vcl/inc/headless/svpgdi.hxx b/vcl/inc/headless/svpgdi.hxx index 46081402a10e..d429b80e7e82 100644 --- a/vcl/inc/headless/svpgdi.hxx +++ b/vcl/inc/headless/svpgdi.hxx @@ -121,8 +121,8 @@ public: virtual bool AddTempDevFont( PhysicalFontCollection*, const OUString& rFileURL, const OUString& rFontName ) SAL_OVERRIDE; virtual bool CreateFontSubset( const OUString& rToFile, const PhysicalFontFace*, - sal_GlyphId* pGlyphIds, - sal_uInt8* pEncoding, + const sal_GlyphId* pGlyphIds, + const sal_uInt8* pEncoding, sal_Int32* pWidths, int nGlyphs, FontSubsetInfo& rInfo diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h index eb55e9655ea4..737f8d453f41 100644 --- a/vcl/inc/quartz/salgdi.h +++ b/vcl/inc/quartz/salgdi.h @@ -367,8 +367,8 @@ public: // as "undefined character" virtual bool CreateFontSubset( const OUString& rToFile, const PhysicalFontFace* pFont, - sal_GlyphId* pGlyphIds, - sal_uInt8* pEncoding, + const sal_GlyphId* pGlyphIds, + const sal_uInt8* pEncoding, sal_Int32* pWidths, int nGlyphs, FontSubsetInfo& rInfo // out parameter diff --git a/vcl/inc/salgdi.hxx b/vcl/inc/salgdi.hxx index 6e5e80079296..114a5c214784 100644 --- a/vcl/inc/salgdi.hxx +++ b/vcl/inc/salgdi.hxx @@ -174,8 +174,8 @@ public: virtual bool CreateFontSubset( const OUString& rToFile, const PhysicalFontFace* pFont, - sal_GlyphId* pGlyphIDs, - sal_uInt8* pEncoding, + const sal_GlyphId* pGlyphIDs, + const sal_uInt8* pEncoding, sal_Int32* pWidths, int nGlyphs, FontSubsetInfo& rInfo ) = 0; diff --git a/vcl/inc/textrender.hxx b/vcl/inc/textrender.hxx index 60925bbfb67e..a3a8876a4f67 100644 --- a/vcl/inc/textrender.hxx +++ b/vcl/inc/textrender.hxx @@ -53,8 +53,8 @@ public: virtual bool CreateFontSubset( const OUString& rToFile, const PhysicalFontFace*, - sal_GlyphId* pGlyphIDs, - sal_uInt8* pEncoding, + const sal_GlyphId* pGlyphIDs, + const sal_uInt8* pEncoding, sal_Int32* pWidths, int nGlyphs, FontSubsetInfo& rInfo) = 0; diff --git a/vcl/inc/unx/salgdi.h b/vcl/inc/unx/salgdi.h index 97a5ac2371da..baa7de7c4286 100644 --- a/vcl/inc/unx/salgdi.h +++ b/vcl/inc/unx/salgdi.h @@ -126,8 +126,8 @@ public: virtual bool CreateFontSubset( const OUString& rToFile, const PhysicalFontFace*, - sal_GlyphId* pGlyphIDs, - sal_uInt8* pEncoding, + const sal_GlyphId* pGlyphIDs, + const sal_uInt8* pEncoding, sal_Int32* pWidths, int nGlyphs, FontSubsetInfo& rInfo ) SAL_OVERRIDE; diff --git a/vcl/quartz/salgdicommon.cxx b/vcl/quartz/salgdicommon.cxx index 5e53a25d0fc0..4ee18f5fb439 100644 --- a/vcl/quartz/salgdicommon.cxx +++ b/vcl/quartz/salgdicommon.cxx @@ -178,10 +178,10 @@ static void AddPolyPolygonToPath( CGMutablePathRef xPath, } bool AquaSalGraphics::CreateFontSubset( const OUString& rToFile, - const PhysicalFontFace* pFontData, - sal_GlyphId* pGlyphIds, sal_uInt8* pEncoding, - sal_Int32* pGlyphWidths, int nGlyphCount, - FontSubsetInfo& rInfo ) + const PhysicalFontFace* pFontData, + const sal_GlyphId* pGlyphIds, const sal_uInt8* pEncoding, + sal_Int32* pGlyphWidths, int nGlyphCount, + FontSubsetInfo& rInfo ) { // TODO: move more of the functionality here into the generic subsetter code diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 1c798ea9b0a6..ec373aaaf911 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -3008,7 +3008,10 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitSystemFont( const PhysicalFo if( aUnicodeMap.find( c ) != aUnicodeMap.end() ) pWidths[ c ] = aGlyphWidths[ aUnicodeMap[ c ] ]; } - + //TODO: surely this is utterly broken because aGlyphIds is just all zeros, if we + //had the right glyphids here then I imagine we could replace pDuWidths with + //pWidths and remove pWidths assignment above. i.e. start with the glyph ids + //and map those to unicode rather than try and reverse map them ? pGraphics->CreateFontSubset( aTmpName, pFont, aGlyphIds, pEncoding, pDuWidths, 256, aInfo ); osl_removeFile( aTmpName.pData ); } diff --git a/vcl/unx/generic/gdi/cairotextrender.cxx b/vcl/unx/generic/gdi/cairotextrender.cxx index 4b1005d90856..4d018b495633 100644 --- a/vcl/unx/generic/gdi/cairotextrender.cxx +++ b/vcl/unx/generic/gdi/cairotextrender.cxx @@ -596,8 +596,8 @@ SystemFontData CairoTextRender::GetSysFontData( int nFallbackLevel ) const bool CairoTextRender::CreateFontSubset( const OUString& rToFile, const PhysicalFontFace* pFont, - sal_GlyphId* pGlyphIds, - sal_uInt8* pEncoding, + const sal_GlyphId* pGlyphIds, + const sal_uInt8* pEncoding, sal_Int32* pWidths, int nGlyphCount, FontSubsetInfo& rInfo diff --git a/vcl/unx/generic/gdi/salgdi3.cxx b/vcl/unx/generic/gdi/salgdi3.cxx index 2e345a959298..622f77860e66 100644 --- a/vcl/unx/generic/gdi/salgdi3.cxx +++ b/vcl/unx/generic/gdi/salgdi3.cxx @@ -166,8 +166,8 @@ SystemFontData X11SalGraphics::GetSysFontData( int nFallbackLevel ) const bool X11SalGraphics::CreateFontSubset( const OUString& rToFile, const PhysicalFontFace* pFont, - sal_GlyphId* pGlyphIds, - sal_uInt8* pEncoding, + const sal_GlyphId* pGlyphIds, + const sal_uInt8* pEncoding, sal_Int32* pWidths, int nGlyphCount, FontSubsetInfo& rInfo diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx index 407e7211bee2..4e76036dff58 100644 --- a/vcl/win/source/gdi/salgdi3.cxx +++ b/vcl/win/source/gdi/salgdi3.cxx @@ -2442,7 +2442,7 @@ int ScopedTrueTypeFont::open(void * pBuffer, sal_uInt32 nLen, } bool WinSalGraphics::CreateFontSubset( const OUString& rToFile, - const PhysicalFontFace* pFont, sal_GlyphId* pGlyphIds, sal_uInt8* pEncoding, + const PhysicalFontFace* pFont, const sal_GlyphId* pGlyphIds, const sal_uInt8* pEncoding, sal_Int32* pGlyphWidths, int nGlyphCount, FontSubsetInfo& rInfo ) { // TODO: use more of the central font-subsetting code, move stuff there if needed -- cgit