salgdi3.cxx (b4fbd7a9) salgdi3.cxx (248a599f)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 624 unchanged lines hidden (view full) ---

633
634 // #i51924# avoid 32->16bit coordinate truncation problem in X11
635 // TODO: reevaluate once displays with >30000 pixels are available
636 if( aPos.X() >= 30000 || aPos.Y() >= 30000 )
637 continue;
638
639 unsigned int aRenderAry[ MAXGLYPHS ];
640 for( int i = 0; i < nGlyphs; ++i )
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 624 unchanged lines hidden (view full) ---

633
634 // #i51924# avoid 32->16bit coordinate truncation problem in X11
635 // TODO: reevaluate once displays with >30000 pixels are available
636 if( aPos.X() >= 30000 || aPos.Y() >= 30000 )
637 continue;
638
639 unsigned int aRenderAry[ MAXGLYPHS ];
640 for( int i = 0; i < nGlyphs; ++i )
641 aRenderAry[ i ] = rGlyphPeer.GetGlyphId( rFont, aGlyphAry[i] );
641 aRenderAry[ i ] = rGlyphPeer.GetXRGlyph( rFont, aGlyphAry[i] );
642 rRenderPeer.CompositeString32( rEntry.m_aPicture, aDstPic,
643 aGlyphSet, aPos.X(), aPos.Y(), aRenderAry, nGlyphs );
644 }
645}
646
647//--------------------------------------------------------------------------
648
649bool X11SalGraphics::DrawServerAAForcedString( const ServerFontLayout& rLayout )

--- 576 unchanged lines hidden (view full) ---

1226 return nGotPairs;
1227 }
1228 }
1229 return 0;
1230}
1231
1232// ---------------------------------------------------------------------------
1233
642 rRenderPeer.CompositeString32( rEntry.m_aPicture, aDstPic,
643 aGlyphSet, aPos.X(), aPos.Y(), aRenderAry, nGlyphs );
644 }
645}
646
647//--------------------------------------------------------------------------
648
649bool X11SalGraphics::DrawServerAAForcedString( const ServerFontLayout& rLayout )

--- 576 unchanged lines hidden (view full) ---

