diff options
34 files changed, 387 insertions, 310 deletions
diff --git a/padmin/source/salglyphid.hxx b/padmin/source/salglyphid.hxx new file mode 100644 index 000000000000..dc79d4fa6aec --- /dev/null +++ b/padmin/source/salglyphid.hxx @@ -0,0 +1,48 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +// This header file is a verbatim copy of its counterpart in vcl. +// With spadmin being on its way out (#i123863i#) a cleaner solution isn't worth the effort + +#ifndef _SV_SALGLYPHID_HXX +#define _SV_SALGLYPHID_HXX + +// TODO: sal_GlyphId should become a class... +typedef sal_uInt32 sal_GlyphId; + +// Glyph Flags +#define GF_NONE 0x00000000 +#define GF_FLAGMASK 0xFF800000 +#define GF_IDXMASK ~GF_FLAGMASK +#define GF_ISCHAR 0x00800000 +#define GF_ROTL 0x01000000 +// caution !!! +#define GF_VERT 0x02000000 +// GF_VERT is only for windows implementation +// (win/source/gdi/salgdi3.cxx, win/source/gdi/winlayout.cxx) +// don't use this elsewhere !!! +#define GF_ROTR 0x03000000 +#define GF_ROTMASK 0x03000000 +#define GF_UNHINTED 0x04000000 +#define GF_GSUB 0x08000000 +#define GF_FONTMASK 0xF0000000 +#define GF_FONTSHIFT 28 + +#define GF_DROPPED 0xFFFFFFFF + +#endif // _SV_SALGLYPHID_HXX + diff --git a/vcl/generic/fontmanager/fontmanager.cxx b/vcl/generic/fontmanager/fontmanager.cxx index 56b724069f43..7f20679d1691 100644 --- a/vcl/generic/fontmanager/fontmanager.cxx +++ b/vcl/generic/fontmanager/fontmanager.cxx @@ -1935,7 +1935,7 @@ bool PrintFontManager::createFontSubset( FontSubsetInfo& rInfo, fontID nFont, const OUString& rOutFile, - sal_Int32* pGlyphIDs, + sal_GlyphId* pGlyphIds, sal_uInt8* pNewEncoding, sal_Int32* pWidths, int nGlyphs, @@ -1975,11 +1975,11 @@ bool PrintFontManager::createFontSubset( } else { - DBG_ASSERT( !(pGlyphIDs[i] & 0x007f0000), "overlong glyph id" ); + DBG_ASSERT( !(pGlyphIds[i] & 0x007f0000), "overlong glyph id" ); DBG_ASSERT( (int)pNewEncoding[i] < nGlyphs, "encoding wrong" ); DBG_ASSERT( pEnc[pNewEncoding[i]] == 0 && pGID[pNewEncoding[i]] == 0, "duplicate encoded glyph" ); pEnc[ pNewEncoding[i] ] = pNewEncoding[i]; - pGID[ pNewEncoding[i] ] = (sal_uInt16)pGlyphIDs[ i ]; + pGID[ pNewEncoding[i] ] = (sal_uInt16)pGlyphIds[ i ]; pOldIndex[ pNewEncoding[i] ] = i; nChar++; } @@ -2009,9 +2009,9 @@ bool PrintFontManager::createFontSubset( { rInfo.LoadFont( FontSubsetInfo::CFF_FONT, pCffBytes, nCffLength ); #if 1 // TODO: remove 16bit->long conversion when related methods handle non-16bit glyphids - long aRequestedGlyphs[256]; + sal_GlyphId aRequestedGlyphIds[256]; for( int i = 0; i < nGlyphs; ++i ) - aRequestedGlyphs[i] = pGID[i]; + aRequestedGlyphIds[i] = pGID[i]; #endif // create subset file at requested path FILE* pOutFile = fopen( aToFile.getStr(), "wb" ); @@ -2020,7 +2020,7 @@ bool PrintFontManager::createFontSubset( const bool bOK = rInfo.CreateFontSubset( FontSubsetInfo::TYPE1_PFB, pOutFile, pGlyphSetName, - aRequestedGlyphs, pEnc, nGlyphs, pWidths ); + aRequestedGlyphIds, pEnc, nGlyphs, pWidths ); fclose( pOutFile ); // cleanup before early return CloseTTFont( pTTFont ); @@ -2129,9 +2129,9 @@ void PrintFontManager::getGlyphWidths( fontID nFont, break; #endif // get the matching glyph index - const sal_uInt32 nGlyphId = aCharMap.GetGlyphIndex( c ); + const sal_GlyphId aGlyphId = aCharMap.GetGlyphIndex( c ); // update the requested map - rUnicodeEnc[ (sal_Unicode)c ] = nGlyphId; + rUnicodeEnc[ (sal_Unicode)c ] = aGlyphId; } } } diff --git a/vcl/generic/glyphs/gcach_ftyp.cxx b/vcl/generic/glyphs/gcach_ftyp.cxx index 62d114e3875b..d6017db55f7a 100644 --- a/vcl/generic/glyphs/gcach_ftyp.cxx +++ b/vcl/generic/glyphs/gcach_ftyp.cxx @@ -810,13 +810,13 @@ void ServerFont::FetchFontMetric( ImplFontMetricData& rTo, long& rFactor ) const // ----------------------------------------------------------------------- -static inline void SplitGlyphFlags( const ServerFont& rFont, int& nGlyphIndex, int& nGlyphFlags ) +static inline void SplitGlyphFlags( const ServerFont& rFont, sal_GlyphId& rGlyphId, int& nGlyphFlags ) { - nGlyphFlags = nGlyphIndex & GF_FLAGMASK; - nGlyphIndex &= GF_IDXMASK; + nGlyphFlags = rGlyphId & GF_FLAGMASK; + rGlyphId &= GF_IDXMASK; - if( nGlyphIndex & GF_ISCHAR ) - nGlyphIndex = rFont.GetRawGlyphIndex( nGlyphIndex ); + if( rGlyphId & GF_ISCHAR ) + rGlyphId = rFont.GetRawGlyphIndex( rGlyphId ); } // ----------------------------------------------------------------------- @@ -896,7 +896,7 @@ int ServerFont::ApplyGlyphTransform( int nGlyphFlags, // ----------------------------------------------------------------------- -int ServerFont::GetRawGlyphIndex(sal_UCS4 aChar, sal_UCS4 aVS) const +sal_GlyphId ServerFont::GetRawGlyphIndex(sal_UCS4 aChar, sal_UCS4 aVS) const { if( mpFontInfo->IsSymbolFont() ) { @@ -936,12 +936,12 @@ int ServerFont::GetRawGlyphIndex(sal_UCS4 aChar, sal_UCS4 aVS) const } } - return nGlyphIndex; + return sal_GlyphId( nGlyphIndex); } // ----------------------------------------------------------------------- -int ServerFont::FixupGlyphIndex( int nGlyphIndex, sal_UCS4 aChar ) const +sal_GlyphId ServerFont::FixupGlyphIndex( sal_GlyphId aGlyphId, sal_UCS4 aChar ) const { int nGlyphFlags = GF_NONE; @@ -950,39 +950,39 @@ int ServerFont::FixupGlyphIndex( int nGlyphIndex, sal_UCS4 aChar ) const if( GetFontSelData().mbVertical ) { // TODO: rethink when GSUB is used for non-vertical case - GlyphSubstitution::const_iterator it = maGlyphSubstitution.find( nGlyphIndex ); + GlyphSubstitution::const_iterator it = maGlyphSubstitution.find( aGlyphId ); if( it == maGlyphSubstitution.end() ) { - int nTemp = GetVerticalChar( aChar ); + sal_GlyphId nTemp = GetVerticalChar( aChar ); if( nTemp ) // is substitution possible nTemp = GetRawGlyphIndex( nTemp ); if( nTemp ) // substitute manually if sensible - nGlyphIndex = nTemp | (GF_GSUB | GF_ROTL); + aGlyphId = nTemp | (GF_GSUB | GF_ROTL); else nGlyphFlags |= GetVerticalFlags( aChar ); } else { // for vertical GSUB also compensate for nOrientation=2700 - nGlyphIndex = (*it).second; + aGlyphId = (*it).second; nGlyphFlags |= GF_GSUB | GF_ROTL; } } - if( nGlyphIndex != 0 ) - nGlyphIndex |= nGlyphFlags; + if( aGlyphId != 0 ) + aGlyphId |= nGlyphFlags; - return nGlyphIndex; + return aGlyphId; } // ----------------------------------------------------------------------- -int ServerFont::GetGlyphIndex( sal_UCS4 aChar ) const +sal_GlyphId ServerFont::GetGlyphIndex( sal_UCS4 aChar ) const { - int nGlyphIndex = GetRawGlyphIndex( aChar ); - nGlyphIndex = FixupGlyphIndex( nGlyphIndex, aChar ); - return nGlyphIndex; + sal_GlyphId aGlyphId = GetRawGlyphIndex( aChar ); + aGlyphId = FixupGlyphIndex( aGlyphId, aChar ); + return aGlyphId; } // ----------------------------------------------------------------------- @@ -1002,12 +1002,12 @@ static int lcl_GetCharWidth( FT_FaceRec_* pFaceFT, double fStretch, int nGlyphFl // ----------------------------------------------------------------------- -void ServerFont::InitGlyphData( int nGlyphIndex, GlyphData& rGD ) const +void ServerFont::InitGlyphData( sal_GlyphId aGlyphId, GlyphData& rGD ) const { FT_Activate_Size( maSizeFT ); int nGlyphFlags; - SplitGlyphFlags( *this, nGlyphIndex, nGlyphFlags ); + SplitGlyphFlags( *this, aGlyphId, nGlyphFlags ); int nLoadFlags = mnLoadFlags; @@ -1015,7 +1015,7 @@ void ServerFont::InitGlyphData( int nGlyphIndex, GlyphData& rGD ) const // nLoadFlags |= FT_LOAD_NO_BITMAP; FT_Error rc = -1; - rc = FT_Load_Glyph( maFaceFT, nGlyphIndex, nLoadFlags ); + rc = FT_Load_Glyph( maFaceFT, aGlyphId, nLoadFlags ); if( rc != FT_Err_Ok ) { @@ -1066,12 +1066,12 @@ bool ServerFont::GetAntialiasAdvice( void ) const // ----------------------------------------------------------------------- -bool ServerFont::GetGlyphBitmap1( int nGlyphIndex, RawBitmap& rRawBitmap ) const +bool ServerFont::GetGlyphBitmap1( sal_GlyphId aGlyphId, RawBitmap& rRawBitmap ) const { FT_Activate_Size( maSizeFT ); int nGlyphFlags; - SplitGlyphFlags( *this, nGlyphIndex, nGlyphFlags ); + SplitGlyphFlags( *this, aGlyphId, nGlyphFlags ); FT_Int nLoadFlags = mnLoadFlags; // #i70930# force mono-hinting for monochrome text @@ -1090,7 +1090,7 @@ bool ServerFont::GetGlyphBitmap1( int nGlyphIndex, RawBitmap& rRawBitmap ) const nLoadFlags |= FT_LOAD_NO_BITMAP; FT_Error rc = -1; - rc = FT_Load_Glyph( maFaceFT, nGlyphIndex, nLoadFlags ); + rc = FT_Load_Glyph( maFaceFT, aGlyphId, nLoadFlags ); if( rc != FT_Err_Ok ) return false; @@ -1208,12 +1208,12 @@ bool ServerFont::GetGlyphBitmap1( int nGlyphIndex, RawBitmap& rRawBitmap ) const // ----------------------------------------------------------------------- -bool ServerFont::GetGlyphBitmap8( int nGlyphIndex, RawBitmap& rRawBitmap ) const +bool ServerFont::GetGlyphBitmap8( sal_GlyphId aGlyphId, RawBitmap& rRawBitmap ) const { FT_Activate_Size( maSizeFT ); int nGlyphFlags; - SplitGlyphFlags( *this, nGlyphIndex, nGlyphFlags ); + SplitGlyphFlags( *this, aGlyphId, nGlyphFlags ); FT_Int nLoadFlags = mnLoadFlags; @@ -1227,7 +1227,7 @@ bool ServerFont::GetGlyphBitmap8( int nGlyphIndex, RawBitmap& rRawBitmap ) const nLoadFlags |= FT_LOAD_NO_BITMAP; FT_Error rc = -1; - rc = FT_Load_Glyph( maFaceFT, nGlyphIndex, nLoadFlags ); + rc = FT_Load_Glyph( maFaceFT, aGlyphId, nLoadFlags ); if( rc != FT_Err_Ok ) return false; @@ -1607,7 +1607,7 @@ static int FT_cubic_to( FT_Vector_CPtr p1, FT_Vector_CPtr p2, FT_Vector_CPtr p3, // ----------------------------------------------------------------------- -bool ServerFont::GetGlyphOutline( int nGlyphIndex, +bool ServerFont::GetGlyphOutline( sal_GlyphId aGlyphId, ::basegfx::B2DPolyPolygon& rB2DPolyPoly ) const { if( maSizeFT ) @@ -1616,7 +1616,7 @@ bool ServerFont::GetGlyphOutline( int nGlyphIndex, rB2DPolyPoly.clear(); int nGlyphFlags; - SplitGlyphFlags( *this, nGlyphIndex, nGlyphFlags ); + SplitGlyphFlags( *this, aGlyphId, nGlyphFlags ); FT_Int nLoadFlags = FT_LOAD_DEFAULT | FT_LOAD_IGNORE_TRANSFORM; @@ -1625,7 +1625,7 @@ bool ServerFont::GetGlyphOutline( int nGlyphIndex, nLoadFlags |= FT_LOAD_TARGET_LIGHT; #endif - FT_Error rc = FT_Load_Glyph( maFaceFT, nGlyphIndex, nLoadFlags ); + FT_Error rc = FT_Load_Glyph( maFaceFT, aGlyphId, nLoadFlags ); if( rc != FT_Err_Ok ) return false; diff --git a/vcl/generic/glyphs/glyphcache.cxx b/vcl/generic/glyphs/glyphcache.cxx index 5ac5510ffede..4ac5d82a1b9b 100644 --- a/vcl/generic/glyphs/glyphcache.cxx +++ b/vcl/generic/glyphs/glyphcache.cxx @@ -342,10 +342,10 @@ long ServerFont::Release() const } -GlyphData& ServerFont::GetGlyphData( int nGlyphIndex ) +GlyphData& ServerFont::GetGlyphData( sal_GlyphId aGlyphId ) { // usually the GlyphData is cached - GlyphList::iterator it = maGlyphList.find( nGlyphIndex ); + GlyphList::iterator it = maGlyphList.find( aGlyphId ); if( it != maGlyphList.end() ) { GlyphData& rGlyphData = it->second; GlyphCache::GetInstance().UsingGlyph( *this, rGlyphData ); @@ -353,9 +353,9 @@ GlyphData& ServerFont::GetGlyphData( int nGlyphIndex ) } // sometimes not => we need to create and initialize it ourselves - GlyphData& rGlyphData = maGlyphList[ nGlyphIndex ]; + GlyphData& rGlyphData = maGlyphList[ aGlyphId ]; mnBytesUsed += sizeof( GlyphData ); - InitGlyphData( nGlyphIndex, rGlyphData ); + InitGlyphData( aGlyphId, rGlyphData ); GlyphCache::GetInstance().AddedGlyph( *this, rGlyphData ); return rGlyphData; } diff --git a/vcl/generic/print/genpspgraphics.cxx b/vcl/generic/print/genpspgraphics.cxx index 319ee2aa57f5..938c9083c4c0 100644 --- a/vcl/generic/print/genpspgraphics.cxx +++ b/vcl/generic/print/genpspgraphics.cxx @@ -631,7 +631,7 @@ bool PspFontLayout::LayoutText( ImplLayoutArgs& rArgs ) mbVertical = ((rArgs.mnFlags & SAL_LAYOUT_VERTICAL) != 0); long nUnitsPerPixel = 1; - int nOldGlyphId = -1; + sal_GlyphId aOldGlyphId( GF_DROPPED); long nGlyphWidth = 0; int nCharPos = -1; Point aNewPos( 0, 0 ); @@ -653,7 +653,7 @@ bool PspFontLayout::LayoutText( ImplLayoutArgs& rArgs ) if( aFontEnc == RTL_TEXTENCODING_SYMBOL ) if( cChar < 256 ) cChar += 0xf000; - int nGlyphIndex = cChar; // printer glyphs = unicode + sal_GlyphId aGlyphId( cChar); // printer glyphs = unicode // update fallback_runs if needed psp::CharacterMetric aMetric; @@ -662,25 +662,25 @@ bool PspFontLayout::LayoutText( ImplLayoutArgs& rArgs ) rArgs.NeedFallback( nCharPos, bRightToLeft ); // finish previous glyph - if( nOldGlyphId >= 0 ) + if( aOldGlyphId != GF_DROPPED ) AppendGlyph( aPrevItem ); - nOldGlyphId = nGlyphIndex; + aOldGlyphId = aGlyphId; aNewPos.X() += nGlyphWidth; // prepare GlyphItem for appending it in next round nUnitsPerPixel = mrPrinterGfx.GetCharWidth( cChar, cChar, &nGlyphWidth ); int nGlyphFlags = bRightToLeft ? GlyphItem::IS_RTL_GLYPH : 0; - nGlyphIndex |= GF_ISCHAR; - aPrevItem = GlyphItem( nCharPos, nGlyphIndex, aNewPos, nGlyphFlags, nGlyphWidth ); + aGlyphId |= GF_ISCHAR; + aPrevItem = GlyphItem( nCharPos, aGlyphId, aNewPos, nGlyphFlags, nGlyphWidth ); } // append last glyph item if any - if( nOldGlyphId >= 0 ) + if( aOldGlyphId != GF_DROPPED ) AppendGlyph( aPrevItem ); SetOrientation( mrPrinterGfx.GetFontAngle() ); SetUnitsPerPixel( nUnitsPerPixel ); - return (nOldGlyphId >= 0); + return (aOldGlyphId != GF_DROPPED); } class PspServerFontLayout : public ServerFontLayout @@ -729,7 +729,7 @@ void PspServerFontLayout::InitFont() const static void DrawPrinterLayout( const SalLayout& rLayout, ::psp::PrinterGfx& rGfx, bool bIsPspServerFontLayout ) { const int nMaxGlyphs = 200; - sal_uInt32 aGlyphAry[ nMaxGlyphs ]; // TODO: use sal_GlyphId + sal_GlyphId aGlyphAry[ nMaxGlyphs ]; sal_Int32 aWidthAry[ nMaxGlyphs ]; sal_Int32 aIdxAry [ nMaxGlyphs ]; sal_Unicode aUnicodes[ nMaxGlyphs ]; @@ -769,15 +769,15 @@ static void DrawPrinterLayout( const SalLayout& rLayout, ::psp::PrinterGfx& rGfx { nXOffset += aWidthAry[ i ]; aIdxAry[ i ] = nXOffset / nUnitsPerPixel; - sal_Int32 nGlyphIdx = aGlyphAry[i] & (GF_IDXMASK | GF_ROTMASK); + sal_GlyphId aGlyphId = aGlyphAry[i] & (GF_IDXMASK | GF_ROTMASK); if( pText ) aUnicodes[i] = (aCharPosAry[i] >= nMinCharPos && aCharPosAry[i] <= nMaxCharPos) ? pText[ aCharPosAry[i] ] : 0; else - aUnicodes[i] = (aGlyphAry[i] & GF_ISCHAR) ? nGlyphIdx : 0; - aGlyphAry[i] = nGlyphIdx; + aUnicodes[i] = (aGlyphAry[i] & GF_ISCHAR) ? aGlyphId : 0; + aGlyphAry[i] = aGlyphId; } - rGfx.DrawGlyphs( aPos, (sal_uInt32 *)aGlyphAry, aUnicodes, nGlyphCount, aIdxAry ); + rGfx.DrawGlyphs( aPos, aGlyphAry, aUnicodes, nGlyphCount, aIdxAry ); } } @@ -941,38 +941,38 @@ void GenPspGraphics::GetFontMetric( ImplFontMetricData *pMetric, int ) } } -sal_Bool GenPspGraphics::GetGlyphBoundRect( sal_GlyphId nGlyphIndex, Rectangle& rRect ) +bool GenPspGraphics::GetGlyphBoundRect( sal_GlyphId aGlyphId, Rectangle& rRect ) { - int nLevel = nGlyphIndex >> GF_FONTSHIFT; + const int nLevel = aGlyphId >> GF_FONTSHIFT; if( nLevel >= MAX_FALLBACK ) - return sal_False; + return false; ServerFont* pSF = m_pServerFont[ nLevel ]; if( !pSF ) - return sal_False; + return false; - nGlyphIndex &= GF_IDXMASK; - const GlyphMetric& rGM = pSF->GetGlyphMetric( nGlyphIndex ); + aGlyphId &= GF_IDXMASK; + const GlyphMetric& rGM = pSF->GetGlyphMetric( aGlyphId ); rRect = Rectangle( rGM.GetOffset(), rGM.GetSize() ); - return sal_True; + return true; } -sal_Bool GenPspGraphics::GetGlyphOutline( sal_GlyphId nGlyphIndex, +bool GenPspGraphics::GetGlyphOutline( sal_GlyphId aGlyphId, ::basegfx::B2DPolyPolygon& rB2DPolyPoly ) { - int nLevel = nGlyphIndex >> GF_FONTSHIFT; + const int nLevel = aGlyphId >> GF_FONTSHIFT; if( nLevel >= MAX_FALLBACK ) - return sal_False; + return false; ServerFont* pSF = m_pServerFont[ nLevel ]; if( !pSF ) - return sal_False; + return false; - nGlyphIndex &= GF_IDXMASK; - if( pSF->GetGlyphOutline( nGlyphIndex, rB2DPolyPoly ) ) - return sal_True; + aGlyphId &= GF_IDXMASK; + if( pSF->GetGlyphOutline( aGlyphId, rB2DPolyPoly ) ) + return true; - return sal_False; + return false; } SalLayout* GenPspGraphics::GetTextLayout( ImplLayoutArgs& rArgs, int nFallbackLevel ) @@ -1010,7 +1010,7 @@ SalLayout* GenPspGraphics::GetTextLayout( ImplLayoutArgs& rArgs, int nFallbackLe sal_Bool GenPspGraphics::CreateFontSubset( const OUString& rToFile, const PhysicalFontFace* pFont, - sal_Int32* pGlyphIDs, + sal_GlyphId* pGlyphIds, sal_uInt8* pEncoding, sal_Int32* pWidths, int nGlyphCount, @@ -1028,7 +1028,7 @@ sal_Bool GenPspGraphics::CreateFontSubset( bool bSuccess = rMgr.createFontSubset( rInfo, aFont, rToFile, - pGlyphIDs, + pGlyphIds, pEncoding, pWidths, nGlyphCount ); diff --git a/vcl/generic/print/glyphset.cxx b/vcl/generic/print/glyphset.cxx index 118a0e2cfb3b..f5d8b03d5d86 100644 --- a/vcl/generic/print/glyphset.cxx +++ b/vcl/generic/print/glyphset.cxx @@ -92,7 +92,7 @@ GlyphSet::GetCharID ( sal_Bool GlyphSet::GetGlyphID ( - sal_uInt32 nGlyph, + sal_GlyphId nGlyph, sal_Unicode nUnicode, unsigned char* nOutGlyphID, sal_Int32* nOutGlyphSetID @@ -135,7 +135,7 @@ GlyphSet::LookupCharID ( sal_Bool GlyphSet::LookupGlyphID ( - sal_uInt32 nGlyph, + sal_GlyphId nGlyph, unsigned char* nOutGlyphID, sal_Int32* nOutGlyphSetID ) @@ -269,7 +269,7 @@ GlyphSet::AddCharID ( sal_Bool GlyphSet::AddGlyphID ( - sal_uInt32 nGlyph, + sal_GlyphId nGlyph, sal_Unicode nUnicode, unsigned char* nOutGlyphID, sal_Int32* nOutGlyphSetID @@ -460,7 +460,7 @@ GlyphSet::GetReencodedFontName (sal_Int32 nGlyphSetID) void GlyphSet::DrawGlyphs( PrinterGfx& rGfx, const Point& rPoint, - const sal_uInt32* pGlyphIds, + const sal_GlyphId* pGlyphIds, const sal_Unicode* pUnicodes, sal_Int16 nLen, const sal_Int32* pDeltaArray, @@ -730,7 +730,7 @@ static void CreatePSUploadableFont( TrueTypeFont* pSrcFont, FILE* pTmpFile, std::stable_sort( aSorted.begin(), aSorted.end() ); std::vector< unsigned char > aEncoding( nGlyphCount ); - std::vector< long > aRequestedGlyphs( nGlyphCount ); + std::vector< sal_GlyphId > aRequestedGlyphs( nGlyphCount ); for( int i = 0; i < nGlyphCount; i++ ) { diff --git a/vcl/generic/print/glyphset.hxx b/vcl/generic/print/glyphset.hxx index 009f2ce40b76..8ceb1213f95e 100644 --- a/vcl/generic/print/glyphset.hxx +++ b/vcl/generic/print/glyphset.hxx @@ -49,7 +49,7 @@ private: typedef boost::unordered_map< sal_Unicode, sal_uInt8 > char_map_t; typedef std::list< char_map_t > char_list_t; - typedef boost::unordered_map< sal_uInt32, sal_uInt8 > glyph_map_t; + typedef boost::unordered_map< sal_GlyphId, sal_uInt8 > glyph_map_t; typedef std::list< glyph_map_t > glyph_list_t; char_list_t maCharList; @@ -71,11 +71,11 @@ private: sal_Bool AddCharID (sal_Unicode nChar, unsigned char* nOutGlyphID, sal_Int32* nOutGlyphSetID); - sal_Bool GetGlyphID (sal_uInt32 nGlyph, sal_Unicode nUnicode, + sal_Bool GetGlyphID (sal_GlyphId nGlyphId, sal_Unicode nUnicode, unsigned char* nOutGlyphID, sal_Int32* nOutGlyphSetID); - sal_Bool LookupGlyphID (sal_uInt32 nGlyph, + sal_Bool LookupGlyphID (sal_GlyphId nGlyphId, unsigned char* nOutGlyphID, sal_Int32* nOutGlyphSetID); - sal_Bool AddGlyphID (sal_uInt32 nGlyph, sal_Unicode nUnicode, + sal_Bool AddGlyphID (sal_GlyphId nGlyphId, sal_Unicode nUnicode, unsigned char* nOutGlyphID, sal_Int32* nOutGlyphSetID); void AddNotdef (char_map_t &rCharMap); @@ -109,7 +109,7 @@ public: const sal_Int32* pDeltaArray = NULL); void DrawGlyphs (PrinterGfx& rGfx, const Point& rPoint, - const sal_uInt32* pGlyphIds, + const sal_GlyphId* pGlyphIds, const sal_Unicode* pUnicodes, sal_Int16 nLen, const sal_Int32* pDeltaArray, diff --git a/vcl/generic/print/text_gfx.cxx b/vcl/generic/print/text_gfx.cxx index b8b9439c4a58..0b1d4e65c623 100644 --- a/vcl/generic/print/text_gfx.cxx +++ b/vcl/generic/print/text_gfx.cxx @@ -129,7 +129,7 @@ PrinterGfx::SetFont( void PrinterGfx::drawGlyphs( const Point& rPoint, - sal_uInt32* pGlyphIds, + sal_GlyphId* pGlyphIds, sal_Unicode* pUnicodes, sal_Int16 nLen, sal_Int32* pDeltaArray @@ -198,7 +198,7 @@ void PrinterGfx::DrawGlyphs( // vertical glyphs can have an additional rotation ... sigh. // so break up text in chunks of normal glyphs and print out // specially rotated glyphs extra - sal_uInt32* pTempGlyphIds = (sal_uInt32*)alloca(sizeof(sal_Int32)*nLen); + sal_GlyphId* pTempGlyphIds = (sal_GlyphId*)alloca(sizeof(sal_Int32)*nLen); sal_Int32* pTempDelta = (sal_Int32*)alloca(sizeof(sal_Int32)*nLen); sal_Unicode* pTempUnicodes = (sal_Unicode*)alloca(sizeof(sal_Unicode)*nLen); sal_Int16 nTempLen = 0; diff --git a/vcl/headless/svptext.cxx b/vcl/headless/svptext.cxx index 9b47c41c8621..a634922e71cc 100644 --- a/vcl/headless/svptext.cxx +++ b/vcl/headless/svptext.cxx @@ -49,7 +49,7 @@ class SvpGlyphPeer public: SvpGlyphPeer() {} - BitmapDeviceSharedPtr GetGlyphBmp( ServerFont&, int nGlyphIndex, + BitmapDeviceSharedPtr GetGlyphBmp( ServerFont&, sal_GlyphId, basebmp::Format nBmpFormat, B2IPoint& rTargetPos ); protected: @@ -114,9 +114,9 @@ SvpGlyphCache& SvpGlyphCache::GetInstance() BitmapDeviceSharedPtr SvpGlyphPeer::GetGlyphBmp( ServerFont& rServerFont, - int nGlyphIndex, basebmp::Format nBmpFormat, B2IPoint& rTargetPos ) + sal_GlyphId aGlyphId, basebmp::Format nBmpFormat, B2IPoint& rTargetPos ) { - GlyphData& rGlyphData = rServerFont.GetGlyphData( nGlyphIndex ); + GlyphData& rGlyphData = rServerFont.GetGlyphData( aGlyphId ); if( rGlyphData.ExtDataRef().meInfo != nBmpFormat ) { @@ -131,10 +131,10 @@ BitmapDeviceSharedPtr SvpGlyphPeer::GetGlyphBmp( ServerFont& rServerFont, switch( nBmpFormat ) { case FORMAT_ONE_BIT_LSB_GREY: - bFound = rServerFont.GetGlyphBitmap1( nGlyphIndex, pGcpHelper->maRawBitmap ); + bFound = rServerFont.GetGlyphBitmap1( aGlyphId, pGcpHelper->maRawBitmap ); break; case FORMAT_EIGHT_BIT_GREY: - bFound = rServerFont.GetGlyphBitmap8( nGlyphIndex, pGcpHelper->maRawBitmap ); + bFound = rServerFont.GetGlyphBitmap8( aGlyphId, pGcpHelper->maRawBitmap ); break; default: OSL_FAIL( "SVP GCP::GetGlyphBmp(): illegal scanline format"); @@ -145,7 +145,7 @@ BitmapDeviceSharedPtr SvpGlyphPeer::GetGlyphBmp( ServerFont& rServerFont, } // return .notdef glyph if needed - if( !bFound && (nGlyphIndex != 0) ) + if( !bFound && (aGlyphId != 0) ) { if( bNew ) delete pGcpHelper; @@ -305,7 +305,7 @@ bool SvpSalGraphics::AddTempDevFont( ImplDevFontList*, sal_Bool SvpSalGraphics::CreateFontSubset( const OUString& rToFile, const PhysicalFontFace* pFont, - sal_Int32* pGlyphIDs, + sal_GlyphId* pGlyphIds, sal_uInt8* pEncoding, sal_Int32* pWidths, int nGlyphCount, @@ -323,7 +323,7 @@ sal_Bool SvpSalGraphics::CreateFontSubset( bool bSuccess = rMgr.createFontSubset( rInfo, aFont, rToFile, - pGlyphIDs, + pGlyphIds, pEncoding, pWidths, nGlyphCount ); @@ -381,35 +381,35 @@ void SvpSalGraphics::GetGlyphWidths( const PhysicalFontFace* pFont, } -sal_Bool SvpSalGraphics::GetGlyphBoundRect( sal_GlyphId nGlyphIndex, Rectangle& rRect ) +bool SvpSalGraphics::GetGlyphBoundRect( sal_GlyphId aGlyphId, Rectangle& rRect ) { - int nLevel = nGlyphIndex >> GF_FONTSHIFT; + const int nLevel = aGlyphId >> GF_FONTSHIFT; if( nLevel >= MAX_FALLBACK ) - return sal_False; + return false; ServerFont* pSF = m_pServerFont[ nLevel ]; if( !pSF ) - return sal_False; + return false; - nGlyphIndex &= GF_IDXMASK; - const GlyphMetric& rGM = pSF->GetGlyphMetric( nGlyphIndex ); + aGlyphId &= GF_IDXMASK; + const GlyphMetric& rGM = pSF->GetGlyphMetric( aGlyphId ); rRect = Rectangle( rGM.GetOffset(), rGM.GetSize() ); - return sal_True; + return true; } -sal_Bool SvpSalGraphics::GetGlyphOutline( sal_GlyphId nGlyphIndex, B2DPolyPolygon& rPolyPoly ) +bool SvpSalGraphics::GetGlyphOutline( sal_GlyphId aGlyphId, B2DPolyPolygon& rPolyPoly ) { - int nLevel = nGlyphIndex >> GF_FONTSHIFT; + const int nLevel = aGlyphId >> GF_FONTSHIFT; if( nLevel >= MAX_FALLBACK ) - return sal_False; + return false; const ServerFont* pSF = m_pServerFont[ nLevel ]; if( !pSF ) - return sal_False; + return false; - nGlyphIndex &= GF_IDXMASK; - if( pSF->GetGlyphOutline( nGlyphIndex, rPolyPoly ) ) + aGlyphId &= GF_IDXMASK; + if( pSF->GetGlyphOutline( aGlyphId, rPolyPoly ) ) return sal_True; return sal_False; @@ -431,21 +431,21 @@ void SvpSalGraphics::DrawServerFontLayout( const ServerFontLayout& rSalLayout ) { // iterate over all glyphs in the layout Point aPos; - sal_GlyphId nGlyphIndex; + sal_GlyphId aGlyphId; SvpGlyphPeer& rGlyphPeer = SvpGlyphCache::GetInstance().GetPeer(); - for( int nStart = 0; rSalLayout.GetNextGlyphs( 1, &nGlyphIndex, aPos, nStart ); ) + for( int nStart = 0; rSalLayout.GetNextGlyphs( 1, &aGlyphId, aPos, nStart ); ) { - int nLevel = nGlyphIndex >> GF_FONTSHIFT; + int nLevel = aGlyphId >> GF_FONTSHIFT; DBG_ASSERT( nLevel < MAX_FALLBACK, "SvpGDI: invalid glyph fallback level" ); ServerFont* pSF = m_pServerFont[ nLevel ]; if( !pSF ) continue; // get the glyph's alpha mask and adjust the drawing position - nGlyphIndex &= GF_IDXMASK; + aGlyphId &= GF_IDXMASK; B2IPoint aDstPoint( aPos.X(), aPos.Y() ); BitmapDeviceSharedPtr aAlphaMask - = rGlyphPeer.GetGlyphBmp( *pSF, nGlyphIndex, m_eTextFmt, aDstPoint ); + = rGlyphPeer.GetGlyphBmp( *pSF, aGlyphId, m_eTextFmt, aDstPoint ); if( !aAlphaMask ) // ignore empty glyphs continue; diff --git a/vcl/inc/fontmanager.hxx b/vcl/inc/fontmanager.hxx index a727b84a58c5..a028a20fd6cb 100644 --- a/vcl/inc/fontmanager.hxx +++ b/vcl/inc/fontmanager.hxx @@ -30,6 +30,7 @@ #include <vcl/timer.hxx> #include <vcl/vclenum.hxx> #include <com/sun/star/lang/Locale.hpp> +#include "salglyphid.hxx" #include <vector> @@ -475,7 +476,7 @@ public: bool createFontSubset( FontSubsetInfo&, fontID nFont, const OUString& rOutFile, - sal_Int32* pGlyphIDs, + sal_GlyphId* pGlyphIDs, sal_uInt8* pNewEncoding, sal_Int32* pWidths, int nGlyphs, diff --git a/vcl/inc/fontsubset.hxx b/vcl/inc/fontsubset.hxx index a827a95ea7d1..cc5b1472cc0a 100644 --- a/vcl/inc/fontsubset.hxx +++ b/vcl/inc/fontsubset.hxx @@ -24,6 +24,7 @@ #include <tools/gen.hxx> #include <cstdio> +#include "salglyphid.hxx" #include "vcl/dllapi.h" namespace vcl { struct _TrueTypeFont; } ///< SFT's idea of a TTF font @@ -54,7 +55,7 @@ public: bool CreateFontSubset( int nOutFontTypeMask, FILE* pOutFile, const char* pOutFontName, - const long* pReqGlyphIds, const sal_uInt8* pEncodedIds, + const sal_GlyphId* pGlyphIds, const sal_uInt8* pEncodedIds, int nReqGlyphCount, sal_Int32* pOutGlyphWidths = NULL ); public: // TODO: make subsetter results private and provide accessor methods instead @@ -77,7 +78,7 @@ private: int mnReqFontTypeMask; ///< allowed subset-target font types FILE* mpOutFile; const char* mpReqFontName; - const long* mpReqGlyphIds; + const sal_GlyphId* mpReqGlyphIds; const sal_uInt8* mpReqEncodedIds; int mnReqGlyphCount; diff --git a/vcl/inc/generic/genpspgraphics.h b/vcl/inc/generic/genpspgraphics.h index 28ee5c3c48a4..044cb123fb21 100644 --- a/vcl/inc/generic/genpspgraphics.h +++ b/vcl/inc/generic/genpspgraphics.h @@ -99,7 +99,7 @@ public: virtual sal_Bool CreateFontSubset( const OUString& rToFile, const PhysicalFontFace*, - sal_Int32* pGlyphIDs, + sal_GlyphId* pGlyphIDs, sal_uInt8* pEncoding, sal_Int32* pWidths, int nGlyphs, @@ -116,8 +116,8 @@ public: bool bVertical, Int32Vector& rWidths, Ucs2UIntMap& rUnicodeEnc ); - virtual sal_Bool GetGlyphBoundRect( sal_GlyphId nIndex, Rectangle& ); - virtual sal_Bool GetGlyphOutline( sal_GlyphId nIndex, ::basegfx::B2DPolyPolygon& ); + virtual bool GetGlyphBoundRect( sal_GlyphId, Rectangle& ); + virtual bool GetGlyphOutline( sal_GlyphId, ::basegfx::B2DPolyPolygon& ); virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ); virtual void DrawServerFontLayout( const ServerFontLayout& ); virtual bool supportsOperation( OutDevSupportType ) const; diff --git a/vcl/inc/generic/glyphcache.hxx b/vcl/inc/generic/glyphcache.hxx index 452cf4bf0f4e..99274d171f6b 100644 --- a/vcl/inc/generic/glyphcache.hxx +++ b/vcl/inc/generic/glyphcache.hxx @@ -203,20 +203,20 @@ public: const ImplFontCharMap* GetImplFontCharMap() const; bool GetFontCapabilities(vcl::FontCapabilities &) const; - GlyphData& GetGlyphData( int nGlyphIndex ); - const GlyphMetric& GetGlyphMetric( int nGlyphIndex ) - { return GetGlyphData( nGlyphIndex ).GetMetric(); } + GlyphData& GetGlyphData( sal_GlyphId ); + const GlyphMetric& GetGlyphMetric( sal_GlyphId aGlyphId ) + { return GetGlyphData( aGlyphId ).GetMetric(); } #if ENABLE_GRAPHITE virtual GraphiteFaceWrapper* GetGraphiteFace() const; #endif - int GetGlyphIndex( sal_UCS4 ) const; - int GetRawGlyphIndex( sal_UCS4, sal_UCS4 = 0 ) const; - int FixupGlyphIndex( int nGlyphIndex, sal_UCS4 ) const; - bool GetGlyphOutline( int nGlyphIndex, ::basegfx::B2DPolyPolygon& ) const; + sal_GlyphId GetGlyphIndex( sal_UCS4 ) const; + sal_GlyphId GetRawGlyphIndex( sal_UCS4, sal_UCS4 = 0 ) const; + sal_GlyphId FixupGlyphIndex( sal_GlyphId aGlyphId, sal_UCS4 ) const; + bool GetGlyphOutline( sal_GlyphId aGlyphId, ::basegfx::B2DPolyPolygon& ) const; bool GetAntialiasAdvice( void ) const; - bool GetGlyphBitmap1( int nGlyphIndex, RawBitmap& ) const; - bool GetGlyphBitmap8( int nGlyphIndex, RawBitmap& ) const; + bool GetGlyphBitmap1( sal_GlyphId aGlyphId, RawBitmap& ) const; + bool GetGlyphBitmap8( sal_GlyphId aGlyphId, RawBitmap& ) const; private: friend class GlyphCache; @@ -229,7 +229,7 @@ private: long Release() const; sal_uLong GetByteCount() const { return mnBytesUsed; } - void InitGlyphData( int nGlyphIndex, GlyphData& ) const; + void InitGlyphData( sal_GlyphId, GlyphData& ) const; void GarbageCollect( long ); void ReleaseFromGarbageCollect(); diff --git a/vcl/inc/headless/svpgdi.hxx b/vcl/inc/headless/svpgdi.hxx index 9d006bf27c8c..da60ef5b67af 100644 --- a/vcl/inc/headless/svpgdi.hxx +++ b/vcl/inc/headless/svpgdi.hxx @@ -157,7 +157,7 @@ public: virtual bool AddTempDevFont( ImplDevFontList*, const OUString& rFileURL, const OUString& rFontName ); virtual sal_Bool CreateFontSubset( const OUString& rToFile, const PhysicalFontFace*, - sal_Int32* pGlyphIDs, + sal_GlyphId* pGlyphIds, sal_uInt8* pEncoding, sal_Int32* pWidths, int nGlyphs, @@ -174,8 +174,8 @@ public: bool bVertical, Int32Vector& rWidths, Ucs2UIntMap& rUnicodeEnc ); - virtual sal_Bool GetGlyphBoundRect( sal_GlyphId nIndex, Rectangle& ); - virtual sal_Bool GetGlyphOutline( sal_GlyphId nIndex, ::basegfx::B2DPolyPolygon& ); + virtual bool GetGlyphBoundRect( sal_GlyphId nIndex, Rectangle& ); + virtual bool GetGlyphOutline( sal_GlyphId nIndex, ::basegfx::B2DPolyPolygon& ); virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ); virtual void DrawServerFontLayout( const ServerFontLayout& ); virtual bool supportsOperation( OutDevSupportType ) const; diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h index 15e58e16afa6..5fcb79729065 100644 --- a/vcl/inc/quartz/salgdi.h +++ b/vcl/inc/quartz/salgdi.h @@ -341,9 +341,9 @@ public: // rInfo: additional outgoing information // implementation note: encoding 0 with glyph id 0 should be added implicitly // as "undefined character" - virtual sal_Bool CreateFontSubset( const OUString& rToFile, + virtual sal_Bool CreateFontSubset( const OUString& rToFile, const PhysicalFontFace* pFont, - sal_Int32* pGlyphIDs, + sal_GlyphId* pGlyphIds, sal_uInt8* pEncoding, sal_Int32* pWidths, int nGlyphs, @@ -379,8 +379,8 @@ public: Int32Vector& rWidths, Ucs2UIntMap& rUnicodeEnc ); - virtual sal_Bool GetGlyphBoundRect( sal_GlyphId nIndex, Rectangle& ); - virtual sal_Bool GetGlyphOutline( sal_GlyphId nIndex, basegfx::B2DPolyPolygon& ); + virtual bool GetGlyphBoundRect( sal_GlyphId, Rectangle& ); + virtual bool GetGlyphOutline( sal_GlyphId, basegfx::B2DPolyPolygon& ); virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ); virtual void DrawServerFontLayout( const ServerFontLayout& ); diff --git a/vcl/inc/salgdi.hxx b/vcl/inc/salgdi.hxx index e12c5ac5f8e9..ec6f5bc26112 100644 --- a/vcl/inc/salgdi.hxx +++ b/vcl/inc/salgdi.hxx @@ -26,6 +26,7 @@ #include "osl/thread.hxx" #include "vcl/outdev.hxx" #include "vcl/salnativewidgets.hxx" +#include "salglyphid.hxx" #include "sallayout.hxx" #include <map> @@ -261,7 +262,7 @@ public: // as "undefined character" virtual sal_Bool CreateFontSubset( const OUString& rToFile, const PhysicalFontFace* pFont, - sal_Int32* pGlyphIDs, + sal_GlyphId* pGlyphIDs, sal_uInt8* pEncoding, sal_Int32* pWidths, int nGlyphs, @@ -303,8 +304,8 @@ public: Int32Vector& rWidths, Ucs2UIntMap& rUnicodeEnc ) = 0; - virtual sal_Bool GetGlyphBoundRect( sal_GlyphId nIndex, Rectangle& ) = 0; - virtual sal_Bool GetGlyphOutline( sal_GlyphId nIndex, basegfx::B2DPolyPolygon& ) = 0; + virtual bool GetGlyphBoundRect( sal_GlyphId, Rectangle& ) = 0; + virtual bool GetGlyphOutline( sal_GlyphId, basegfx::B2DPolyPolygon& ) = 0; virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ) = 0; virtual void DrawServerFontLayout( const ServerFontLayout& ) = 0; diff --git a/vcl/inc/salglyphid.hxx b/vcl/inc/salglyphid.hxx new file mode 100644 index 000000000000..d7d7d7c3f46f --- /dev/null +++ b/vcl/inc/salglyphid.hxx @@ -0,0 +1,45 @@ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef _SV_SALGLYPHID_HXX +#define _SV_SALGLYPHID_HXX + +// TODO: sal_GlyphId should become a class... +typedef sal_uInt32 sal_GlyphId; + +// Glyph Flags +#define GF_NONE 0x00000000 +#define GF_FLAGMASK 0xFF800000 +#define GF_IDXMASK ~GF_FLAGMASK +#define GF_ISCHAR 0x00800000 +#define GF_ROTL 0x01000000 +// caution !!! +#define GF_VERT 0x02000000 +// GF_VERT is only for windows implementation +// (win/source/gdi/salgdi3.cxx, win/source/gdi/winlayout.cxx) +// don't use this elsewhere !!! +#define GF_ROTR 0x03000000 +#define GF_ROTMASK 0x03000000 +#define GF_UNHINTED 0x04000000 +#define GF_GSUB 0x08000000 +#define GF_FONTMASK 0xF0000000 +#define GF_FONTSHIFT 28 + +#define GF_DROPPED 0xFFFFFFFF + +#endif // _SV_SALGLYPHID_HXX + diff --git a/vcl/inc/sallayout.hxx b/vcl/inc/sallayout.hxx index c4a1d4cdf081..047308632e97 100644 --- a/vcl/inc/sallayout.hxx +++ b/vcl/inc/sallayout.hxx @@ -36,6 +36,7 @@ typedef unsigned short LanguageType; // for typedef sal_UCS4 #include <vcl/vclenum.hxx> +#include "salglyphid.hxx" class SalGraphics; class PhysicalFontFace; @@ -134,28 +135,6 @@ bool IsDiacritic( sal_UCS4 ); int GetVerticalFlags( sal_UCS4 ); sal_UCS4 GetVerticalChar( sal_UCS4 ); -typedef sal_uInt32 sal_GlyphId; - -// Glyph Flags -#define GF_NONE 0x00000000 -#define GF_FLAGMASK 0xFF800000 -#define GF_IDXMASK ~GF_FLAGMASK -#define GF_ISCHAR 0x00800000 -#define GF_ROTL 0x01000000 -// caution !!! -#define GF_VERT 0x02000000 -// GF_VERT is only for windows implementation -// (win/source/gdi/salgdi3.cxx, win/source/gdi/winlayout.cxx) -// don't use this elsewhere !!! -#define GF_ROTR 0x03000000 -#define GF_ROTMASK 0x03000000 -#define GF_UNHINTED 0x04000000 -#define GF_GSUB 0x08000000 -#define GF_FONTMASK 0xF0000000 -#define GF_FONTSHIFT 28 - -#define GF_DROPPED 0xFFFFFFFF - // all positions/widths are in font units // one exception: drawposition is in pixel units @@ -310,26 +289,26 @@ struct GlyphItem int mnOrigWidth; // original glyph width int mnNewWidth; // width after adjustments int mnXOffset; - sal_GlyphId mnGlyphIndex; + sal_GlyphId maGlyphId; Point maLinearPos; // absolute position of non rotated string public: GlyphItem() {} - GlyphItem( int nCharPos, sal_GlyphId nGlyphIndex, const Point& rLinearPos, + GlyphItem( int nCharPos, sal_GlyphId aGlyphId, const Point& rLinearPos, long nFlags, int nOrigWidth ) : mnFlags(nFlags), mnCharPos(nCharPos), mnOrigWidth(nOrigWidth), mnNewWidth(nOrigWidth), mnXOffset(0), - mnGlyphIndex(nGlyphIndex), maLinearPos(rLinearPos) + maGlyphId(aGlyphId), maLinearPos(rLinearPos) {} - GlyphItem( int nCharPos, sal_GlyphId nGlyphIndex, const Point& rLinearPos, + GlyphItem( int nCharPos, sal_GlyphId aGlyphId, const Point& rLinearPos, long nFlags, int nOrigWidth, int nXOffset ) : mnFlags(nFlags), mnCharPos(nCharPos), mnOrigWidth(nOrigWidth), mnNewWidth(nOrigWidth), mnXOffset(nXOffset), - mnGlyphIndex(nGlyphIndex), maLinearPos(rLinearPos) + maGlyphId(aGlyphId), maLinearPos(rLinearPos) {} diff --git a/vcl/inc/unx/salgdi.h b/vcl/inc/unx/salgdi.h index ddadb55d96ef..962c32e60e3f 100644 --- a/vcl/inc/unx/salgdi.h +++ b/vcl/inc/unx/salgdi.h @@ -235,7 +235,7 @@ public: virtual bool AddTempDevFont( ImplDevFontList*, const OUString& rFileURL, const OUString& rFontName ); virtual sal_Bool CreateFontSubset( const OUString& rToFile, const PhysicalFontFace*, - sal_Int32* pGlyphIDs, + sal_GlyphId* pGlyphIDs, sal_uInt8* pEncoding, sal_Int32* pWidths, int nGlyphs, @@ -252,8 +252,8 @@ public: bool bVertical, Int32Vector& rWidths, Ucs2UIntMap& rUnicodeEnc ); - virtual sal_Bool GetGlyphBoundRect( sal_GlyphId nIndex, Rectangle& ); - virtual sal_Bool GetGlyphOutline( sal_GlyphId nIndex, ::basegfx::B2DPolyPolygon& ); + virtual bool GetGlyphBoundRect( sal_GlyphId nIndex, Rectangle& ); + virtual bool GetGlyphOutline( sal_GlyphId nIndex, ::basegfx::B2DPolyPolygon& ); virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ); virtual void DrawServerFontLayout( const ServerFontLayout& ); virtual bool supportsOperation( OutDevSupportType ) const; diff --git a/vcl/inc/win/salgdi.h b/vcl/inc/win/salgdi.h index bd9483a9e4db..58de36ad0f87 100644 --- a/vcl/inc/win/salgdi.h +++ b/vcl/inc/win/salgdi.h @@ -330,7 +330,7 @@ public: // as "undefined character" virtual sal_Bool CreateFontSubset( const OUString& rToFile, const PhysicalFontFace*, - long* pGlyphIDs, + sal_GlyphId* pGlyphIDs, sal_uInt8* pEncoding, sal_Int32* pWidths, int nGlyphs, @@ -366,8 +366,8 @@ public: Ucs2UIntMap& rUnicodeEnc ); virtual int GetMinKashidaWidth(); - virtual sal_Bool GetGlyphBoundRect( sal_GlyphId nIndex, Rectangle& ); - virtual sal_Bool GetGlyphOutline( sal_GlyphId nIndex, ::basegfx::B2DPolyPolygon& ); + virtual bool GetGlyphBoundRect( sal_GlyphId, Rectangle& ); + virtual bool GetGlyphOutline( sal_GlyphId, ::basegfx::B2DPolyPolygon& ); virtual SalLayout* GetTextLayout( ImplLayoutArgs&, int nFallbackLevel ); virtual void DrawServerFontLayout( const ServerFontLayout& ); diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx index 8211b9f296a2..ea4cdadf6510 100644 --- a/vcl/quartz/ctfonts.cxx +++ b/vcl/quartz/ctfonts.cxx @@ -134,9 +134,9 @@ void CoreTextStyle::GetFontMetric( ImplFontMetricData& rMetric ) const // ----------------------------------------------------------------------- -bool CoreTextStyle::GetGlyphBoundRect( sal_GlyphId nGlyphId, Rectangle& rRect ) const +bool CoreTextStyle::GetGlyphBoundRect( sal_GlyphId aGlyphId, Rectangle& rRect ) const { - CGGlyph nCGGlyph = nGlyphId & GF_IDXMASK; + CGGlyph nCGGlyph = aGlyphId & GF_IDXMASK; // XXX: this is broken if the glyph came from fallback font CTFontRef aCTFontRef = (CTFontRef)CFDictionaryGetValue( mpStyleDict, kCTFontAttributeName ); @@ -192,11 +192,11 @@ static void MyCGPathApplierFunc( void* pData, const CGPathElement* pElement ) } } -bool CoreTextStyle::GetGlyphOutline( sal_GlyphId nGlyphId, basegfx::B2DPolyPolygon& rResult ) const +bool CoreTextStyle::GetGlyphOutline( sal_GlyphId aGlyphId, basegfx::B2DPolyPolygon& rResult ) const { rResult.clear(); - CGGlyph nCGGlyph = nGlyphId & GF_IDXMASK; + CGGlyph nCGGlyph = aGlyphId & GF_IDXMASK; // XXX: this is broken if the glyph came from fallback font CTFontRef pCTFont = (CTFontRef)CFDictionaryGetValue( mpStyleDict, kCTFontAttributeName ); CGPathRef xPath = CTFontCreatePathForGlyph( pCTFont, nCGGlyph, NULL ); diff --git a/vcl/quartz/ctlayout.cxx b/vcl/quartz/ctlayout.cxx index 56d86967aa53..02583a16553a 100644 --- a/vcl/quartz/ctlayout.cxx +++ b/vcl/quartz/ctlayout.cxx @@ -32,7 +32,7 @@ public: virtual void AdjustLayout( ImplLayoutArgs& ); virtual void DrawText( SalGraphics& ) const; - virtual int GetNextGlyphs( int nLen, sal_GlyphId* pGlyphs, Point& rPos, int&, + virtual int GetNextGlyphs( int nLen, sal_GlyphId* pOutGlyphIds, Point& rPos, int&, sal_Int32* pGlyphAdvances, int* pCharIndexes, const PhysicalFontFace** pFallbackFonts ) const; @@ -235,7 +235,7 @@ void CTLayout::DrawText( SalGraphics& rGraphics ) const CGContextRestoreGState( rAquaGraphics.mrContext ); } -int CTLayout::GetNextGlyphs( int nLen, sal_GlyphId* pGlyphIDs, Point& rPos, int& nStart, +int CTLayout::GetNextGlyphs( int nLen, sal_GlyphId* pOutGlyphIds, Point& rPos, int& nStart, sal_Int32* pGlyphAdvances, int* pCharIndexes, const PhysicalFontFace** pFallbackFonts ) const { @@ -325,7 +325,7 @@ int CTLayout::GetNextGlyphs( int nLen, sal_GlyphId* pGlyphIDs, Point& rPos, int& for(; (--nLen >= 0) && (nSubIndex < nGlyphsInRun); ++nSubIndex, ++nStart ) { // convert glyph details for VCL - *(pGlyphIDs++) = pCGGlyphIdx[ nSubIndex ]; + *(pOutGlyphIds++) = pCGGlyphIdx[ nSubIndex ]; if( pGlyphAdvances ) *(pGlyphAdvances++) = lrint(pCGGlyphAdvs[ nSubIndex ].width); if( pCharIndexes ) diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx index ceef0235410e..9f07939ef828 100644 --- a/vcl/quartz/salgdi.cxx +++ b/vcl/quartz/salgdi.cxx @@ -420,17 +420,17 @@ bool AquaSalGraphics::AddTempDevFont( ImplDevFontList*, // ----------------------------------------------------------------------- -sal_Bool AquaSalGraphics::GetGlyphOutline( sal_GlyphId nGlyphId, basegfx::B2DPolyPolygon& rPolyPoly ) +bool AquaSalGraphics::GetGlyphOutline( sal_GlyphId aGlyphId, basegfx::B2DPolyPolygon& rPolyPoly ) { - const bool bRC = mpTextStyle->GetGlyphOutline( nGlyphId, rPolyPoly ); + const bool bRC = mpTextStyle->GetGlyphOutline( aGlyphId, rPolyPoly ); return bRC; } // ----------------------------------------------------------------------- -sal_Bool AquaSalGraphics::GetGlyphBoundRect( sal_GlyphId nGlyphId, Rectangle& rRect ) +bool AquaSalGraphics::GetGlyphBoundRect( sal_GlyphId aGlyphId, Rectangle& rRect ) { - const bool bRC = mpTextStyle->GetGlyphBoundRect( nGlyphId, rRect ); + const bool bRC = mpTextStyle->GetGlyphBoundRect( aGlyphId, rRect ); return bRC; } diff --git a/vcl/quartz/salgdicommon.cxx b/vcl/quartz/salgdicommon.cxx index 57e8eb172c3d..26d4d3d75fd1 100644 --- a/vcl/quartz/salgdicommon.cxx +++ b/vcl/quartz/salgdicommon.cxx @@ -143,7 +143,7 @@ static void AddPolyPolygonToPath( CGMutablePathRef xPath, sal_Bool AquaSalGraphics::CreateFontSubset( const OUString& rToFile, const PhysicalFontFace* pFontData, - sal_Int32* pGlyphIDs, sal_uInt8* pEncoding, + sal_GlyphId* pGlyphIds, sal_uInt8* pEncoding, sal_Int32* pGlyphWidths, int nGlyphCount, FontSubsetInfo& rInfo ) { @@ -176,12 +176,12 @@ sal_Bool AquaSalGraphics::CreateFontSubset( const OUString& rToFile, #ifdef __LP64__ long *pLongGlyphIDs = (long*)alloca(nGlyphCount * sizeof(long)); for (int i = 0; i < nGlyphCount; i++) - pLongGlyphIDs[i] = pGlyphIDs[i]; + pLongGlyphIDs[i] = pGlyphIds[i]; bool bRC = rInfo.CreateFontSubset( FontSubsetInfo::TYPE1_PFB, pOutFile, NULL, pLongGlyphIDs, pEncoding, nGlyphCount, pGlyphWidths ); #else bool bRC = rInfo.CreateFontSubset( FontSubsetInfo::TYPE1_PFB, pOutFile, NULL, - pGlyphIDs, pEncoding, nGlyphCount, pGlyphWidths ); + pGlyphIds, pEncoding, nGlyphCount, pGlyphWidths ); #endif fclose( pOutFile ); return bRC; @@ -229,21 +229,21 @@ sal_Bool AquaSalGraphics::CreateFontSubset( const OUString& rToFile, for( int i = 0; i < nGlyphCount; ++i ) { aTempEncs[i] = pEncoding[i]; - sal_uInt32 nGlyphIdx = pGlyphIDs[i] & GF_IDXMASK; - if( pGlyphIDs[i] & GF_ISCHAR ) + sal_GlyphId aGlyphId(pGlyphIds[i] & GF_IDXMASK); + if( pGlyphIds[i] & GF_ISCHAR ) { - bool bVertical = (pGlyphIDs[i] & GF_ROTMASK) != 0; - nGlyphIdx = ::MapChar( pSftFont, static_cast<sal_uInt16>(nGlyphIdx), bVertical ); - if( nGlyphIdx == 0 && pFontData->IsSymbolFont() ) + bool bVertical = (pGlyphIds[i] & GF_ROTMASK) != 0; + aGlyphId = ::MapChar( pSftFont, static_cast<sal_uInt16>(aGlyphId), bVertical ); + if( aGlyphId == 0 && pFontData->IsSymbolFont() ) { // #i12824# emulate symbol aliasing U+FXXX <-> U+0XXX - nGlyphIdx = pGlyphIDs[i] & GF_IDXMASK; - nGlyphIdx = (nGlyphIdx & 0xF000) ? (nGlyphIdx & 0x00FF) : (nGlyphIdx | 0xF000 ); - nGlyphIdx = ::MapChar( pSftFont, static_cast<sal_uInt16>(nGlyphIdx), bVertical ); + aGlyphId = pGlyphIds[i] & GF_IDXMASK; + aGlyphId = (aGlyphId & 0xF000) ? (aGlyphId & 0x00FF) : (aGlyphId | 0xF000 ); + aGlyphId = ::MapChar( pSftFont, static_cast<sal_uInt16>(aGlyphId), bVertical ); } } - aShortIDs[i] = static_cast<sal_uInt16>( nGlyphIdx ); - if( !nGlyphIdx ) + aShortIDs[i] = static_cast<sal_uInt16>( aGlyphId ); + if( !aGlyphId ) if( nNotDef < 0 ) nNotDef = i; // first NotDef glyph found } diff --git a/vcl/source/fontsubset/cff.cxx b/vcl/source/fontsubset/cff.cxx index e2241a1b3fb4..0fbe9407b633 100644 --- a/vcl/source/fontsubset/cff.cxx +++ b/vcl/source/fontsubset/cff.cxx @@ -22,7 +22,7 @@ #include <cstring> #include <assert.h> -#include <fontsubset.hxx> +#include "fontsubset.hxx" #include <vcl/strhelper.hxx> @@ -346,7 +346,7 @@ class SubsetterContext public: virtual ~SubsetterContext( void); virtual bool emitAsType1( class Type1Emitter&, - const long* pGlyphIDs, const U8* pEncoding, + const sal_GlyphId* pGlyphIds, const U8* pEncoding, GlyphWidth* pGlyphWidths, int nGlyphCount, FontSubsetInfo& ) = 0; }; @@ -371,7 +371,7 @@ public: void initialCffRead( void); bool emitAsType1( class Type1Emitter&, - const long* pGlyphIDs, const U8* pEncoding, + const sal_GlyphId* pGlyphIds, const U8* pEncoding, GlyphWidth* pGlyphWidths, int nGlyphCount, FontSubsetInfo& ); // used by charstring converter @@ -2031,7 +2031,7 @@ void Type1Emitter::emitValVector( const char* pLineHead, const char* pLineTail, // -------------------------------------------------------------------- bool CffSubsetterContext::emitAsType1( Type1Emitter& rEmitter, - const long* pReqGlyphIDs, const U8* pReqEncoding, + const sal_GlyphId* pReqGlyphIds, const U8* pReqEncoding, GlyphWidth* pGlyphWidths, int nGlyphCount, FontSubsetInfo& rFSInfo) { // prepare some fontdirectory details @@ -2104,7 +2104,7 @@ bool CffSubsetterContext::emitAsType1( Type1Emitter& rEmitter, "/Encoding 256 array\n" "0 1 255 {1 index exch /.notdef put} for\n"); for( int i = 1; (i < nGlyphCount) && (i < 256); ++i) { - const char* pGlyphName = getGlyphName( pReqGlyphIDs[i]); + const char* pGlyphName = getGlyphName( pReqGlyphIds[i]); pOut += sprintf( pOut, "dup %d /%s put\n", pReqEncoding[i], pGlyphName); } pOut += sprintf( pOut, "readonly def\n"); @@ -2254,20 +2254,20 @@ bool CffSubsetterContext::emitAsType1( Type1Emitter& rEmitter, "2 index /CharStrings %d dict dup begin\n", nGlyphCount); rEmitter.emitAllCrypted(); for( int i = 0; i < nGlyphCount; ++i) { - const int nGlyphId = pReqGlyphIDs[i]; - assert( (nGlyphId >= 0) && (nGlyphId < mnCharStrCount)); + const int nCffGlyphId = pReqGlyphIds[i]; + assert( (nCffGlyphId >= 0) && (nCffGlyphId < mnCharStrCount)); // get privdict context matching to the glyph - const int nFDSelect = getFDSelect( nGlyphId); + const int nFDSelect = getFDSelect( nCffGlyphId); if( nFDSelect < 0) continue; mpCffLocal = &maCffLocal[ nFDSelect]; // convert the Type2op charstring to its Type1op counterpart - const int nT2Len = seekIndexData( mnCharStrBase, nGlyphId); + const int nT2Len = seekIndexData( mnCharStrBase, nCffGlyphId); assert( nT2Len > 0); U8 aType1Ops[ MAX_T1OPS_SIZE]; // TODO: dynamic allocation const int nT1Len = convert2Type1Ops( mpCffLocal, mpReadPtr, nT2Len, aType1Ops); // get the glyph name - const char* pGlyphName = getGlyphName( nGlyphId); + const char* pGlyphName = getGlyphName( nCffGlyphId); // emit the encrypted Type1op charstring pOut += sprintf( pOut, "/%s %d RD ", pGlyphName, nT1Len); memcpy( pOut, aType1Ops, nT1Len); diff --git a/vcl/source/fontsubset/fontsubset.cxx b/vcl/source/fontsubset/fontsubset.cxx index 4e06e3bc9553..8b8970486cad 100644 --- a/vcl/source/fontsubset/fontsubset.cxx +++ b/vcl/source/fontsubset/fontsubset.cxx @@ -71,7 +71,7 @@ bool FontSubsetInfo::LoadFont( vcl::_TrueTypeFont* pSftTTFont ) bool FontSubsetInfo::CreateFontSubset( int nReqFontTypeMask, FILE* pOutFile, const char* pReqFontName, - const long* pReqGlyphIds, const sal_uInt8* pReqEncodedIds, int nReqGlyphCount, + const sal_GlyphId* pReqGlyphIds, const sal_uInt8* pReqEncodedIds, int nReqGlyphCount, sal_Int32* pOutGlyphWidths) { // prepare request details needed by all underlying subsetters diff --git a/vcl/source/gdi/outdev3.cxx b/vcl/source/gdi/outdev3.cxx index 3feb9bfa353b..b888e773dbc8 100644 --- a/vcl/source/gdi/outdev3.cxx +++ b/vcl/source/gdi/outdev3.cxx @@ -4038,12 +4038,12 @@ void OutputDevice::ImplDrawTextLines( SalLayout& rSalLayout, for( int nStart = 0;;) { // iterate through the layouted glyphs - sal_GlyphId nGlyphIndex; - if( !rSalLayout.GetNextGlyphs( 1, &nGlyphIndex, aPos, nStart, &nAdvance ) ) + sal_GlyphId aGlyphId; + if( !rSalLayout.GetNextGlyphs( 1, &aGlyphId, aPos, nStart, &nAdvance ) ) break; // calculate the boundaries of each word - if( !rSalLayout.IsSpacingGlyph( nGlyphIndex ) ) + if( !rSalLayout.IsSpacingGlyph( aGlyphId ) ) { if( !nWidth ) { @@ -4351,14 +4351,14 @@ void OutputDevice::ImplDrawEmphasisMarks( SalLayout& rSalLayout ) Rectangle aRectangle; for( int nStart = 0;;) { - sal_GlyphId nGlyphIndex; - if( !rSalLayout.GetNextGlyphs( 1, &nGlyphIndex, aOutPoint, nStart ) ) + sal_GlyphId aGlyphId; + if( !rSalLayout.GetNextGlyphs( 1, &aGlyphId, aOutPoint, nStart ) ) break; - if( !mpGraphics->GetGlyphBoundRect( nGlyphIndex, aRectangle ) ) + if( !mpGraphics->GetGlyphBoundRect( aGlyphId, aRectangle ) ) continue; - if( !rSalLayout.IsSpacingGlyph( nGlyphIndex ) ) + if( !rSalLayout.IsSpacingGlyph( aGlyphId ) ) { Point aAdjPoint = aOffset; aAdjPoint.X() += aRectangle.Left() + (aRectangle.GetWidth() - nEmphasisWidth) / 2; diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index be7720e6d9f9..0b1b00cf6c99 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -2964,23 +2964,23 @@ std::map< sal_Int32, sal_Int32 > PDFWriterImpl::emitSystemFont( const PhysicalFo OUString aTmpName; osl_createTempFile( NULL, NULL, &aTmpName.pData ); - sal_Int32 pGlyphIDs[ 256 ]; + sal_GlyphId aGlyphIds[ 256 ]; sal_uInt8 pEncoding[ 256 ]; sal_Int32 pDuWidths[ 256 ]; - memset( pGlyphIDs, 0, sizeof( pGlyphIDs ) ); + memset( aGlyphIds, 0, sizeof( aGlyphIds ) ); memset( pEncoding, 0, sizeof( pEncoding ) ); memset( pDuWidths, 0, sizeof( pDuWidths ) ); for( sal_Ucs c = 32; c < 256; c++ ) { pEncoding[c] = c; - pGlyphIDs[c] = 0; + aGlyphIds[c] = 0; if( aUnicodeMap.find( c ) != aUnicodeMap.end() ) pWidths[ c ] = aGlyphWidths[ aUnicodeMap[ c ] ]; } - m_pReferenceDevice->mpGraphics->CreateFontSubset( aTmpName, pFont, pGlyphIDs, pEncoding, pDuWidths, 256, aInfo ); + m_pReferenceDevice->mpGraphics->CreateFontSubset( aTmpName, pFont, aGlyphIds, pEncoding, pDuWidths, 256, aInfo ); osl_removeFile( aTmpName.pData ); } else @@ -3852,7 +3852,7 @@ bool PDFWriterImpl::emitFonts() { for( FontEmitList::iterator lit = it->second.m_aSubsets.begin(); lit != it->second.m_aSubsets.end(); ++lit ) { - sal_Int32 pGlyphIDs[ 256 ]; + sal_GlyphId aGlyphIds[ 256 ]; sal_Int32 pWidths[ 256 ]; sal_uInt8 pEncoding[ 256 ]; sal_Int32 pEncToUnicodeIndex[ 256 ]; @@ -3863,7 +3863,7 @@ bool PDFWriterImpl::emitFonts() // fill arrays and prepare encoding index map sal_Int32 nToUnicodeStream = 0; - memset( pGlyphIDs, 0, sizeof( pGlyphIDs ) ); + memset( aGlyphIds, 0, sizeof( aGlyphIds ) ); memset( pEncoding, 0, sizeof( pEncoding ) ); memset( pUnicodesPerGlyph, 0, sizeof( pUnicodesPerGlyph ) ); memset( pEncToUnicodeIndex, 0, sizeof( pEncToUnicodeIndex ) ); @@ -3871,10 +3871,10 @@ bool PDFWriterImpl::emitFonts() { sal_uInt8 nEnc = fit->second.getGlyphId(); - DBG_ASSERT( pGlyphIDs[nEnc] == 0 && pEncoding[nEnc] == 0, "duplicate glyph" ); + DBG_ASSERT( aGlyphIds[nEnc] == 0 && pEncoding[nEnc] == 0, "duplicate glyph" ); DBG_ASSERT( nEnc <= lit->m_aMapping.size(), "invalid glyph encoding" ); - pGlyphIDs[ nEnc ] = fit->first; + aGlyphIds[ nEnc ] = fit->first; pEncoding[ nEnc ] = nEnc; pEncToUnicodeIndex[ nEnc ] = static_cast<sal_Int32>(aUnicodes.size()); pUnicodesPerGlyph[ nEnc ] = fit->second.countCodes(); @@ -3890,7 +3890,7 @@ bool PDFWriterImpl::emitFonts() } } FontSubsetInfo aSubsetInfo; - if( m_pReferenceDevice->mpGraphics->CreateFontSubset( aTmpName, it->first, pGlyphIDs, pEncoding, pWidths, nGlyphs, aSubsetInfo ) ) + if( m_pReferenceDevice->mpGraphics->CreateFontSubset( aTmpName, it->first, aGlyphIds, pEncoding, pWidths, nGlyphs, aSubsetInfo ) ) { // create font stream oslFileHandle aFontFile; @@ -7665,11 +7665,11 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const OUString& rText, bool sal_Int32 nWidth = 0, nAdvance=0; for( int nStart = 0;;) { - sal_GlyphId nGlyphIndex; - if( !rLayout.GetNextGlyphs( 1, &nGlyphIndex, aPos, nStart, &nAdvance ) ) + sal_GlyphId aGlyphId; + if( !rLayout.GetNextGlyphs( 1, &aGlyphId, aPos, nStart, &nAdvance ) ) break; - if( !rLayout.IsSpacingGlyph( nGlyphIndex ) ) + if( !rLayout.IsSpacingGlyph( aGlyphId ) ) { if( !nWidth ) aStartPt = aPos; @@ -7764,12 +7764,12 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const OUString& rText, bool for( int nStart = 0;;) { Point aPos; - sal_GlyphId nGlyphIndex; + sal_GlyphId aGlyphId; sal_Int32 nAdvance; - if( !rLayout.GetNextGlyphs( 1, &nGlyphIndex, aPos, nStart, &nAdvance ) ) + if( !rLayout.GetNextGlyphs( 1, &aGlyphId, aPos, nStart, &nAdvance ) ) break; - if( !rLayout.IsSpacingGlyph( nGlyphIndex ) ) + if( !rLayout.IsSpacingGlyph( aGlyphId ) ) { Point aAdjOffset = aOffset; aAdjOffset.X() += (nAdvance - nEmphWidth) / 2; diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx index 8f5d5a1d2fe9..51a79f15dd1d 100644 --- a/vcl/source/gdi/sallayout.cxx +++ b/vcl/source/gdi/sallayout.cxx @@ -1283,7 +1283,7 @@ void GenericSalLayout::KashidaJustify( long nKashidaIndex, int nKashidaWidth ) if( !pG->IsRTLGlyph() ) continue; // no kashida-injection for blank justified expansion either - if( IsSpacingGlyph( pG->mnGlyphIndex ) ) + if( IsSpacingGlyph( pG->maGlyphId) ) continue; // calculate gap, ignore if too small @@ -1401,12 +1401,12 @@ int GenericSalLayout::GetNextGlyphs( int nLen, sal_GlyphId* pGlyphs, Point& rPos // find more glyphs which can be merged into one drawing instruction int nCount = 0; long nYPos = pG->maLinearPos.Y(); - long nOldFlags = pG->mnGlyphIndex; + long nOldFlags = pG->maGlyphId; for(;;) { // update return data with glyph info ++nCount; - *(pGlyphs++) = pG->mnGlyphIndex; + *(pGlyphs++) = pG->maGlyphId; if( pCharPosAry ) *(pCharPosAry++) = pG->mnCharPos; if( pGlyphAdvAry ) @@ -1445,10 +1445,10 @@ int GenericSalLayout::GetNextGlyphs( int nLen, sal_GlyphId* pGlyphs, Point& rPos break; // stop when glyph flags change - if( (nOldFlags ^ pG->mnGlyphIndex) & GF_FLAGMASK ) + if( (nOldFlags ^ pG->maGlyphId) & GF_FLAGMASK ) break; - nOldFlags = pG->mnGlyphIndex; // &GF_FLAGMASK not needed for test above + nOldFlags = pG->maGlyphId; // &GF_FLAGMASK not needed for test above } aRelativePos.X() /= mnUnitsPerPixel; @@ -1494,7 +1494,7 @@ void GenericSalLayout::DropGlyph( int nStart ) GlyphVector::iterator pG = m_GlyphItems.begin(); pG += nStart; - pG->mnGlyphIndex = GF_DROPPED; + pG->maGlyphId = GF_DROPPED; pG->mnCharPos = -1; } @@ -1508,7 +1508,7 @@ void GenericSalLayout::Simplify( bool bIsBase ) size_t j = 0; for(size_t i = 0; i < m_GlyphItems.size(); i++ ) { - if( m_GlyphItems[i].mnGlyphIndex == nDropMarker ) + if( m_GlyphItems[i].maGlyphId == nDropMarker ) continue; if( i != j ) diff --git a/vcl/source/glyphs/graphite_layout.cxx b/vcl/source/glyphs/graphite_layout.cxx index 0231bb45ea88..89b6feef1b90 100644 --- a/vcl/source/glyphs/graphite_layout.cxx +++ b/vcl/source/glyphs/graphite_layout.cxx @@ -745,7 +745,7 @@ long GraphiteLayout::FillDXArray( sal_Int32* pDXArray ) const assert( (mvChar2BaseGlyph[i] == -1) || ((signed)(mvChar2BaseGlyph[i]) < (signed)mvGlyphs.size())); if (mvChar2BaseGlyph[i] != -1 && - mvGlyphs[mvChar2BaseGlyph[i]].mnGlyphIndex == GF_DROPPED) + mvGlyphs[mvChar2BaseGlyph[i]].maGlyphId == GF_DROPPED) { // when used in MultiSalLayout::GetTextBreak dropped glyphs // must have zero width @@ -975,7 +975,7 @@ void GraphiteLayout::ApplyDXArray(ImplLayoutArgs &args, std::vector<int> & rDelt #endif assert((nLastGlyph > -1) && (nLastGlyph < (signed)mvGlyphs.size())); mvGlyphs[nLastGlyph].mnNewWidth += nDWidth; - if (gi.mnGlyphIndex != GF_DROPPED) + if (gi.maGlyphId != GF_DROPPED) mvGlyphs[nLastGlyph].mnNewWidth += nDWidth; else nDGlyphOrigin += nDWidth; @@ -1040,7 +1040,7 @@ void GraphiteLayout::kashidaJustify(std::vector<int>& rDeltaWidths, sal_GlyphId continue; } // no kashida-injection for blank justified expansion either - if( IsSpacingGlyph( (*i).mnGlyphIndex ) ) + if( IsSpacingGlyph( (*i).maGlyphId ) ) { ++i; continue; @@ -1055,7 +1055,7 @@ void GraphiteLayout::kashidaJustify(std::vector<int>& rDeltaWidths, sal_GlyphId } nKashidaCount = 1 + (nGapWidth / nKashidaWidth); #ifdef GRLAYOUT_DEBUG - printf("inserting %d kashidas at %u\n", nKashidaCount, (*i).mnGlyphIndex); + printf("inserting %d kashidas at %u\n", nKashidaCount, (*i).maGlyphId); #endif GlyphItem glyphItem = *i; Point aPos(0, 0); @@ -1110,7 +1110,7 @@ void GraphiteLayout::GetCaretPositions( int nArraySize, sal_Int32* pCaretXArray int nChar2Base = mvChar2BaseGlyph[nCharSlot]; assert((nChar2Base > -1) && (nChar2Base < (signed)mvGlyphs.size())); GlyphItem gi = mvGlyphs[nChar2Base]; - if (gi.mnGlyphIndex == GF_DROPPED) + if (gi.maGlyphId == GF_DROPPED) { continue; } @@ -1224,7 +1224,7 @@ int GraphiteLayout::GetNextGlyphs( int length, sal_GlyphId * glyph_out, assert(glyph_slot >= 0); // Find the first glyph in the substring. for (; glyph_slot < signed(mvGlyphs.size()) && - ((mvGlyphs.begin() + glyph_slot)->mnGlyphIndex == GF_DROPPED); + ((mvGlyphs.begin() + glyph_slot)->maGlyphId == GF_DROPPED); ++glyph_slot) {}; // Update the length @@ -1266,7 +1266,7 @@ int GraphiteLayout::GetNextGlyphs( int length, sal_GlyphId * glyph_out, } // Copy out this glyphs data. ++glyph_slot; - *glyph_out++ = glyph_itr->mnGlyphIndex; + *glyph_out++ = glyph_itr->maGlyphId; // Find the actual advance - this must be correct if called from // MultiSalLayout::AdjustLayout which requests one glyph at a time. @@ -1296,13 +1296,13 @@ int GraphiteLayout::GetNextGlyphs( int length, sal_GlyphId * glyph_out, break; // Stop if glyph dropped - if (glyph_itr->mnGlyphIndex == GF_DROPPED) + if (glyph_itr->maGlyphId == GF_DROPPED) break; } int numGlyphs = glyph_slot - glyph_slot_begin; // move the next glyph_slot to a glyph that hasn't been dropped while (glyph_slot < static_cast<int>(mvGlyphs.size()) && - (mvGlyphs.begin() + glyph_slot)->mnGlyphIndex == GF_DROPPED) + (mvGlyphs.begin() + glyph_slot)->maGlyphId == GF_DROPPED) ++glyph_slot; return numGlyphs; } @@ -1313,7 +1313,7 @@ void GraphiteLayout::MoveGlyph( int nGlyphIndex, long nNewPos ) // needs to be done carefully so the glyph/char maps are maintained // If a glyph has been dropped then it wasn't returned by GetNextGlyphs, so // the index here may be wrong - while ((mvGlyphs[nGlyphIndex].mnGlyphIndex == GF_DROPPED) && + while ((mvGlyphs[nGlyphIndex].maGlyphId == GF_DROPPED) && (nGlyphIndex < (signed)mvGlyphs.size())) { nGlyphIndex++; @@ -1339,7 +1339,7 @@ void GraphiteLayout::DropGlyph( int nGlyphIndex ) return; GlyphItem & glyph = mvGlyphs[nGlyphIndex]; - glyph.mnGlyphIndex = GF_DROPPED; + glyph.maGlyphId = GF_DROPPED; #ifdef GRLAYOUT_DEBUG fprintf(grLog(),"Dropped %d\n", nGlyphIndex); #endif @@ -1355,7 +1355,7 @@ void GraphiteLayout::Simplify( bool isBaseLayout ) long deltaX = 0; while (gi != mvGlyphs.end()) { - if (gi->mnGlyphIndex == dropMarker) + if (gi->maGlyphId == dropMarker) { deltaX += gi->mnNewWidth; gi->mnNewWidth = 0; diff --git a/vcl/unx/generic/gdi/salgdi3.cxx b/vcl/unx/generic/gdi/salgdi3.cxx index 8362c883fc7d..e150ebca23d6 100644 --- a/vcl/unx/generic/gdi/salgdi3.cxx +++ b/vcl/unx/generic/gdi/salgdi3.cxx @@ -615,18 +615,18 @@ X11SalGraphics::GetFontMetric( ImplFontMetricData *pMetric, int nFallbackLevel ) // --------------------------------------------------------------------------- -sal_Bool X11SalGraphics::GetGlyphBoundRect( sal_GlyphId nGlyphIndex, Rectangle& rRect ) +bool X11SalGraphics::GetGlyphBoundRect( sal_GlyphId aGlyphId, Rectangle& rRect ) { - int nLevel = nGlyphIndex >> GF_FONTSHIFT; + const int nLevel = aGlyphId >> GF_FONTSHIFT; if( nLevel >= MAX_FALLBACK ) - return sal_False; + return false; ServerFont* pSF = mpServerFont[ nLevel ]; if( !pSF ) - return sal_False; + return false; - nGlyphIndex &= GF_IDXMASK; - const GlyphMetric& rGM = pSF->GetGlyphMetric( nGlyphIndex ); + aGlyphId &= GF_IDXMASK; + const GlyphMetric& rGM = pSF->GetGlyphMetric(aGlyphId); Rectangle aRect( rGM.GetOffset(), rGM.GetSize() ); if ( pSF->mnCos != 0x10000 && pSF->mnSin != 0 ) @@ -642,27 +642,27 @@ sal_Bool X11SalGraphics::GetGlyphBoundRect( sal_GlyphId nGlyphIndex, Rectangle& else rRect = aRect; - return sal_True; + return true; } // --------------------------------------------------------------------------- -sal_Bool X11SalGraphics::GetGlyphOutline( sal_GlyphId nGlyphIndex, +bool X11SalGraphics::GetGlyphOutline( sal_GlyphId aGlyphId, ::basegfx::B2DPolyPolygon& rPolyPoly ) { - int nLevel = nGlyphIndex >> GF_FONTSHIFT; + const int nLevel = aGlyphId >> GF_FONTSHIFT; if( nLevel >= MAX_FALLBACK ) - return sal_False; + return false; ServerFont* pSF = mpServerFont[ nLevel ]; if( !pSF ) - return sal_False; + return false; - nGlyphIndex &= GF_IDXMASK; - if( pSF->GetGlyphOutline( nGlyphIndex, rPolyPoly ) ) - return sal_True; + aGlyphId &= GF_IDXMASK; + if( pSF->GetGlyphOutline( aGlyphId, rPolyPoly ) ) + return true; - return sal_False; + return false; } //-------------------------------------------------------------------------- @@ -719,7 +719,7 @@ SystemFontData X11SalGraphics::GetSysFontData( int nFallbacklevel ) const sal_Bool X11SalGraphics::CreateFontSubset( const OUString& rToFile, const PhysicalFontFace* pFont, - sal_Int32* pGlyphIDs, + sal_GlyphId* pGlyphIds, sal_uInt8* pEncoding, sal_Int32* pWidths, int nGlyphCount, @@ -737,7 +737,7 @@ sal_Bool X11SalGraphics::CreateFontSubset( bool bSuccess = rMgr.createFontSubset( rInfo, aFont, rToFile, - pGlyphIDs, + pGlyphIds, pEncoding, pWidths, nGlyphCount ); diff --git a/vcl/unx/generic/gdi/xrender_peer.hxx b/vcl/unx/generic/gdi/xrender_peer.hxx index 6695fc9e59d1..3ea71a3af5e9 100644 --- a/vcl/unx/generic/gdi/xrender_peer.hxx +++ b/vcl/unx/generic/gdi/xrender_peer.hxx @@ -28,6 +28,8 @@ struct _XTrap; // on some older systems this is not declared within Xrender.h #include <vcl/salgtype.hxx> #include <osl/module.h> +typedef Glyph XRenderGlyph; + class XRenderPeer { public: @@ -60,9 +62,9 @@ public: GlyphSet CreateGlyphSet() const; void FreeGlyphSet( GlyphSet ) const; - void AddGlyph( GlyphSet, Glyph nGlyphId, const XGlyphInfo&, + void AddGlyph( GlyphSet, XRenderGlyph nXRGlyph, const XGlyphInfo&, const char* pBuffer, int nBufSize ) const; - void FreeGlyph( GlyphSet, Glyph nGlyphId ) const; + void FreeGlyph( GlyphSet, XRenderGlyph nXRGlyphId ) const; void CompositeString32( Picture aSrc, Picture aDst, GlyphSet, int nDstX, int nDstY, const unsigned* pText, int nTextLen ) const; void FillRectangle( int nOp, Picture aDst, const XRenderColor*, @@ -141,16 +143,16 @@ inline void XRenderPeer::FreeGlyphSet( GlyphSet aGS ) const XRenderFreeGlyphSet( mpDisplay, aGS ); } -inline void XRenderPeer::AddGlyph( GlyphSet aGS, Glyph nGlyphId, +inline void XRenderPeer::AddGlyph( GlyphSet aGS, XRenderGlyph nXRGlyph, const XGlyphInfo& rGI, const char* pBuffer, int nBufSize ) const { - XRenderAddGlyphs( mpDisplay, aGS, &nGlyphId, &rGI, 1, + XRenderAddGlyphs( mpDisplay, aGS, &nXRGlyph, &rGI, 1, const_cast<char*>(pBuffer), nBufSize ); } -inline void XRenderPeer::FreeGlyph( GlyphSet aGS, Glyph nGlyphId ) const +inline void XRenderPeer::FreeGlyph( GlyphSet aGS, XRenderGlyph nXRGlyph ) const { - (void)aGS; (void)nGlyphId; + (void)aGS; (void)nXRGlyph; // XRenderFreeGlyphs not implemented yet for version<=0.2 // #108209# disabled because of crash potential, diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx index 7669b241d61a..07def604c0d3 100644 --- a/vcl/win/source/gdi/salgdi3.cxx +++ b/vcl/win/source/gdi/salgdi3.cxx @@ -2258,7 +2258,7 @@ void WinSalGraphics::ClearDevFontCache() // ----------------------------------------------------------------------- -sal_Bool WinSalGraphics::GetGlyphBoundRect( sal_GlyphId nIndex, Rectangle& rRect ) +bool WinSalGraphics::GetGlyphBoundRect( sal_GlyphId aGlyphId, Rectangle& rRect ) { HDC hDC = getHDC(); @@ -2268,14 +2268,14 @@ sal_Bool WinSalGraphics::GetGlyphBoundRect( sal_GlyphId nIndex, Rectangle& rRect aMat.eM12 = aMat.eM21 = FixedFromDouble( 0.0 ); UINT nGGOFlags = GGO_METRICS; - if( !(nIndex & GF_ISCHAR) ) + if( !(aGlyphId & GF_ISCHAR) ) nGGOFlags |= GGO_GLYPH_INDEX; - nIndex &= GF_IDXMASK; + aGlyphId &= GF_IDXMASK; GLYPHMETRICS aGM; aGM.gmptGlyphOrigin.x = aGM.gmptGlyphOrigin.y = 0; aGM.gmBlackBoxX = aGM.gmBlackBoxY = 0; - DWORD nSize = ::GetGlyphOutlineW( hDC, nIndex, nGGOFlags, &aGM, 0, NULL, &aMat ); + DWORD nSize = ::GetGlyphOutlineW( hDC, aGlyphId, nGGOFlags, &aGM, 0, NULL, &aMat ); if( nSize == GDI_ERROR ) return false; @@ -2290,7 +2290,7 @@ sal_Bool WinSalGraphics::GetGlyphBoundRect( sal_GlyphId nIndex, Rectangle& rRect // ----------------------------------------------------------------------- -sal_Bool WinSalGraphics::GetGlyphOutline( sal_GlyphId nIndex, +bool WinSalGraphics::GetGlyphOutline( sal_GlyphId aGlyphId, ::basegfx::B2DPolyPolygon& rB2DPolyPoly ) { rB2DPolyPoly.clear(); @@ -2303,23 +2303,23 @@ sal_Bool WinSalGraphics::GetGlyphOutline( sal_GlyphId nIndex, aMat.eM12 = aMat.eM21 = FixedFromDouble( 0.0 ); UINT nGGOFlags = GGO_NATIVE; - if( !(nIndex & GF_ISCHAR) ) + if( !(aGlyphId & GF_ISCHAR) ) nGGOFlags |= GGO_GLYPH_INDEX; - nIndex &= GF_IDXMASK; + aGlyphId &= GF_IDXMASK; GLYPHMETRICS aGlyphMetrics; - const DWORD nSize1 = ::GetGlyphOutlineW( hDC, nIndex, nGGOFlags, &aGlyphMetrics, 0, NULL, &aMat ); + const DWORD nSize1 = ::GetGlyphOutlineW( hDC, aGlyphId, nGGOFlags, &aGlyphMetrics, 0, NULL, &aMat ); if( !nSize1 ) // blank glyphs are ok - return TRUE; + return true; else if( nSize1 == GDI_ERROR ) - return FALSE; + return false; - BYTE* pData = new BYTE[ nSize1 ]; - const DWORD nSize2 = ::GetGlyphOutlineW( hDC, nIndex, nGGOFlags, + BYTE* pData = new BYTE[ nSize1 ]; + const DWORD nSize2 = ::GetGlyphOutlineW( hDC, aGlyphId, nGGOFlags, &aGlyphMetrics, nSize1, pData, &aMat ); if( nSize1 != nSize2 ) - return FALSE; + return false; // TODO: avoid tools polygon by creating B2DPolygon directly int nPtSize = 512; @@ -2469,7 +2469,7 @@ sal_Bool WinSalGraphics::GetGlyphOutline( sal_GlyphId nIndex, rB2DPolyPoly.transform(basegfx::tools::createScaleB2DHomMatrix(fFactor, fFactor)); } - return TRUE; + return true; } // ----------------------------------------------------------------------- @@ -2533,7 +2533,7 @@ int ScopedTrueTypeFont::open(void * pBuffer, sal_uInt32 nLen, } sal_Bool WinSalGraphics::CreateFontSubset( const OUString& rToFile, - const PhysicalFontFace* pFont, long* pGlyphIDs, sal_uInt8* pEncoding, + const PhysicalFontFace* pFont, sal_GlyphId* pGlyphIDs, sal_uInt8* pEncoding, sal_Int32* pGlyphWidths, int nGlyphCount, FontSubsetInfo& rInfo ) { // TODO: use more of the central font-subsetting code, move stuff there if needed @@ -2576,18 +2576,18 @@ sal_Bool WinSalGraphics::CreateFontSubset( const OUString& rToFile, const ImplFontCharMap* pCharMap = pWinFontData->GetImplFontCharMap(); pCharMap->AddReference(); - long nRealGlyphIds[ 256 ]; + sal_GlyphId aRealGlyphIds[ 256 ]; for( int i = 0; i < nGlyphCount; ++i ) { // TODO: remap notdef glyph if needed // TODO: use GDI's GetGlyphIndices instead? Does it handle GSUB properly? - sal_uInt32 nGlyphIdx = pGlyphIDs[i] & GF_IDXMASK; - if( pGlyphIDs[i] & GF_ISCHAR ) // remaining pseudo-glyphs need to be translated - nGlyphIdx = pCharMap->GetGlyphIndex( nGlyphIdx ); - if( (pGlyphIDs[i] & (GF_ROTMASK|GF_GSUB)) != 0) // TODO: vertical substitution + sal_GlyphId aGlyphId = pGlyphIds[i] & GF_IDXMASK; + if( pGlyphIds[i] & GF_ISCHAR ) // remaining pseudo-glyphs need to be translated + aGlyphId = pCharMap->GetGlyphIndex( aGlyphId ); + if( (pGlyphIds[i] & (GF_ROTMASK|GF_GSUB)) != 0) // TODO: vertical substitution {/*####*/} - nRealGlyphIds[i] = nGlyphIdx; + aRealGlyphIds[i] = aGlyphId; } pCharMap->DeReference(); // TODO: and and use a RAII object @@ -2596,7 +2596,7 @@ sal_Bool WinSalGraphics::CreateFontSubset( const OUString& rToFile, FILE* pOutFile = fopen( aToFile.getStr(), "wb" ); rInfo.LoadFont( FontSubsetInfo::CFF_FONT, aRawCffData.get(), aRawCffData.size() ); bool bRC = rInfo.CreateFontSubset( FontSubsetInfo::TYPE1_PFB, pOutFile, NULL, - nRealGlyphIds, pEncoding, nGlyphCount, pGlyphWidths ); + aRealGlyphIds, pEncoding, nGlyphCount, pGlyphWidths ); fclose( pOutFile ); return bRC; } @@ -2636,21 +2636,21 @@ sal_Bool WinSalGraphics::CreateFontSubset( const OUString& rToFile, for( i = 0; i < nGlyphCount; ++i ) { aTempEncs[i] = pEncoding[i]; - sal_uInt32 nGlyphIdx = pGlyphIDs[i] & GF_IDXMASK; - if( pGlyphIDs[i] & GF_ISCHAR ) + sal_GlyphId aGlyphId = pGlyphIds[i] & GF_IDXMASK; + if( pGlyphIds[i] & GF_ISCHAR ) { - sal_Unicode cChar = static_cast<sal_Unicode>(nGlyphIdx); // TODO: sal_UCS4 - const bool bVertical = ((pGlyphIDs[i] & (GF_ROTMASK|GF_GSUB)) != 0); - nGlyphIdx = ::MapChar( aSftTTF.get(), cChar, bVertical ); - if( (nGlyphIdx == 0) && pFont->IsSymbolFont() ) + sal_Unicode cChar = static_cast<sal_Unicode>(aGlyphId); // TODO: sal_UCS4 + const bool bVertical = ((pGlyphIds[i] & (GF_ROTMASK|GF_GSUB)) != 0); + aGlyphId = ::MapChar( aSftTTF.get(), cChar, bVertical ); + if( (aGlyphId == 0) && pFont->IsSymbolFont() ) { // #i12824# emulate symbol aliasing U+FXXX <-> U+0XXX cChar = (cChar & 0xF000) ? (cChar & 0x00FF) : (cChar | 0xF000); - nGlyphIdx = ::MapChar( aSftTTF.get(), cChar, bVertical ); + aGlyphId = ::MapChar( aSftTTF.get(), cChar, bVertical ); } } - aShortIDs[i] = static_cast<sal_uInt16>( nGlyphIdx ); - if( !nGlyphIdx ) + aShortIDs[i] = static_cast<sal_uInt16>( aGlyphId ); + if( !aGlyphId ) if( nNotDef < 0 ) nNotDef = i; // first NotDef glyph found } diff --git a/vcl/win/source/gdi/winlayout.cxx b/vcl/win/source/gdi/winlayout.cxx index e53dafffc562..b6bb33490d49 100644 --- a/vcl/win/source/gdi/winlayout.cxx +++ b/vcl/win/source/gdi/winlayout.cxx @@ -532,7 +532,7 @@ bool SimpleWinLayout::LayoutText( ImplLayoutArgs& rArgs ) // ----------------------------------------------------------------------- -int SimpleWinLayout::GetNextGlyphs( int nLen, sal_GlyphId* pGlyphs, Point& rPos, int& nStart, +int SimpleWinLayout::GetNextGlyphs( int nLen, sal_GlyphId* pGlyphIds, Point& rPos, int& nStart, long* pGlyphAdvances, int* pCharIndexes, const PhysicalFontFace** /*pFallbackFonts*/ ) const { @@ -553,27 +553,27 @@ int SimpleWinLayout::GetNextGlyphs( int nLen, sal_GlyphId* pGlyphs, Point& rPos, int nCount = 0; while( nCount < nLen ) { - // update return values {nGlyphIndex,nCharPos,nGlyphAdvance} - sal_GlyphId nGlyphIndex = mpOutGlyphs[ nStart ]; + // update return values {aGlyphId,nCharPos,nGlyphAdvance} + sal_GlyphId aGlyphId = mpOutGlyphs[ nStart ]; if( mbDisableGlyphs ) { if( mnLayoutFlags & SAL_LAYOUT_VERTICAL ) { - const sal_UCS4 cChar = static_cast<sal_UCS4>(nGlyphIndex & GF_IDXMASK); + const sal_UCS4 cChar = static_cast<sal_UCS4>(aGlyphId & GF_IDXMASK); if( mrWinFontData.HasGSUBstitutions( mhDC ) && mrWinFontData.IsGSUBstituted( cChar ) ) - nGlyphIndex |= GF_GSUB | GF_ROTL; + aGlyphId |= GF_GSUB | GF_ROTL; else { - nGlyphIndex |= GetVerticalFlags( cChar ); - if( (nGlyphIndex & GF_ROTMASK) == 0 ) - nGlyphIndex |= GF_VERT; + aGlyphId |= GetVerticalFlags( cChar ); + if( (aGlyphId & GF_ROTMASK) == 0 ) + aGlyphId |= GF_VERT; } } - nGlyphIndex |= GF_ISCHAR; + aGlyphId |= GF_ISCHAR; } ++nCount; - *(pGlyphs++) = nGlyphIndex; + *(pGlyphIds++) = aGlyphId; if( pGlyphAdvances ) *(pGlyphAdvances++) = mpGlyphAdvances[ nStart ]; if( pCharIndexes ) |