diff options
-rw-r--r-- | vcl/inc/sallayout.hxx | 6 | ||||
-rw-r--r-- | vcl/source/gdi/CommonSalLayout.cxx | 5 | ||||
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl.cxx | 4 | ||||
-rw-r--r-- | vcl/source/gdi/sallayout.cxx | 10 | ||||
-rw-r--r-- | vcl/source/outdev/font.cxx | 2 | ||||
-rw-r--r-- | vcl/source/outdev/textline.cxx | 2 |
6 files changed, 11 insertions, 18 deletions
diff --git a/vcl/inc/sallayout.hxx b/vcl/inc/sallayout.hxx index ee41051f7f38..447cc390a6b4 100644 --- a/vcl/inc/sallayout.hxx +++ b/vcl/inc/sallayout.hxx @@ -182,8 +182,6 @@ public: virtual bool GetOutline( SalGraphics&, basegfx::B2DPolyPolygonVector& ) const; virtual bool GetBoundRect( SalGraphics&, Rectangle& ) const; - static bool IsSpacingGlyph( sal_GlyphId ); - // reference counting void Release() const; @@ -321,13 +319,15 @@ public: IS_RTL_GLYPH = 0x002, IS_DIACRITIC = 0x004, IS_VERTICAL = 0x008, - ALLOW_KASHIDA = 0X010 + IS_SPACING = 0x010, + ALLOW_KASHIDA = 0x020 }; bool IsClusterStart() const { return ((mnFlags & IS_IN_CLUSTER) == 0); } bool IsRTLGlyph() const { return ((mnFlags & IS_RTL_GLYPH) != 0); } bool IsDiacritic() const { return ((mnFlags & IS_DIACRITIC) != 0); } bool IsVertical() const { return ((mnFlags & IS_VERTICAL) != 0); } + bool IsSpacing() const { return ((mnFlags & IS_SPACING) != 0); } bool AllowKashida() const { return ((mnFlags & ALLOW_KASHIDA) != 0); } }; diff --git a/vcl/source/gdi/CommonSalLayout.cxx b/vcl/source/gdi/CommonSalLayout.cxx index 27394c76a6de..2c059ef119b1 100644 --- a/vcl/source/gdi/CommonSalLayout.cxx +++ b/vcl/source/gdi/CommonSalLayout.cxx @@ -600,10 +600,13 @@ bool CommonSalLayout::LayoutText(ImplLayoutArgs& rArgs) if (u_getIntPropertyValue(aChar, UCHAR_GENERAL_CATEGORY) == U_NON_SPACING_MARK) nGlyphFlags |= GlyphItem::IS_DIACRITIC; + if (u_isUWhiteSpace(aChar)) + nGlyphFlags |= GlyphItem::IS_SPACING; + if ((aSubRun.maScript == HB_SCRIPT_ARABIC || aSubRun.maScript == HB_SCRIPT_SYRIAC) && HB_DIRECTION_IS_BACKWARD(aSubRun.maDirection) && - !u_isUWhiteSpace(aChar)) + (nGlyphFlags & GlyphItem::IS_SPACING) == 0) { nGlyphFlags |= GlyphItem::ALLOW_KASHIDA; rArgs.mnFlags |= SalLayoutFlags::KashidaJustification; diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index 241324d5b56a..75ba6d1854b9 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -8706,7 +8706,7 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const OUString& rText, bool int nStart = 0; while (rLayout.GetNextGlyphs(1, &pGlyph, aPos, nStart)) { - if (!SalLayout::IsSpacingGlyph(pGlyph->maGlyphId)) + if (!pGlyph->IsSpacing()) { if( !nWidth ) aStartPt = aPos; @@ -8803,7 +8803,7 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const OUString& rText, bool int nStart = 0; while (rLayout.GetNextGlyphs(1, &pGlyph, aPos, nStart)) { - if (!SalLayout::IsSpacingGlyph(pGlyph->maGlyphId)) + if (pGlyph->IsSpacing()) { Point aAdjOffset = aOffset; aAdjOffset.X() += (pGlyph->mnNewWidth - nEmphWidth) / 2; diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx index 1567d60a7eea..877d7e569114 100644 --- a/vcl/source/gdi/sallayout.cxx +++ b/vcl/source/gdi/sallayout.cxx @@ -722,16 +722,6 @@ bool SalLayout::GetBoundRect( SalGraphics& rSalGraphics, Rectangle& rRect ) cons return bRet; } -// FIXME: This function is just broken, it assumes any glyph at index 3 in the -// font is space, which though common is not a hard requirement and not the -// only glyph for space characters. Fix the call sites and fix them. -bool SalLayout::IsSpacingGlyph( sal_GlyphId nGlyph ) -{ - bool bRet = false; - bRet = (nGlyph == 3); - return bRet; -} - GenericSalLayout::GenericSalLayout() {} diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx index 3820d428cf46..fe54a3d69615 100644 --- a/vcl/source/outdev/font.cxx +++ b/vcl/source/outdev/font.cxx @@ -1303,7 +1303,7 @@ void OutputDevice::ImplDrawEmphasisMarks( SalLayout& rSalLayout ) if (!mpGraphics->GetGlyphBoundRect(*pGlyph, aRectangle ) ) continue; - if (!SalLayout::IsSpacingGlyph(pGlyph->maGlyphId)) + if (!pGlyph->IsSpacing()) { Point aAdjPoint = aOffset; aAdjPoint.X() += aRectangle.Left() + (aRectangle.GetWidth() - nEmphasisWidth) / 2; diff --git a/vcl/source/outdev/textline.cxx b/vcl/source/outdev/textline.cxx index c16fd4aa6511..6ac045977f06 100644 --- a/vcl/source/outdev/textline.cxx +++ b/vcl/source/outdev/textline.cxx @@ -757,7 +757,7 @@ void OutputDevice::ImplDrawTextLines( SalLayout& rSalLayout, FontStrikeout eStri while (rSalLayout.GetNextGlyphs(1, &pGlyph, aPos, nStart)) { // calculate the boundaries of each word - if (!SalLayout::IsSpacingGlyph(pGlyph->maGlyphId)) + if (!pGlyph->IsSpacing()) { if( !nWidth ) { |