/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
}
}
+LineIndex VisualModel::GetLineOfGlyph( GlyphIndex glyphIndex )
+{
+ const CharacterIndex characterIndex = *(mGlyphsToCharacters.Begin() + glyphIndex);
+ return GetLineOfCharacter(characterIndex);
+}
+
void VisualModel::GetLinesOfGlyphRange(LineRun* lines,
GlyphIndex glyphIndex,
Length numberOfGlyphs) const
return index;
}
-void VisualModel::GetUnderlineRuns(GlyphRun* underlineRuns,
- UnderlineRunIndex index,
- Length numberOfRuns) const
+void VisualModel::GetUnderlineRuns(UnderlinedGlyphRun* underlineRuns,
+ UnderlineRunIndex index,
+ Length numberOfRuns) const
{
memcpy(underlineRuns,
mUnderlineRuns.Begin() + index,
- numberOfRuns * sizeof(GlyphRun));
+ numberOfRuns * sizeof(UnderlinedGlyphRun));
}
void VisualModel::SetNaturalSize(const Vector2& size)
mStrikethroughHeight = height;
}
+void VisualModel::SetCharacterSpacing(float characterSpacing)
+{
+ mCharacterSpacing = characterSpacing;
+}
+
const Vector4& VisualModel::GetTextColor() const
{
return mTextColor;
return mBackgroundColor;
}
+const float VisualModel::GetCharacterSpacing() const
+{
+ return mCharacterSpacing;
+}
+
bool VisualModel::IsBackgroundEnabled() const
{
return mBackgroundEnabled;
return mStrikethroughHeight;
}
+void VisualModel::GetStrikethroughRuns(StrikethroughGlyphRun* strikethroughRuns,
+ StrikethroughRunIndex index,
+ Length numberOfRuns) const
+{
+ memcpy(strikethroughRuns,
+ mStrikethroughRuns.Begin() + index,
+ numberOfRuns * sizeof(StrikethroughGlyphRun));
+}
+
+Length VisualModel::GetNumberOfStrikethroughRuns() const
+{
+ return mStrikethroughRuns.Count();
+}
+
+Length VisualModel::GetNumberOfCharacterSpacingGlyphRuns() const
+{
+ return mCharacterSpacingRuns.Count();
+}
+
+const Vector<CharacterSpacingGlyphRun>& VisualModel::GetCharacterSpacingGlyphRuns() const
+{
+ return mCharacterSpacingRuns;
+}
+
void VisualModel::ClearCaches()
{
mCachedLineIndex = 0u;
}
+const Vector<CharacterIndex>& VisualModel::GetGlyphsToCharacters() const
+{
+ return mGlyphsToCharacters;
+}
+
VisualModel::~VisualModel()
{
}
mUnderlineColorSet(false),
mBackgroundEnabled(false),
mMarkupProcessorEnabled(false),
- mStrikethroughEnabled(false)
+ mStrikethroughEnabled(false),
+ mCharacterSpacing(0.0f)
{
}