+ if((ellipsisPosition == DevelText::EllipsisPosition::START ||
+ (ellipsisPosition == DevelText::EllipsisPosition::MIDDLE && isSecondHalf)) &&
+ completelyFill && !isMultiline &&
+ (tmpLineLayout.length + tmpLineLayout.whiteSpaceLengthEndOfLine > targetWidth))
+ {
+ GlyphIndex glyphIndexToRemove = isSecondHalf ? tmpLineLayout.glyphIndexInSecondHalfLine : tmpLineLayout.glyphIndex;
+
+ while(tmpLineLayout.length + tmpLineLayout.whiteSpaceLengthEndOfLine > targetWidth && glyphIndexToRemove < glyphIndex)
+ {
+ GlyphMetrics glyphMetrics;
+ calculatedAdvance = GetCalculatedAdvance(*(textBuffer + (*(glyphToCharacterMapBuffer + glyphIndexToRemove))), characterSpacing, (*(glyphsBuffer + glyphIndexToRemove)).advance);
+ GetGlyphsMetrics(glyphIndexToRemove,
+ numberOfGLyphsInGroup,
+ glyphMetrics,
+ glyphsBuffer,
+ mMetrics,
+ calculatedAdvance);
+
+ const Length numberOfGLyphsInGroup = GetNumberOfGlyphsOfGroup(glyphIndexToRemove,
+ lastGlyphOfParagraphPlusOne,
+ charactersPerGlyphBuffer);
+
+ const Length charactersPerGlyph = *(charactersPerGlyphBuffer + glyphIndexToRemove + numberOfGLyphsInGroup - 1u);
+ const bool hasCharacters = charactersPerGlyph > 0u;
+ const CharacterIndex characterFirstIndex = *(glyphsToCharactersBuffer + glyphIndexToRemove);
+ const CharacterIndex characterLastIndex = characterFirstIndex + (hasCharacters ? charactersPerGlyph - 1u : 0u);
+
+ // Check whether is a white space.
+ const Character character = *(textBuffer + characterFirstIndex);
+ const bool isRemovedGlyphWhiteSpace = TextAbstraction::IsWhiteSpace(character);
+
+ if(isSecondHalf)
+ {
+ // Decrease the number of characters for SecondHalf.
+ tmpLineLayout.numberOfCharactersInSecondHalfLine -= charactersPerGlyph;
+
+ // Decrease the number of glyphs for SecondHalf.
+ tmpLineLayout.numberOfGlyphsInSecondHalfLine -= numberOfGLyphsInGroup;
+ }
+ else
+ {
+ // Decrease the number of characters.
+ tmpLineLayout.numberOfCharacters -= charactersPerGlyph;
+
+ // Decrease the number of glyphs.
+ tmpLineLayout.numberOfGlyphs -= numberOfGLyphsInGroup;
+ }
+
+ if(isRemovedGlyphWhiteSpace)
+ {
+ tmpLineLayout.penX -= glyphMetrics.advance;
+ tmpLineLayout.length -= glyphMetrics.advance;
+ }
+ else
+ {
+ tmpLineLayout.penX -= (glyphMetrics.advance + parameters.interGlyphExtraAdvance);
+ tmpLineLayout.length -= (std::min(glyphMetrics.advance + parameters.interGlyphExtraAdvance, glyphMetrics.xBearing + glyphMetrics.width));
+ }
+
+ if(isSecondHalf)
+ {
+ tmpLineLayout.glyphIndexInSecondHalfLine += numberOfGLyphsInGroup;
+ tmpLineLayout.characterIndexInSecondHalfLine = characterLastIndex + 1u;
+ glyphIndexToRemove = tmpLineLayout.glyphIndexInSecondHalfLine;
+ }
+ else
+ {
+ tmpLineLayout.glyphIndex += numberOfGLyphsInGroup;
+ tmpLineLayout.characterIndex = characterLastIndex + 1u;
+ glyphIndexToRemove = tmpLineLayout.glyphIndex;
+ }
+ }
+ }
+ else if((completelyFill || isMultiline) &&
+ (tmpLineLayout.length > targetWidth))