glyphInfo = ellipsisGlyph;
// Change the 'x' and 'y' position of the ellipsis glyph.
-
if(position.x > firstPenX)
{
- position.x = firstPenX + removedGlypsWidth - ellipsisGlyphWidth;
+ if(isTailMode)
+ {
+ // To handle case of the mixed languages (LTR then RTL) with
+ // EllipsisPosition::END and the LayoutDirection::RIGHT_TO_LEFT
+ float nextXPositions = ellipsisLine->width;
+ if(indexOfEllipsis + 1u < numberOfGlyphs)
+ {
+ Vector2& positionOfNextGlyph = *(glyphPositions + indexOfEllipsis + 1u);
+ nextXPositions = positionOfNextGlyph.x;
+ }
+
+ if(position.x > nextXPositions) // RTL language
+ {
+ if((indexOfEllipsis > 0u) && ((position.x - nextXPositions) > removedGlypsWidth))
+ {
+ // To handle mixed directions
+ // Re-calculates the first penX which will be used if rtl text is elided.
+ firstPenX = position.x - glyphToRemove.xBearing;
+ if(firstPenX < -ellipsisGlyph.xBearing)
+ {
+ // Avoids to exceed the bounding box when rtl text is elided.
+ firstPenX = -ellipsisGlyph.xBearing;
+ }
+ //Reset the width of removed glyphs
+ removedGlypsWidth = std::min(calculatedAdvance, (glyphToRemove.xBearing + glyphToRemove.width)) - ellipsisGlyph.xBearing;
+
+ --indexOfEllipsis;
+ continue;
+ }
+ else
+ {
+ // To handle the case of RTL language with EllipsisPosition::END
+ position.x = firstPenX + removedGlypsWidth - ellipsisGlyphWidth;
+ }
+ }
+ }
+ else
+ {
+ // To handle the case of LTR language with EllipsisPosition::START
+ position.x = firstPenX + removedGlypsWidth - ellipsisGlyphWidth;
+ }
+ }
+ else
+ {
+ if(!isTailMode)
+ {
+ // To handle case of the mixed languages (RTL then LTR) with
+ // EllipsisPosition::START and the LayoutDirection::RIGHT_TO_LEFT
+ float nextXPositions = ellipsisLine->width;
+ if(indexOfEllipsis + 1u < numberOfGlyphs)
+ {
+ Vector2& positionOfNextGlyph = *(glyphPositions + indexOfEllipsis + 1u);
+ nextXPositions = positionOfNextGlyph.x;
+ }
+
+ if(position.x < nextXPositions) // LTR language
+ {
+ position.x = firstPenX + removedGlypsWidth - ellipsisGlyphWidth;
+
+ if((position.x + ellipsisGlyphWidth + ellipsisGlyph.xBearing) > nextXPositions)
+ {
+ position.x -= (position.x + ellipsisGlyphWidth + ellipsisGlyph.xBearing) - nextXPositions;
+ }
+ }
+ }
}
position.x += ellipsisGlyph.xBearing;
return numberOfLaidOutGlyphs;
}
-const Vector4* const View::GetColors() const
+const Vector4* View::GetColors() const
{
if(mImpl->mVisualModel)
{
return NULL;
}
-const ColorIndex* const View::GetColorIndices() const
+const ColorIndex* View::GetColorIndices() const
{
if(mImpl->mVisualModel)
{
return NULL;
}
-const Vector4* const View::GetBackgroundColors() const
+const Vector4* View::GetBackgroundColors() const
{
if(mImpl->mVisualModel)
{
return nullptr;
}
-const ColorIndex* const View::GetBackgroundColorIndices() const
+const ColorIndex* View::GetBackgroundColorIndices() const
{
if(mImpl->mVisualModel)
{
return nullptr;
}
-bool const View::IsMarkupBackgroundColorSet() const
+bool View::IsMarkupBackgroundColorSet() const
{
if(mImpl->mVisualModel)
{
return false;
}
+bool View::IsMarkupUnderlineSet() const
+{
+ return (GetNumberOfUnderlineRuns() > 0u);
+}
+
const GlyphInfo* View::GetHyphens() const
{
if(mImpl->mVisualModel)
return (mImpl->mVisualModel) ? mImpl->mVisualModel->IsStrikethroughEnabled() : false;
}
+bool View::IsMarkupStrikethroughSet() const
+{
+ return (GetNumberOfStrikethroughRuns() > 0u);
+}
+
float View::GetStrikethroughHeight() const
{
return (mImpl->mVisualModel) ? mImpl->mVisualModel->GetStrikethroughHeight() : 0.0f;
return mImpl->mLogicalModel->GetBoundedParagraphRuns();
}
-Length View::GetNumberOfCharacterSpacingGlyphRuns() const
-{
- return (mImpl->mVisualModel) ? mImpl->mVisualModel->GetNumberOfCharacterSpacingGlyphRuns() : 0u;
-}
-
-const Vector<CharacterSpacingGlyphRun>& View::GetCharacterSpacingGlyphRuns() const
-{
- return (mImpl->mVisualModel) ? mImpl->mVisualModel->GetCharacterSpacingGlyphRuns() : GetEmptyCharacterSpacingGlyphRuns();
-}
-
-const float View::GetCharacterSpacing() const
+float View::GetCharacterSpacing() const
{
- return (mImpl->mVisualModel) ? mImpl->mVisualModel->GetCharacterSpacing() : 0.f;
+ return mImpl->mVisualModel->GetCharacterSpacing();
}
const Character* View::GetTextBuffer() const
{
- return (mImpl->mVisualModel) ? mImpl->mLogicalModel->mText.Begin() : nullptr;
+ return mImpl->mLogicalModel->mText.Begin();
}
const Vector<CharacterIndex>& View::GetGlyphsToCharacters() const