#include <dali-toolkit/devel-api/controls/control-depth-index-ranges.h>
#include <dali-toolkit/internal/graphics/builtin-shader-extern-gen.h>
#include <dali-toolkit/internal/text/cursor-helper-functions.h>
+#include <dali-toolkit/internal/text/rendering/styles/character-spacing-helper-functions.h>
#include <dali-toolkit/internal/text/text-view.h>
namespace Dali::Toolkit::Text
const Vector4* const backgroundColorsBuffer = textView.GetBackgroundColors();
const ColorIndex* const backgroundColorIndicesBuffer = textView.GetBackgroundColorIndices();
const Vector4& defaultBackgroundColor = textVisualModel->IsBackgroundEnabled() ? textVisualModel->GetBackgroundColor() : Color::TRANSPARENT;
- const float characterSpacing = textVisualModel->GetCharacterSpacing();
+ const float modelCharacterSpacing = textVisualModel->GetCharacterSpacing();
Vector<CharacterIndex>& glyphToCharacterMap = textVisualModel->mGlyphsToCharacters;
const CharacterIndex* glyphToCharacterMapBuffer = glyphToCharacterMap.Begin();
float calculatedAdvance = 0.f;
+ // Get the character-spacing runs.
+ const Vector<CharacterSpacingGlyphRun>& characterSpacingGlyphRuns = textVisualModel->GetCharacterSpacingGlyphRuns();
+
Vector4 quad;
uint32_t numberOfQuads = 0u;
Length yLineOffset = 0;
Length prevLineIndex = 0;
LineIndex lineIndex;
- Length numberOfLines;
for(uint32_t i = 0, glyphSize = glyphs.Size(); i < glyphSize; ++i)
{
const bool isDefaultBackgroundColor = (0u == backgroundColorIndex);
const Vector4& backgroundColor = isDefaultBackgroundColor ? defaultBackgroundColor : *(backgroundColorsBuffer + backgroundColorIndex - 1u);
- textVisualModel->GetNumberOfLines(i, 1, lineIndex, numberOfLines);
+ lineIndex = textVisualModel->GetLineOfGlyph(i);
Length lineHeight = CalculateBackgroundLineHeight(lineRun[lineIndex]);
if(lineIndex != prevLineIndex)
// Only create quads for glyphs with a background color
if(backgroundColor != Color::TRANSPARENT)
{
+ const float characterSpacing = GetGlyphCharacterSpacing(i, characterSpacingGlyphRuns, modelCharacterSpacing);
+
const Vector2 position = *(positionsBuffer + i);
calculatedAdvance = GetCalculatedAdvance(*(textLogicalModel->mText.Begin() + (*(glyphToCharacterMapBuffer + i))), characterSpacing, glyph.advance);