diff options
author | Herbert Duerr <hdu@openoffice.org> | 2002-09-12 07:00:24 +0000 |
---|---|---|
committer | Herbert Duerr <hdu@openoffice.org> | 2002-09-12 07:00:24 +0000 |
commit | 25861afe2f3c1e40c2fe7ab684e672cc48b3cafe (patch) | |
tree | 6b8a2ba776ed0e9cf33f0060d7d226ff179744c0 /vcl/unx | |
parent | 91acf390f3614032d97dffab47397b0d6468fbfe (diff) |
#103183# fix GetGlyphBoundRect() on UNX, small MAC patch
Diffstat (limited to 'vcl/unx')
-rw-r--r-- | vcl/unx/source/gdi/salgdi3.cxx | 108 |
1 files changed, 8 insertions, 100 deletions
diff --git a/vcl/unx/source/gdi/salgdi3.cxx b/vcl/unx/source/gdi/salgdi3.cxx index baddb6bec8b4..37827ea28099 100644 --- a/vcl/unx/source/gdi/salgdi3.cxx +++ b/vcl/unx/source/gdi/salgdi3.cxx @@ -2,9 +2,9 @@ * * $RCSfile: salgdi3.cxx,v $ * - * $Revision: 1.91 $ + * $Revision: 1.92 $ * - * last change: $Author: hdu $ $Date: 2002-09-06 15:06:02 $ + * last change: $Author: hdu $ $Date: 2002-09-12 08:00:24 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -1810,7 +1810,11 @@ SalGraphics::GetDevFontList( ImplDevFontList *pList ) #ifdef USE_BUILTIN_RASTERIZER aX11GlyphPeer.SetDisplay( maGraphicsData.GetXDisplay(), maGraphicsData.GetDisplay()->GetVisual()->GetVisual() ); +#ifdef MACOSX + GlyphCache::EnsureInstance( aX11GlyphPeer, true ); +#else GlyphCache::EnsureInstance( aX11GlyphPeer, false ); +#endif GlyphCache& rGC = GlyphCache::GetInstance(); const psp::PrintFontManager& rMgr = psp::PrintFontManager::get(); @@ -2096,24 +2100,14 @@ ULONG SalGraphics::GetFontCodeRanges( sal_uInt32* pCodePairs ) const // --------------------------------------------------------------------------- -#ifdef ENABLE_CTL -BOOL SalGraphics::GetGlyphBoundRect( long nGlyphIndex, bool bIsGlyphIndex, Rectangle& rRect, const OutputDevice* ) +BOOL SalGraphics::GetGlyphBoundRect( long nGlyphIndex, bool /*bIsGlyphIndex*/, Rectangle& rRect, const OutputDevice* ) { #ifdef USE_BUILTIN_RASTERIZER if( maGraphicsData.mpServerSideFont != NULL ) { - if( !bIsGlyphIndex ) - return FALSE; ServerFont& rSF = *maGraphicsData.mpServerSideFont; const GlyphMetric& rGM = rSF.GetGlyphMetric( nGlyphIndex ); - - long rFactor; - ImplFontMetricData rTo; - rSF.FetchFontMetric( rTo, rFactor ); - - Point aPoint = rGM.GetOffset(); - aPoint += Point( 0, rTo.mnAscent ); - rRect = Rectangle( aPoint, rGM.GetSize() ); + rRect = Rectangle( rGM.GetOffset(), rGM.GetSize() ); return TRUE; } #endif //USE_BUILTIN_RASTERIZER @@ -2121,39 +2115,8 @@ BOOL SalGraphics::GetGlyphBoundRect( long nGlyphIndex, bool bIsGlyphIndex, Recta return FALSE; } -#else // ENABLE_CTL - -BOOL -SalGraphics::GetGlyphBoundRect( xub_Unicode cChar, - long *pX, long *pY, long *pDX, long *pDY ) -{ -#ifdef USE_BUILTIN_RASTERIZER - if( maGraphicsData.mpServerSideFont != NULL ) - { - ServerFont& rSF = *maGraphicsData.mpServerSideFont; - const int nGlyphIndex = rSF.GetGlyphIndex( cChar ); - const GlyphMetric& rGM = rSF.GetGlyphMetric( nGlyphIndex ); - - long rFactor; - ImplFontMetricData rTo; - rSF.FetchFontMetric( rTo, rFactor ); - - *pX = rGM.GetOffset().X(); - *pY = rTo.mnAscent + rGM.GetOffset().Y(); - *pDX = rGM.GetSize().Width(); - *pDY = rGM.GetSize().Height(); - - return TRUE; - } -#endif //USE_BUILTIN_RASTERIZER - - return FALSE; -} -#endif // ENABLE_CTL - // --------------------------------------------------------------------------- -#ifdef ENABLE_CTL BOOL SalGraphics::GetGlyphOutline( long nGlyphIndex, bool bIsGlyphIndex, PolyPolygon& rPolyPoly, const OutputDevice* ) { BOOL bRet = FALSE; @@ -2170,61 +2133,6 @@ BOOL SalGraphics::GetGlyphOutline( long nGlyphIndex, bool bIsGlyphIndex, PolyPol return bRet; } -#else // ENABLE_CTL - -ULONG -SalGraphics::GetGlyphOutline( xub_Unicode cChar, - USHORT **ppPolySizes, SalPoint **ppPoints, BYTE **ppFlags ) -{ -#ifdef USE_BUILTIN_RASTERIZER - if( maGraphicsData.mpServerSideFont != NULL ) - { - PolyPolygon rPolyPoly; - ServerFont& rSF = *maGraphicsData.mpServerSideFont; - const int nGlyphIndex = rSF.GetGlyphIndex( cChar ); - bool bRet = rSF.GetGlyphOutline( nGlyphIndex, rPolyPoly ); - if( !bRet ) - return 0; - - // translate PolyPolygon into ancient format - const unsigned nPolygons = rPolyPoly.Count(); - unsigned nPoints = 0; - unsigned i; - for( i = 0; i < nPolygons; ++i ) - nPoints += rPolyPoly[ i].GetSize(); - - USHORT* const pPolySizes = new USHORT[ nPolygons ]; - SalPoint* const pPoints = new SalPoint[ nPoints ]; - BYTE* const pFlags = new BYTE[ nPoints ]; - - *ppPolySizes = pPolySizes; - *ppPoints = pPoints; - *ppFlags = pFlags; - - unsigned nDestIndex = 0; - for( i = 0; i < nPolygons; ++i ) - { - const Polygon& rPolygon = rPolyPoly[ i ]; - const int nPoints = rPolygon.GetSize(); - pPolySizes[ i ] = nPoints; - for( unsigned j = 0; j < nPoints; ++j ) - { - const Point& aPoint = rPolygon[ j ]; - pPoints[ nDestIndex ].mnX = aPoint.X(); - pPoints[ nDestIndex ].mnY = aPoint.Y(); - pFlags[ nDestIndex ] = rPolygon.GetFlags( j ); - ++nDestIndex; - } - } - - return nPolygons; - } -#endif // USE_BUILTIN_RASTERIZER - - return 0; -} -#endif // ENABLE_CTL - //-------------------------------------------------------------------------- SalLayout* SalGraphicsData::LayoutText( ImplLayoutArgs& rArgs ) |