[Libreoffice-commits] .: vcl/inc vcl/unx

Caolán McNamara caolan at kemper.freedesktop.org
Fri Aug 19 02:39:32 PDT 2011


 vcl/inc/unx/glyphcache.hxx              |   95 ++++++++++++++++++++------------
 vcl/unx/generic/glyphs/gcach_ftyp.cxx   |   90 +++++++++++++++++++++---------
 vcl/unx/generic/glyphs/gcach_ftyp.hxx   |   76 -------------------------
 vcl/unx/generic/glyphs/gcach_layout.cxx |    2 
 vcl/unx/generic/glyphs/glyphcache.cxx   |   37 ------------
 5 files changed, 126 insertions(+), 174 deletions(-)

New commits:
commit 8e64e571f23f969590efbf7246c464c352d8b9ec
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Aug 19 10:38:03 2011 +0100

    Merge FreetypeServerFont and ServerFont now its split out into unx

diff --git a/vcl/inc/unx/glyphcache.hxx b/vcl/inc/unx/glyphcache.hxx
index 40c3eb5..d9c84c8 100644
--- a/vcl/inc/unx/glyphcache.hxx
+++ b/vcl/inc/unx/glyphcache.hxx
@@ -183,69 +183,74 @@ private:
 
 // =======================================================================
 
