diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-03-10 15:59:44 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-03-10 20:01:30 +0000 |
commit | 2c123e6ca2230c40a5000c02142253b58035be0d (patch) | |
tree | 5c323044a41230a05e555f4fc0eb8c966334d622 /vcl/source/glyphs | |
parent | bfed828ef478168744d87e327d0211c0fd4104d8 (diff) |
Related: rhbz#680460 reorganize this to make it inheritable
Diffstat (limited to 'vcl/source/glyphs')
-rw-r--r-- | vcl/source/glyphs/gcach_ftyp.cxx | 18 | ||||
-rw-r--r-- | vcl/source/glyphs/gcach_ftyp.hxx | 4 | ||||
-rw-r--r-- | vcl/source/glyphs/glyphcache.cxx | 3 |
3 files changed, 17 insertions, 8 deletions
diff --git a/vcl/source/glyphs/gcach_ftyp.cxx b/vcl/source/glyphs/gcach_ftyp.cxx index e9b8546801c0..1ea9d8e1f09f 100644 --- a/vcl/source/glyphs/gcach_ftyp.cxx +++ b/vcl/source/glyphs/gcach_ftyp.cxx @@ -768,6 +768,7 @@ FreetypeServerFont::FreetypeServerFont( const ImplFontSelectData& rFSD, FtFontIn mpFontInfo( pFI ), maFaceFT( NULL ), maSizeFT( NULL ), + mpFontOptions( NULL ), mbFaceOk( false ), maRecodeConverter( NULL ), mpLayoutEngine( NULL ) @@ -913,9 +914,14 @@ FreetypeServerFont::FreetypeServerFont( const ImplFontSelectData& rFSD, FtFontIn mnLoadFlags |= FT_LOAD_NO_BITMAP; } -void FreetypeServerFont::SetFontOptions( const ImplFontOptions& rFontOptions) +void FreetypeServerFont::SetFontOptions( const ImplFontOptions* pFontOptions) { - FontAutoHint eHint = rFontOptions.GetUseAutoHint(); + mpFontOptions = pFontOptions; + + if (!mpFontOptions) + return; + + FontAutoHint eHint = mpFontOptions->GetUseAutoHint(); if( eHint == AUTOHINT_DONTKNOW ) eHint = mbUseGamma ? AUTOHINT_TRUE : AUTOHINT_FALSE; @@ -926,11 +932,11 @@ void FreetypeServerFont::SetFontOptions( const ImplFontOptions& rFontOptions) mnLoadFlags |= FT_LOAD_NO_HINTING; mnLoadFlags |= FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH; //#88334# - if( rFontOptions.DontUseAntiAlias() ) + if( mpFontOptions->DontUseAntiAlias() ) mnPrioAntiAlias = 0; - if( rFontOptions.DontUseEmbeddedBitmaps() ) + if( mpFontOptions->DontUseEmbeddedBitmaps() ) mnPrioEmbedded = 0; - if( rFontOptions.DontUseHinting() ) + if( mpFontOptions->DontUseHinting() ) mnPrioAutoHint = 0; #if (FTVERSION >= 2005) || defined(TT_CONFIG_OPTION_BYTECODE_INTERPRETER) @@ -942,7 +948,7 @@ void FreetypeServerFont::SetFontOptions( const ImplFontOptions& rFontOptions) if( !(mnLoadFlags & FT_LOAD_NO_HINTING) && (nFTVERSION >= 2103)) { mnLoadFlags |= FT_LOAD_TARGET_NORMAL; - switch( rFontOptions.GetHintStyle() ) + switch( mpFontOptions->GetHintStyle() ) { case HINT_NONE: mnLoadFlags |= FT_LOAD_NO_HINTING; diff --git a/vcl/source/glyphs/gcach_ftyp.hxx b/vcl/source/glyphs/gcach_ftyp.hxx index 1aa0c58157d5..964db8352129 100644 --- a/vcl/source/glyphs/gcach_ftyp.hxx +++ b/vcl/source/glyphs/gcach_ftyp.hxx @@ -186,7 +186,7 @@ public: virtual int GetFontFaceNum() const { return mpFontInfo->GetFaceNum(); } virtual bool TestFont() const; virtual void* GetFtFace() const; - virtual void SetFontOptions( const ImplFontOptions&); + virtual void SetFontOptions( const ImplFontOptions*); virtual int GetLoadFlags() const { return (mnLoadFlags & ~FT_LOAD_IGNORE_TRANSFORM); } virtual bool NeedsArtificialBold() const { return mbArtBold; } virtual bool NeedsArtificialItalic() const { return mbArtItalic; } @@ -233,6 +233,8 @@ private: FT_FaceRec_* maFaceFT; FT_SizeRec_* maSizeFT; + const ImplFontOptions* mpFontOptions; + bool mbFaceOk; bool mbArtItalic; bool mbArtBold; diff --git a/vcl/source/glyphs/glyphcache.cxx b/vcl/source/glyphs/glyphcache.cxx index b1d5f8c68be2..6824b7d70ac8 100644 --- a/vcl/source/glyphs/glyphcache.cxx +++ b/vcl/source/glyphs/glyphcache.cxx @@ -522,8 +522,8 @@ bool ServerFont::IsGlyphInvisible( int nGlyphIndex ) ImplServerFontEntry::ImplServerFontEntry( ImplFontSelectData& rFSD ) : ImplFontEntry( rFSD ) , mpServerFont( NULL ) +, mpFontOptions( NULL ) , mbGotFontOptions( false ) -, mbValidFontOptions( false ) {} // ----------------------------------------------------------------------- @@ -531,6 +531,7 @@ ImplServerFontEntry::ImplServerFontEntry( ImplFontSelectData& rFSD ) ImplServerFontEntry::~ImplServerFontEntry() { // TODO: remove the ServerFont here instead of in the GlyphCache + delete mpFontOptions; } // ======================================================================= |