diff options
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/generic/glyphs/gcach_layout.cxx | 14 | ||||
-rw-r--r-- | vcl/inc/generic/glyphcache.hxx | 6 | ||||
-rw-r--r-- | vcl/inc/sallayout.hxx | 11 | ||||
-rw-r--r-- | vcl/source/gdi/sallayout.cxx | 2 |
4 files changed, 13 insertions, 20 deletions
diff --git a/vcl/generic/glyphs/gcach_layout.cxx b/vcl/generic/glyphs/gcach_layout.cxx index cb6c1953a74a..935a0e5180d7 100644 --- a/vcl/generic/glyphs/gcach_layout.cxx +++ b/vcl/generic/glyphs/gcach_layout.cxx @@ -72,17 +72,6 @@ bool ServerFontLayout::LayoutText( ImplLayoutArgs& rArgs ) } // ----------------------------------------------------------------------- -long ServerFontLayout::GetTextWidth() const -{ - long nWidth; - if (bUseHarfBuzz) - nWidth = GetWidth(); - else - nWidth = GenericSalLayout::GetTextWidth(); - - return nWidth; -} - void ServerFontLayout::AdjustLayout( ImplLayoutArgs& rArgs ) { GenericSalLayout::AdjustLayout( rArgs ); @@ -524,7 +513,7 @@ bool HbLayoutEngine::layout(ServerFontLayout& rLayout, ImplLayoutArgs& rArgs) int32_t nYAdvance = pHbPositions[i].y_advance >> 6; Point aNewPos = Point(aCurrPos.X() + nXOffset, -(aCurrPos.Y() + nYOffset)); - const GlyphItem aGI(nCharPos, nGlyphIndex, aNewPos, nGlyphFlags, nXAdvance); + const GlyphItem aGI(nCharPos, nGlyphIndex, aNewPos, nGlyphFlags, nXAdvance, nXOffset); rLayout.AppendGlyph(aGI); aCurrPos.X() += nXAdvance; @@ -533,7 +522,6 @@ bool HbLayoutEngine::layout(ServerFontLayout& rLayout, ImplLayoutArgs& rArgs) hb_buffer_destroy(pHbBuffer); } - rLayout.SetWidth(aCurrPos.X()); hb_font_destroy(pHbFont); diff --git a/vcl/inc/generic/glyphcache.hxx b/vcl/inc/generic/glyphcache.hxx index 5345360d8c52..e03e03485ee4 100644 --- a/vcl/inc/generic/glyphcache.hxx +++ b/vcl/inc/generic/glyphcache.hxx @@ -317,7 +317,6 @@ private: SAL_DLLPRIVATE ServerFontLayout& operator=( const ServerFontLayout& ); bool bUseHarfBuzz; - long mnTextWidth; public: ServerFontLayout( ServerFont& ); @@ -325,12 +324,7 @@ public: virtual void AdjustLayout( ImplLayoutArgs& ); virtual void ApplyDXArray( ImplLayoutArgs& ); virtual void DrawText( SalGraphics& ) const; - virtual long GetTextWidth() const; ServerFont& GetServerFont() const { return mrServerFont; } - - // used by layout engine - void SetWidth( long nWidth ) { mnTextWidth = nWidth; } - long GetWidth() const { return mnTextWidth; } }; // ======================================================================= diff --git a/vcl/inc/sallayout.hxx b/vcl/inc/sallayout.hxx index 5d99acb768df..6b25f5bae386 100644 --- a/vcl/inc/sallayout.hxx +++ b/vcl/inc/sallayout.hxx @@ -310,6 +310,7 @@ struct GlyphItem int mnCharPos; // index in string int mnOrigWidth; // original glyph width int mnNewWidth; // width after adjustments + int mnXOffset; sal_GlyphId mnGlyphIndex; Point maLinearPos; // absolute position of non rotated string @@ -320,9 +321,19 @@ public: long nFlags, int nOrigWidth ) : mnFlags(nFlags), mnCharPos(nCharPos), mnOrigWidth(nOrigWidth), mnNewWidth(nOrigWidth), + mnXOffset(0), mnGlyphIndex(nGlyphIndex), maLinearPos(rLinearPos) {} + GlyphItem( int nCharPos, sal_GlyphId nGlyphIndex, const Point& rLinearPos, + long nFlags, int nOrigWidth, int nXOffset ) + : mnFlags(nFlags), mnCharPos(nCharPos), + mnOrigWidth(nOrigWidth), mnNewWidth(nOrigWidth), + mnXOffset(nXOffset), + mnGlyphIndex(nGlyphIndex), maLinearPos(rLinearPos) + {} + + enum{ FALLBACK_MASK=0xFF, IS_IN_CLUSTER=0x100, IS_RTL_GLYPH=0x200, IS_DIACRITIC=0x400 }; bool IsClusterStart() const { return ((mnFlags & IS_IN_CLUSTER) == 0); } diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx index e90f7820f7e4..6955679350ad 100644 --- a/vcl/source/gdi/sallayout.cxx +++ b/vcl/source/gdi/sallayout.cxx @@ -996,7 +996,7 @@ long GenericSalLayout::GetTextWidth() const long nXPos = pG->maLinearPos.X(); if( nMinPos > nXPos ) nMinPos = nXPos; - nXPos += pG->mnNewWidth; + nXPos += pG->mnNewWidth - pG->mnXOffset; if( nMaxPos < nXPos ) nMaxPos = nXPos; } |