+class FtFontInfo;
+
 class VCL_PLUGIN_PUBLIC ServerFont
 {
 public:
-    virtual const ::rtl::OString*   GetFontFileName() const = 0;
-    virtual int                 GetFontFaceNumber() const = 0;
-    virtual bool                TestFont() const = 0;
-    virtual void*               GetFtFace() const = 0;
-    virtual int                 GetLoadFlags() const  = 0;
-    virtual void                SetFontOptions( boost::shared_ptr<ImplFontOptions> ) = 0;
-    virtual boost::shared_ptr<ImplFontOptions> GetFontOptions() const = 0;
-    virtual bool                NeedsArtificialBold() const = 0;
-    virtual bool                NeedsArtificialItalic() const = 0;
+    ServerFont( const ImplFontSelectData&, FtFontInfo* );
+    virtual ~ServerFont();
+
+    const ::rtl::OString* GetFontFileName() const;
+    int                 GetFontFaceNumber() const;
+    bool                TestFont() const;
+    void*               GetFtFace() const;
+    int                 GetLoadFlags() const { return (mnLoadFlags & ~FT_LOAD_IGNORE_TRANSFORM); }
+    void                SetFontOptions( boost::shared_ptr<ImplFontOptions> );
+    boost::shared_ptr<ImplFontOptions> GetFontOptions() const;
+    bool                NeedsArtificialBold() const { return mbArtBold; }
+    bool                NeedsArtificialItalic() const { return mbArtItalic; }
 
     const ImplFontSelectData&   GetFontSelData() const      { return maFontSelData; }
 
-    virtual void                FetchFontMetric( ImplFontMetricData&, long& rFactor ) const = 0;
-    virtual sal_uLong           GetKernPairs( ImplKernPairData** ) const = 0;
-    virtual const unsigned char* GetTable( const char* pName, sal_uLong* pLength ) = 0;
-    virtual int                 GetEmUnits() const = 0;
-    virtual const FT_Size_Metrics& GetMetricsFT() const = 0;
-    virtual int                 GetGlyphKernValue( int, int ) const = 0;
-    virtual const ImplFontCharMap* GetImplFontCharMap() const = 0;
-    virtual bool                GetFontCapabilities(vcl::FontCapabilities &) const = 0;
+    void                FetchFontMetric( ImplFontMetricData&, long& rFactor ) const;
+    sal_uLong           GetKernPairs( ImplKernPairData** ) const;
+    const unsigned char* GetTable( const char* pName, sal_uLong* pLength );
+    int                 GetEmUnits() const;
+    const FT_Size_Metrics& GetMetricsFT() const { return maSizeFT->metrics; }
+    int                 GetGlyphKernValue( int, int ) const;
+    const ImplFontCharMap* GetImplFontCharMap() const;
+    bool                GetFontCapabilities(vcl::FontCapabilities &) const;
     Point                       TransformPoint( const Point& ) const;
 
     GlyphData&                  GetGlyphData( int nGlyphIndex );
     const GlyphMetric&          GetGlyphMetric( int nGlyphIndex )
                                 { return GetGlyphData( nGlyphIndex ).GetMetric(); }
 #ifdef ENABLE_GRAPHITE
-    virtual GraphiteFaceWrapper* GetGraphiteFace() const = 0;
+    virtual GraphiteFaceWrapper* GetGraphiteFace() const;
 #endif
 
-    virtual int                 GetGlyphIndex( sal_UCS4 ) const = 0;
-    virtual int                 GetRawGlyphIndex( sal_UCS4 ) const = 0;
-    virtual int                 FixupGlyphIndex( int nGlyphIndex, sal_UCS4 ) const = 0;
-    virtual bool                GetGlyphOutline( int nGlyphIndex, ::basegfx::B2DPolyPolygon& ) const = 0;
-    virtual bool                GetAntialiasAdvice( void ) const = 0;
+    int                 GetGlyphIndex( sal_UCS4 ) const;
+    int                 GetRawGlyphIndex( sal_UCS4 ) const;
+    int                 FixupGlyphIndex( int nGlyphIndex, sal_UCS4 ) const;
+    bool                GetGlyphOutline( int nGlyphIndex, ::basegfx::B2DPolyPolygon& ) const;
+    bool                GetAntialiasAdvice( void ) const;
     bool                        IsGlyphInvisible( int nGlyphIndex );
-    virtual bool                GetGlyphBitmap1( int nGlyphIndex, RawBitmap& ) const = 0;
-    virtual bool                GetGlyphBitmap8( int nGlyphIndex, RawBitmap& ) const = 0;
+    bool                GetGlyphBitmap1( int nGlyphIndex, RawBitmap& ) const;
+    bool                GetGlyphBitmap8( int nGlyphIndex, RawBitmap& ) const;
 
     void                        SetExtended( int nInfo, void* ppVoid );
     int                         GetExtInfo() { return mnExtInfo; }
     void*                       GetExtPointer() { return mpExtData; }
 
-protected:
+private:
     friend class GlyphCache;
     friend class ServerFontLayout;
-    explicit                    ServerFont( const ImplFontSelectData& );
-    virtual                     ~ServerFont();
 
     void                        AddRef() const      { ++mnRefCount; }
     long                        GetRefCount() const { return mnRefCount; }
     long                        Release() const;
     sal_uLong                       GetByteCount() const { return mnBytesUsed; }
 
-    virtual void                InitGlyphData( int nGlyphIndex, GlyphData& ) const = 0;
-    virtual void                GarbageCollect( long );
+    void                InitGlyphData( int nGlyphIndex, GlyphData& ) const;
+    void                GarbageCollect( long );
     void                        ReleaseFromGarbageCollect();
 
-    virtual ServerFontLayoutEngine* GetLayoutEngine() = 0;
+    int                 ApplyGlyphTransform( int nGlyphFlags, FT_GlyphRec_*, bool ) const;
+    bool                ApplyGSUB( const ImplFontSelectData& );
+
+    ServerFontLayoutEngine* GetLayoutEngine();
 
-private:
     typedef ::boost::unordered_map<int,GlyphData> GlyphList;
     mutable GlyphList           maGlyphList;
 
@@ -262,14 +267,36 @@ private:
     ServerFont*                 mpPrevGCFont;
     ServerFont*                 mpNextGCFont;
 
-protected:
     // 16.16 fixed point values used for a rotated font
     long                        mnCos;
     long                        mnSin;
-private:
+
     int                         mnZWJ;
     int                         mnZWNJ;
     bool                        mbCollectedZW;
+
+    int                         mnWidth;
+    int                         mnPrioEmbedded;
+    int                         mnPrioAntiAlias;
+    int                         mnPrioAutoHint;
+    FtFontInfo*                 mpFontInfo;
+    FT_Int                      mnLoadFlags;
+    double                      mfStretch;
+    FT_FaceRec_*                maFaceFT;
+    FT_SizeRec_*                maSizeFT;
+
+    boost::shared_ptr<ImplFontOptions> mpFontOptions;
+
+    bool                        mbFaceOk;
+    bool            mbArtItalic;
+    bool            mbArtBold;
+    bool            mbUseGamma;
+
+    typedef ::boost::unordered_map<int,int> GlyphSubstitution;
+    GlyphSubstitution           maGlyphSubstitution;
+    rtl_UnicodeToTextConverter  maRecodeConverter;
+
+    ServerFontLayoutEngine*     mpLayoutEngine;
 };
 
 // =======================================================================
