// INTERNAL INCLUDES
#include <dali-toolkit/devel-api/controls/text-controls/text-label-devel.h>
#include <dali-toolkit/internal/text/glyph-metrics-helper.h>
+#include <dali-toolkit/internal/text/rendering/styles/character-spacing-helper-functions.h>
#include <dali-toolkit/internal/text/rendering/styles/strikethrough-helper-functions.h>
#include <dali-toolkit/internal/text/rendering/styles/underline-helper-functions.h>
#include <dali-toolkit/internal/text/rendering/view-model.h>
// Increases the vertical offset with the line's ascender.
glyphData.verticalOffset += static_cast<int>(line.ascender);
- // Include line spacing after first line
- if(lineIndex > 0u)
- {
- glyphData.verticalOffset += static_cast<int>(line.lineSpacing);
- }
-
// Retrieves the glyph's outline width
float outlineWidth = static_cast<float>(mModel->GetOutlineWidth());
}
}
- const bool underlineEnabled = mModel->IsUnderlineEnabled();
- const bool strikethroughEnabled = mModel->IsStrikethroughEnabled();
- const float characterSpacing = mModel->GetCharacterSpacing();
+ const bool underlineEnabled = mModel->IsUnderlineEnabled();
+ const bool strikethroughEnabled = mModel->IsStrikethroughEnabled();
+ const float modelCharacterSpacing = mModel->GetCharacterSpacing();
+
+ // Get the character-spacing runs.
+ const Vector<CharacterSpacingGlyphRun>& characterSpacingGlyphRuns = mModel->GetCharacterSpacingGlyphRuns();
// Aggregate underline-style-properties from mModel
const UnderlineStyleProperties modelUnderlineProperties{mModel->GetUnderlineType(),
if(addHyphen)
{
- GlyphInfo tempInfo = *(glyphsBuffer + elidedGlyphIndex);
- calculatedAdvance = GetCalculatedAdvance(*(textBuffer + (*(glyphToCharacterMapBuffer + elidedGlyphIndex))), characterSpacing, tempInfo.advance);
- position.x = position.x + calculatedAdvance - tempInfo.xBearing + glyphInfo->xBearing;
- position.y = -glyphInfo->yBearing;
+ GlyphInfo tempInfo = *(glyphsBuffer + elidedGlyphIndex);
+ const float characterSpacing = GetGlyphCharacterSpacing(glyphIndex, characterSpacingGlyphRuns, modelCharacterSpacing);
+ calculatedAdvance = GetCalculatedAdvance(*(textBuffer + (*(glyphToCharacterMapBuffer + elidedGlyphIndex))), characterSpacing, tempInfo.advance);
+ position.x = position.x + calculatedAdvance - tempInfo.xBearing + glyphInfo->xBearing;
+ position.y = -glyphInfo->yBearing;
}
if(baseline < position.y + glyphInfo->yBearing)
DrawStrikethrough(bufferWidth, bufferHeight, glyphData, baseline, strikethroughStartingYPosition, maxStrikethroughHeight, lineExtentLeft, lineExtentRight, modelStrikethroughProperties, currentStrikethroughProperties, line);
}
- // Increases the vertical offset with the line's descender.
- glyphData.verticalOffset += static_cast<int>(-line.descender);
+ // Increases the vertical offset with the line's descender & line spacing.
+ glyphData.verticalOffset += static_cast<int>(-line.descender+line.lineSpacing);
}
return glyphData.bitmapBuffer;