1226 return nGotPairs;
1227 }
1228 }
1229 return 0;
1230}
1231
1232// ---------------------------------------------------------------------------
1233
1234sal_Bool X11SalGraphics::GetGlyphBoundRect( long nGlyphIndex, Rectangle& rRect )
1234bool X11SalGraphics::GetGlyphBoundRect( sal_GlyphId aGlyphId, Rectangle& rRect )
1235{
1235{
1236 int nLevel = nGlyphIndex >> GF_FONTSHIFT;
1236 const int nLevel = aGlyphId >> GF_FONTSHIFT;
1237 if( nLevel >= MAX_FALLBACK )
1237 if( nLevel >= MAX_FALLBACK )
1238 return sal_False;
1238 return false;
1239
1240 ServerFont* pSF = mpServerFont[ nLevel ];
1241 if( !pSF )
1239
1240 ServerFont* pSF = mpServerFont[ nLevel ];
1241 if( !pSF )
1242 return sal_False;
1242 return false;
1243
1243
1244 nGlyphIndex &= ~GF_FONTMASK;
1245 const GlyphMetric& rGM = pSF->GetGlyphMetric( nGlyphIndex );
1244 aGlyphId &= ~GF_FONTMASK;
1245 const GlyphMetric& rGM = pSF->GetGlyphMetric( aGlyphId );
1246 rRect = Rectangle( rGM.GetOffset(), rGM.GetSize() );
1246 rRect = Rectangle( rGM.GetOffset(), rGM.GetSize() );
1247 return sal_True;
1247 return true;
1248}
1249
1250// ---------------------------------------------------------------------------
1251
1248}
1249
1250// ---------------------------------------------------------------------------
1251
1252sal_Bool X11SalGraphics::GetGlyphOutline( long nGlyphIndex,
1252bool X11SalGraphics::GetGlyphOutline( sal_GlyphId aGlyphId,
1253 ::basegfx::B2DPolyPolygon& rPolyPoly )
1254{
1253 ::basegfx::B2DPolyPolygon& rPolyPoly )
1254{
1255 int nLevel = nGlyphIndex >> GF_FONTSHIFT;
1255 const int nLevel = aGlyphId >> GF_FONTSHIFT;
1256 if( nLevel >= MAX_FALLBACK )
1256 if( nLevel >= MAX_FALLBACK )
1257 return sal_False;
1257 return false;
1258
1259 ServerFont* pSF = mpServerFont[ nLevel ];
1260 if( !pSF )
1258
1259 ServerFont* pSF = mpServerFont[ nLevel ];
1260 if( !pSF )
1261 return sal_False;
1261 return false;
1262
1262
1263 nGlyphIndex &= ~GF_FONTMASK;
1264 if( pSF->GetGlyphOutline( nGlyphIndex, rPolyPoly ) )
1265 return sal_True;
1266
1267 return sal_False;
1263 aGlyphId &= ~GF_FONTMASK;
1264 bool bOK = pSF->GetGlyphOutline( aGlyphId, rPolyPoly );
1265 return bOK;
1268}
1269
1270//--------------------------------------------------------------------------
1271
1272SalLayout* X11SalGraphics::GetTextLayout( ImplLayoutArgs& rArgs, int nFallbackLevel )
1273{
1274 SalLayout* pLayout = NULL;
1275

--- 47 unchanged lines hidden (view full) ---

1323 return aSysFontData;
1324}
1325
1326//--------------------------------------------------------------------------
1327
1328sal_Bool X11SalGraphics::CreateFontSubset(
1329 const rtl::OUString& rToFile,
1330 const ImplFontData* pFont,
1266}
1267
1268//--------------------------------------------------------------------------
1269
1270SalLayout* X11SalGraphics::GetTextLayout( ImplLayoutArgs& rArgs, int nFallbackLevel )
1271{
1272 SalLayout* pLayout = NULL;
1273

--- 47 unchanged lines hidden (view full) ---

1321 return aSysFontData;
1322}
1323
1324//--------------------------------------------------------------------------
1325
1326sal_Bool X11SalGraphics::CreateFontSubset(
1327 const rtl::OUString& rToFile,
1328 const ImplFontData* pFont,
1331 sal_Int32* pGlyphIDs,
1329 sal_GlyphId* pGlyphIds,
1332 sal_uInt8* pEncoding,
1333 sal_Int32* pWidths,
1334 int nGlyphCount,
1335 FontSubsetInfo& rInfo
1336 )
1337{
1338 // in this context the pFont->GetFontId() is a valid PSP
1339 // font since they are the only ones left after the PDF
1340 // export has filtered its list of subsettable fonts (for
1341 // which this method was created). The correct way would
1342 // be to have the GlyphCache search for the ImplFontData pFont
1343 psp::fontID aFont = pFont->GetFontId();
1344
1345 psp::PrintFontManager& rMgr = psp::PrintFontManager::get();
1346 bool bSuccess = rMgr.createFontSubset( rInfo,
1347 aFont,
1348 rToFile,
1330 sal_uInt8* pEncoding,
1331 sal_Int32* pWidths,
1332 int nGlyphCount,
1333 FontSubsetInfo& rInfo
1334 )
1335{
1336 // in this context the pFont->GetFontId() is a valid PSP
1337 // font since they are the only ones left after the PDF
1338 // export has filtered its list of subsettable fonts (for
1339 // which this method was created). The correct way would
1340 // be to have the GlyphCache search for the ImplFontData pFont
1341 psp::fontID aFont = pFont->GetFontId();
1342
1343 psp::PrintFontManager& rMgr = psp::PrintFontManager::get();
1344 bool bSuccess = rMgr.createFontSubset( rInfo,
1345 aFont,
1346 rToFile,
1349 pGlyphIDs,
1347 pGlyphIds,
1350 pEncoding,
1351 pWidths,
1352 nGlyphCount );
1353 return bSuccess;
1354}
1355
1356//--------------------------------------------------------------------------
1357

--- 324 unchanged lines hidden ---
1348 pEncoding,
1349 pWidths,
1350 nGlyphCount );
1351 return bSuccess;
1352}
1353
1354//--------------------------------------------------------------------------
1355

--- 324 unchanged lines hidden ---