diff --git a/vcl/unx/generic/glyphs/gcach_ftyp.cxx b/vcl/unx/generic/glyphs/gcach_ftyp.cxx
index c38bc37..c110650 100644
--- a/vcl/unx/generic/glyphs/gcach_ftyp.cxx
+++ b/vcl/unx/generic/glyphs/gcach_ftyp.cxx
@@ -577,7 +577,7 @@ FreetypeManager::FreetypeManager()
 
 // -----------------------------------------------------------------------
 
-void* FreetypeServerFont::GetFtFace() const
+void* ServerFont::GetFtFace() const
 {
     if( maSizeFT )
         pFTActivateSize( maSizeFT );
@@ -640,7 +640,7 @@ void FreetypeManager::ClearFontList( )
 
 // -----------------------------------------------------------------------
 
-FreetypeServerFont* FreetypeManager::CreateFont( const ImplFontSelectData& rFSD )
+ServerFont* FreetypeManager::CreateFont( const ImplFontSelectData& rFSD )
 {
     FtFontInfo* pFontInfo = NULL;
 
@@ -653,7 +653,7 @@ FreetypeServerFont* FreetypeManager::CreateFont( const ImplFontSelectData& rFSD
     if( !pFontInfo )
         return NULL;
 
-    FreetypeServerFont* pNew = new FreetypeServerFont( rFSD, pFontInfo );
+    ServerFont* pNew = new ServerFont( rFSD, pFontInfo );
 
     return pNew;
 }
@@ -677,11 +677,22 @@ ImplFontEntry* ImplFTSFontData::CreateFontInstance( ImplFontSelectData& rFSD ) c
 }
 
 // =======================================================================
-// FreetypeServerFont
+// ServerFont
 // =======================================================================
 
-FreetypeServerFont::FreetypeServerFont( const ImplFontSelectData& rFSD, FtFontInfo* pFI )
-:   ServerFont( rFSD ),
+ServerFont::ServerFont( const ImplFontSelectData& rFSD, FtFontInfo* pFI )
+:   maGlyphList( 0),
+    maFontSelData(rFSD),
+    mnExtInfo(0),
+    mnRefCount(1),
+    mnBytesUsed( sizeof(ServerFont) ),
+    mpPrevGCFont( NULL ),
+    mpNextGCFont( NULL ),
+    mnCos( 0x10000),
+    mnSin( 0 ),
+    mnZWJ( 0 ),
+    mnZWNJ( 0 ),
+    mbCollectedZW( false ),
     mnPrioEmbedded(nDefaultPrioEmbedded),
     mnPrioAntiAlias(nDefaultPrioAntiAlias),
     mnPrioAutoHint(nDefaultPrioAutoHint),
@@ -692,6 +703,17 @@ FreetypeServerFont::FreetypeServerFont( const ImplFontSelectData& rFSD, FtFontIn
     maRecodeConverter( NULL ),
     mpLayoutEngine( NULL )
 {
+    // TODO: move update of mpFontEntry into FontEntry class when
+    // it becomes reponsible for the ServerFont instantiation
+    ((ImplServerFontEntry*)rFSD.mpFontEntry)->SetServerFont( this );
+
+    if( rFSD.mnOrientation != 0 )
+    {
+        const double dRad = rFSD.mnOrientation * ( F_2PI / 3600.0 );
+        mnCos = static_cast<long>( 0x10000 * cos( dRad ) + 0.5 );
+        mnSin = static_cast<long>( 0x10000 * sin( dRad ) + 0.5 );
+    }
+
     maFaceFT = pFI->GetFaceFT();
 
     if( !maFaceFT )
@@ -833,7 +855,7 @@ FreetypeServerFont::FreetypeServerFont( const ImplFontSelectData& rFSD, FtFontIn
         mnLoadFlags |= FT_LOAD_NO_BITMAP;
 }
 
-void FreetypeServerFont::SetFontOptions( boost::shared_ptr<ImplFontOptions> pFontOptions)
+void ServerFont::SetFontOptions( boost::shared_ptr<ImplFontOptions> pFontOptions)
 {
     mpFontOptions = pFontOptions;
 
@@ -888,21 +910,21 @@ void FreetypeServerFont::SetFontOptions( boost::shared_ptr<ImplFontOptions> pFon
         mnLoadFlags |= FT_LOAD_NO_BITMAP;
 }
 
-boost::shared_ptr<ImplFontOptions> FreetypeServerFont::GetFontOptions() const
+boost::shared_ptr<ImplFontOptions> ServerFont::GetFontOptions() const
 {
     return mpFontOptions;
 }
 
 // -----------------------------------------------------------------------
 
-bool FreetypeServerFont::TestFont() const
+bool ServerFont::TestFont() const
 {
     return mbFaceOk;
 }
 
 // -----------------------------------------------------------------------
 
-FreetypeServerFont::~FreetypeServerFont()
+ServerFont::~ServerFont()
 {
     if( mpLayoutEngine )
         delete mpLayoutEngine;
@@ -914,18 +936,20 @@ FreetypeServerFont::~FreetypeServerFont()
         pFTDoneSize( maSizeFT );
 
     mpFontInfo->ReleaseFaceFT( maFaceFT );
+
+    ReleaseFromGarbageCollect();
 }
 
  // -----------------------------------------------------------------------
 
-int FreetypeServerFont::GetEmUnits() const
+int ServerFont::GetEmUnits() const
 {
     return maFaceFT->units_per_EM;
 }
 
 // -----------------------------------------------------------------------
 
-void FreetypeServerFont::FetchFontMetric( ImplFontMetricData& rTo, long& rFactor ) const
+void ServerFont::FetchFontMetric( ImplFontMetricData& rTo, long& rFactor ) const
 {
     static_cast<ImplFontAttributes&>(rTo) = mpFontInfo->GetFontAttributes();
 
@@ -1059,7 +1083,7 @@ void FreetypeServerFont::FetchFontMetric( ImplFontMetricData& rTo, long& rFactor
 
 // -----------------------------------------------------------------------
 
-static inline void SplitGlyphFlags( const FreetypeServerFont& rFont, int& nGlyphIndex, int& nGlyphFlags )
+static inline void SplitGlyphFlags( const ServerFont& rFont, int& nGlyphIndex, int& nGlyphFlags )
 {
     nGlyphFlags = nGlyphIndex & GF_FLAGMASK;
     nGlyphIndex &= GF_IDXMASK;
@@ -1070,7 +1094,7 @@ static inline void SplitGlyphFlags( const FreetypeServerFont& rFont, int& nGlyph
 
 // -----------------------------------------------------------------------
 
-int FreetypeServerFont::ApplyGlyphTransform( int nGlyphFlags,
+int ServerFont::ApplyGlyphTransform( int nGlyphFlags,
     FT_Glyph pGlyphFT, bool bForBitmapProcessing ) const
 {
     int nAngle = GetFontSelData().mnOrientation;
@@ -1153,7 +1177,7 @@ int FreetypeServerFont::ApplyGlyphTransform( int nGlyphFlags,
 
 // -----------------------------------------------------------------------
 
-int FreetypeServerFont::GetRawGlyphIndex( sal_UCS4 aChar ) const
+int ServerFont::GetRawGlyphIndex( sal_UCS4 aChar ) const
 {
     if( mpFontInfo->IsSymbolFont() )
     {
@@ -1211,7 +1235,7 @@ int FreetypeServerFont::GetRawGlyphIndex( sal_UCS4 aChar ) const
 
 // -----------------------------------------------------------------------
 
-int FreetypeServerFont::FixupGlyphIndex( int nGlyphIndex, sal_UCS4 aChar ) const
+int ServerFont::FixupGlyphIndex( int nGlyphIndex, sal_UCS4 aChar ) const
 {
     int nGlyphFlags = GF_NONE;
 
@@ -1248,7 +1272,7 @@ int FreetypeServerFont::FixupGlyphIndex( int nGlyphIndex, sal_UCS4 aChar ) const
 
 // -----------------------------------------------------------------------
 
-int FreetypeServerFont::GetGlyphIndex( sal_UCS4 aChar ) const
+int ServerFont::GetGlyphIndex( sal_UCS4 aChar ) const
 {
     int nGlyphIndex = GetRawGlyphIndex( aChar );
     nGlyphIndex = FixupGlyphIndex( nGlyphIndex, aChar );
@@ -1276,7 +1300,7 @@ static int lcl_GetCharWidth( FT_FaceRec_* pFaceFT, double fStretch, int nGlyphFl
 
 // -----------------------------------------------------------------------
 
-void FreetypeServerFont::InitGlyphData( int nGlyphIndex, GlyphData& rGD ) const
+void ServerFont::InitGlyphData( int nGlyphIndex, GlyphData& rGD ) const
 {
     if( maSizeFT )
         pFTActivateSize( maSizeFT );
@@ -1345,7 +1369,7 @@ void FreetypeServerFont::InitGlyphData( int nGlyphIndex, GlyphData& rGD ) const
 
 // -----------------------------------------------------------------------
 
-bool FreetypeServerFont::GetAntialiasAdvice( void ) const
+bool ServerFont::GetAntialiasAdvice( void ) const
 {
     if( GetFontSelData().mbNonAntialiased || (mnPrioAntiAlias<=0) )
         return false;
@@ -1356,7 +1380,7 @@ bool FreetypeServerFont::GetAntialiasAdvice( void ) const
 
 // -----------------------------------------------------------------------
 
-bool FreetypeServerFont::GetGlyphBitmap1( int nGlyphIndex, RawBitmap& rRawBitmap ) const
+bool ServerFont::GetGlyphBitmap1( int nGlyphIndex, RawBitmap& rRawBitmap ) const
 {
     if( maSizeFT )
         pFTActivateSize( maSizeFT );
@@ -1530,7 +1554,7 @@ bool FreetypeServerFont::GetGlyphBitmap1( int nGlyphIndex, RawBitmap& rRawBitmap
 
 // -----------------------------------------------------------------------
 
-bool FreetypeServerFont::GetGlyphBitmap8( int nGlyphIndex, RawBitmap& rRawBitmap ) const
+bool ServerFont::GetGlyphBitmap8( int nGlyphIndex, RawBitmap& rRawBitmap ) const
 {
     if( maSizeFT )
         pFTActivateSize( maSizeFT );
@@ -1710,7 +1734,7 @@ bool FreetypeServerFont::GetGlyphBitmap8( int nGlyphIndex, RawBitmap& rRawBitmap
 // determine unicode ranges in font
 // -----------------------------------------------------------------------
 
-const ImplFontCharMap* FreetypeServerFont::GetImplFontCharMap( void ) const
+const ImplFontCharMap* ServerFont::GetImplFontCharMap( void ) const
 {
     const ImplFontCharMap* pIFCMap = mpFontInfo->GetImplFontCharMap();
     return pIFCMap;
@@ -1783,7 +1807,7 @@ bool FtFontInfo::GetFontCodeRanges( CmapResult& rResult ) const
     return true;
 }
 
-bool FreetypeServerFont::GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const
+bool ServerFont::GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const
 {
     bool bRet = false;
 
@@ -1810,7 +1834,7 @@ bool FreetypeServerFont::GetFontCapabilities(vcl::FontCapabilities &rFontCapabil
 // kerning stuff
 // -----------------------------------------------------------------------
 
-int FreetypeServerFont::GetGlyphKernValue( int nGlyphLeft, int nGlyphRight ) const
+int ServerFont::GetGlyphKernValue( int nGlyphLeft, int nGlyphRight ) const
 {
     // if no kerning info is available from Freetype
     // then we may have to use extra info provided by e.g. psprint
@@ -1840,7 +1864,7 @@ int FreetypeServerFont::GetGlyphKernValue( int nGlyphLeft, int nGlyphRight ) con
 
 // -----------------------------------------------------------------------
 
-sal_uLong FreetypeServerFont::GetKernPairs( ImplKernPairData** ppKernPairs ) const
+sal_uLong ServerFont::GetKernPairs( ImplKernPairData** ppKernPairs ) const
 {
     // if no kerning info is available in the font file
     *ppKernPairs = NULL;
@@ -2260,7 +2284,7 @@ static int FT_cubic_to( FT_Vector_CPtr p1, FT_Vector_CPtr p2, FT_Vector_CPtr p3,
 
 // -----------------------------------------------------------------------
 
-bool FreetypeServerFont::GetGlyphOutline( int nGlyphIndex,
+bool ServerFont::GetGlyphOutline( int nGlyphIndex,
     ::basegfx::B2DPolyPolygon& rB2DPolyPoly ) const
 {
     if( maSizeFT )
@@ -2336,7 +2360,7 @@ bool FreetypeServerFont::GetGlyphOutline( int nGlyphIndex,
 
 // -----------------------------------------------------------------------
 
-bool FreetypeServerFont::ApplyGSUB( const ImplFontSelectData& rFSD )
+bool ServerFont::ApplyGSUB( const ImplFontSelectData& rFSD )
 {
 #define MKTAG(s) ((((((s[0]<<8)+s[1])<<8)+s[2])<<8)+s[3])
 
@@ -2580,6 +2604,18 @@ bool FreetypeServerFont::ApplyGSUB( const ImplFontSelectData& rFSD )
     return true;
 }
 
+const unsigned char* ServerFont::GetTable(const char* pName, sal_uLong* pLength)
+{
+    return mpFontInfo->GetTable( pName, pLength );
+}
+
+#ifdef ENABLE_GRAPHITE
+GraphiteFaceWrapper* ServerFont::GetGraphiteFace() const
+{
+    return mpFontInfo->GetGraphiteFace();
+}
+#endif
+
 // =======================================================================
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/generic/glyphs/gcach_ftyp.hxx b/vcl/unx/generic/glyphs/gcach_ftyp.hxx
index 808f386..f3af00b 100644
--- a/vcl/unx/generic/glyphs/gcach_ftyp.hxx
+++ b/vcl/unx/generic/glyphs/gcach_ftyp.hxx
@@ -164,7 +164,7 @@ public:
     void                AnnounceFonts( ImplDevFontList* ) const;
     void                ClearFontList();
 
-    FreetypeServerFont* CreateFont( const ImplFontSelectData& );
+    ServerFont* CreateFont( const ImplFontSelectData& );
 
 private:
     typedef ::boost::unordered_map<sal_IntPtr,FtFontInfo*> FontList;
@@ -176,80 +176,6 @@ private:
 
 // -----------------------------------------------------------------------
 
-class FreetypeServerFont : public ServerFont
-{
-public:
-                                FreetypeServerFont( const ImplFontSelectData&, FtFontInfo* );
-    virtual                     ~FreetypeServerFont();
-
-    virtual const ::rtl::OString* GetFontFileName() const { return mpFontInfo->GetFontFileName(); }
-    virtual int                 GetFontFaceNumber() const { return mpFontInfo->GetFaceNum(); }
-    virtual bool                TestFont() const;
-    virtual void*               GetFtFace() const;
-    virtual void                SetFontOptions( boost::shared_ptr<ImplFontOptions> );
-    virtual boost::shared_ptr<ImplFontOptions> GetFontOptions() const;
-    virtual int                 GetLoadFlags() const { return (mnLoadFlags & ~FT_LOAD_IGNORE_TRANSFORM); }
-    virtual bool                NeedsArtificialBold() const { return mbArtBold; }
-    virtual bool                NeedsArtificialItalic() const { return mbArtItalic; }
-
-    virtual void                FetchFontMetric( ImplFontMetricData&, long& rFactor ) const;
-    virtual const ImplFontCharMap* GetImplFontCharMap( void ) const;
-
-    virtual int                 GetGlyphIndex( sal_UCS4 ) const;
-    virtual int                 GetRawGlyphIndex( sal_UCS4 ) const;
-    virtual int                 FixupGlyphIndex( int nGlyphIndex, sal_UCS4 ) const;
-
-    virtual bool                GetAntialiasAdvice( void ) const;
-    virtual bool                GetGlyphBitmap1( int nGlyphIndex, RawBitmap& ) const;
-    virtual bool                GetGlyphBitmap8( int nGlyphIndex, RawBitmap& ) const;
-    virtual bool                GetGlyphOutline( int nGlyphIndex, ::basegfx::B2DPolyPolygon& ) const;
-    virtual int                 GetGlyphKernValue( int nLeftGlyph, int nRightGlyph ) const;
-    virtual sal_uLong           GetKernPairs( ImplKernPairData** ) const;
-
-    virtual const unsigned char* GetTable( const char* pName, sal_uLong* pLength )
-                                { return mpFontInfo->GetTable( pName, pLength ); }
-    virtual int                 GetEmUnits() const;
-    virtual const FT_Size_Metrics& GetMetricsFT() const { return maSizeFT->metrics; }
-#ifdef ENABLE_GRAPHITE
-    virtual GraphiteFaceWrapper* GetGraphiteFace() const { return mpFontInfo->GetGraphiteFace(); }
-#endif
-
-protected:
-    friend class GlyphCache;
-
-    int                         ApplyGlyphTransform( int nGlyphFlags, FT_GlyphRec_*, bool ) const;
-    virtual void                InitGlyphData( int nGlyphIndex, GlyphData& ) const;
-    virtual bool                GetFontCapabilities(vcl::FontCapabilities &) const;
-    bool                        ApplyGSUB( const ImplFontSelectData& );
-    virtual ServerFontLayoutEngine* GetLayoutEngine();
-
-private:
-    int                         mnWidth;
-    int                         mnPrioEmbedded;
-    int                         mnPrioAntiAlias;
-    int                         mnPrioAutoHint;
-    FtFontInfo*                 mpFontInfo;
-    FT_Int                      mnLoadFlags;
-    double                      mfStretch;
-    FT_FaceRec_*                maFaceFT;
-    FT_SizeRec_*                maSizeFT;
-
-    boost::shared_ptr<ImplFontOptions> mpFontOptions;
-
-    bool                        mbFaceOk;
-    bool            mbArtItalic;
-    bool            mbArtBold;
-    bool            mbUseGamma;
-
-    typedef ::boost::unordered_map<int,int> GlyphSubstitution;
-    GlyphSubstitution           maGlyphSubstitution;
-    rtl_UnicodeToTextConverter  maRecodeConverter;
-
-    ServerFontLayoutEngine*     mpLayoutEngine;
-};
-
-// -----------------------------------------------------------------------
-
 class ImplFTSFontData : public ImplFontData
 {
 private:
diff --git a/vcl/unx/generic/glyphs/gcach_layout.cxx b/vcl/unx/generic/glyphs/gcach_layout.cxx
index 1ed2890..ae5ad51 100644
--- a/vcl/unx/generic/glyphs/gcach_layout.cxx
+++ b/vcl/unx/generic/glyphs/gcach_layout.cxx
@@ -653,7 +653,7 @@ bool IcuLayoutEngine::operator()( ServerFontLayout& rLayout, ImplLayoutArgs& rAr
 
 // =======================================================================
 
-ServerFontLayoutEngine* FreetypeServerFont::GetLayoutEngine()
+ServerFontLayoutEngine* ServerFont::GetLayoutEngine()
 {
     // find best layout engine for font, platform, script and language
 #ifdef ENABLE_ICU_LAYOUT
diff --git a/vcl/unx/generic/glyphs/glyphcache.cxx b/vcl/unx/generic/glyphs/glyphcache.cxx
index e910dc0..5161496 100644
--- a/vcl/unx/generic/glyphs/glyphcache.cxx
+++ b/vcl/unx/generic/glyphs/glyphcache.cxx
@@ -345,43 +345,6 @@ inline void GlyphCache::RemovingGlyph( ServerFont& rSF, GlyphData& rGD, int nGly
     --mnGlyphCount;
 }
 
-// =======================================================================
-// ServerFont
-// =======================================================================
-
-ServerFont::ServerFont( const ImplFontSelectData& rFSD )
-:   maGlyphList( 0),
-    maFontSelData(rFSD),
-    mnExtInfo(0),
-    mnRefCount(1),
-    mnBytesUsed( sizeof(ServerFont) ),
-    mpPrevGCFont( NULL ),
-    mpNextGCFont( NULL ),
-    mnCos( 0x10000),
-    mnSin( 0 ),
-    mnZWJ( 0 ),
-    mnZWNJ( 0 ),
-    mbCollectedZW( false )
-{
-    // TODO: move update of mpFontEntry into FontEntry class when
-    // it becomes reponsible for the ServerFont instantiation
-    ((ImplServerFontEntry*)rFSD.mpFontEntry)->SetServerFont( this );
-
-    if( rFSD.mnOrientation != 0 )
-    {
-        const double dRad = rFSD.mnOrientation * ( F_2PI / 3600.0 );
-        mnCos = static_cast<long>( 0x10000 * cos( dRad ) + 0.5 );
-        mnSin = static_cast<long>( 0x10000 * sin( dRad ) + 0.5 );
-    }
-}
-
-// -----------------------------------------------------------------------
-
-ServerFont::~ServerFont()
-{
-    ReleaseFromGarbageCollect();
-}
-
 // -----------------------------------------------------------------------
 
 void ServerFont::ReleaseFromGarbageCollect()


More information about the Libreoffice-commits mailing list