diff options
author | Herbert Duerr [hdu] <duerr@sun.com> | 2010-08-16 14:55:27 +0200 |
---|---|---|
committer | Herbert Duerr [hdu] <duerr@sun.com> | 2010-08-16 14:55:27 +0200 |
commit | 588516e12af81741174b16feb22bef6d5f5fc66e (patch) | |
tree | de38e01ef54b6171bc16ba3ca3ee7fc74b46c202 /vcl | |
parent | c44ba02b8439f592a8379f770c7058b70419398f (diff) |
#i113861# prepare caching of ImplFontCharMap objects on UNX
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/vcl/glyphcache.hxx | 3 | ||||
-rw-r--r-- | vcl/source/glyphs/gcach_ftyp.cxx | 15 | ||||
-rw-r--r-- | vcl/source/glyphs/gcach_ftyp.hxx | 1 | ||||
-rw-r--r-- | vcl/unx/headless/svppspgraphics.cxx | 7 | ||||
-rw-r--r-- | vcl/unx/headless/svptext.cxx | 6 | ||||
-rw-r--r-- | vcl/unx/source/gdi/pspgraphics.cxx | 7 | ||||
-rw-r--r-- | vcl/unx/source/gdi/salgdi3.cxx | 12 |
7 files changed, 24 insertions, 27 deletions
diff --git a/vcl/inc/vcl/glyphcache.hxx b/vcl/inc/vcl/glyphcache.hxx index a77c1626dc24..ecb591abbae4 100644 --- a/vcl/inc/vcl/glyphcache.hxx +++ b/vcl/inc/vcl/glyphcache.hxx @@ -48,7 +48,6 @@ class ImplFontOptions; namespace basegfx { class B2DPolyPolygon; } class RawBitmap; -class CmapResult; #include <vcl/outfont.hxx> #include <vcl/impfont.hxx> @@ -190,7 +189,7 @@ public: virtual void FetchFontMetric( ImplFontMetricData&, long& rFactor ) const = 0; virtual ULONG GetKernPairs( ImplKernPairData** ) const { return 0; } virtual int GetGlyphKernValue( int, int ) const { return 0; } - virtual bool GetFontCodeRanges( CmapResult& ) const { return false; } + virtual ImplFontCharMap* GetImplFontCharMap() const = 0; Point TransformPoint( const Point& ) const; GlyphData& GetGlyphData( int nGlyphIndex ); diff --git a/vcl/source/glyphs/gcach_ftyp.cxx b/vcl/source/glyphs/gcach_ftyp.cxx index aeb928c46608..bc0957a96659 100644 --- a/vcl/source/glyphs/gcach_ftyp.cxx +++ b/vcl/source/glyphs/gcach_ftyp.cxx @@ -1733,7 +1733,20 @@ bool FreetypeServerFont::GetGlyphBitmap8( int nGlyphIndex, RawBitmap& rRawBitmap // determine unicode ranges in font // ----------------------------------------------------------------------- -// TODO: replace with GetFontCharMap() +ImplFontCharMap* FreetypeServerFont::GetImplFontCharMap( void ) const +{ + CmapResult aCmapResult; + bool bOK = GetFontCodeRanges( aCmapResult ); + ImplFontCharMap* pIFCMap = NULL; + if( !bOK ) + pIFCMap = ImplFontCharMap::GetDefaultMap(); + else + pIFCMap = new ImplFontCharMap( aCmapResult ); + // TODO?: cache ImplFontCharMap + return pIFCMap; +} + +// TODO: merge into method GetFontCharMap() bool FreetypeServerFont::GetFontCodeRanges( CmapResult& rResult ) const { rResult.mbSymbolic = mpFontInfo->IsSymbolFont(); diff --git a/vcl/source/glyphs/gcach_ftyp.hxx b/vcl/source/glyphs/gcach_ftyp.hxx index 5ebe70bcbdf9..9b1741aea477 100644 --- a/vcl/source/glyphs/gcach_ftyp.hxx +++ b/vcl/source/glyphs/gcach_ftyp.hxx @@ -181,6 +181,7 @@ public: virtual bool NeedsArtificialItalic() const { return mbArtItalic; } virtual void FetchFontMetric( ImplFontMetricData&, long& rFactor ) const; + virtual ImplFontCharMap* GetImplFontCharMap( void ) const; virtual int GetGlyphIndex( sal_UCS4 ) const; int GetRawGlyphIndex( sal_UCS4 ) const; diff --git a/vcl/unx/headless/svppspgraphics.cxx b/vcl/unx/headless/svppspgraphics.cxx index 86f356031f52..ccced8701f83 100644 --- a/vcl/unx/headless/svppspgraphics.cxx +++ b/vcl/unx/headless/svppspgraphics.cxx @@ -685,14 +685,11 @@ void PspGraphics::DrawServerFontLayout( const ServerFontLayout& rLayout ) ImplFontCharMap* PspGraphics::GetImplFontCharMap() const { - // TODO: get ImplFontCharMap directly from fonts if( !m_pServerFont[0] ) return NULL; - CmapResult aCmapResult; - if( !m_pServerFont[0]->GetFontCodeRanges( aCmapResult ) ) - return NULL; - return new ImplFontCharMap( aCmapResult ); + ImplFontCharMap* pIFCMap = m_pServerFont[0]->GetImplFontCharMap(); + return pIFCMap; } USHORT PspGraphics::SetFont( ImplFontSelectData *pEntry, int nFallbackLevel ) diff --git a/vcl/unx/headless/svptext.cxx b/vcl/unx/headless/svptext.cxx index 34941fc777db..df3625e82643 100644 --- a/vcl/unx/headless/svptext.cxx +++ b/vcl/unx/headless/svptext.cxx @@ -277,10 +277,8 @@ ImplFontCharMap* SvpSalGraphics::GetImplFontCharMap() const if( !m_pServerFont[0] ) return NULL; - CmapResult aCmapResult; - if( !m_pServerFont[0]->GetFontCodeRanges( aCmapResult ) ) - return NULL; - return new ImplFontCharMap( aCmapResult ); + ImplFontCharMap* pIFCMap = m_pServerFont[0]->GetImplFontCharMap(); + return pIFCMap; } // --------------------------------------------------------------------------- diff --git a/vcl/unx/source/gdi/pspgraphics.cxx b/vcl/unx/source/gdi/pspgraphics.cxx index 220d7bbcae87..3f73d1021bb8 100644 --- a/vcl/unx/source/gdi/pspgraphics.cxx +++ b/vcl/unx/source/gdi/pspgraphics.cxx @@ -772,14 +772,11 @@ void PspGraphics::DrawServerFontLayout( const ServerFontLayout& rLayout ) ImplFontCharMap* PspGraphics::GetImplFontCharMap() const { - // TODO: get ImplFontCharMap directly from fonts if( !m_pServerFont[0] ) return NULL; - CmapResult aCmapResult; - if( !m_pServerFont[0]->GetFontCodeRanges( aCmapResult ) ) - return NULL; - return new ImplFontCharMap( aCmapResult ); + ImplFontCharMap* pIFCMap = m_pServerFont[0]->GetImplFontCharMap(); + return pIFCMap; } USHORT PspGraphics::SetFont( ImplFontSelectData *pEntry, int nFallbackLevel ) diff --git a/vcl/unx/source/gdi/salgdi3.cxx b/vcl/unx/source/gdi/salgdi3.cxx index c6410e128596..7e605dbee981 100644 --- a/vcl/unx/source/gdi/salgdi3.cxx +++ b/vcl/unx/source/gdi/salgdi3.cxx @@ -1496,19 +1496,11 @@ void X11SalGraphics::DrawStringUCS2MB( ExtendedFontStruct& rFont, ImplFontCharMap* X11SalGraphics::GetImplFontCharMap() const { - // TODO: get ImplFontCharMap directly from fonts if( !mpServerFont[0] ) -#if 0 // RIP XLFD fonts - if( mXFont[0] ) - // TODO?: nPairCount = mXFont[0]->GetFontCodeRanges( NULL ); -#endif return NULL; - CmapResult aCmapResult; - if( !mpServerFont[0]->GetFontCodeRanges( aCmapResult ) ) - return NULL; - ImplFontCharMap* pNewMap = new ImplFontCharMap( aCmapResult ); - return pNewMap; + ImplFontCharMap* pIFCMap = mpServerFont[0]->GetImplFontCharMap(); + return pIFCMap; } // ---------------------------------------------------------------------------- |