}
}
+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)
return mLayoutSize;
}
+void VisualModel::SetHeightForWidth(const Vector2& size)
+{
+ mHeightForWidth = size;
+}
+
+const Vector2& VisualModel::GetHeightForWidth() const
+{
+ return mHeightForWidth;
+}
+
void VisualModel::SetTextColor(const Vector4& textColor)
{
mTextColor = textColor;
mUnderlineColorSet = true;
}
+void VisualModel::SetOutlineOffset(const Vector2& outlineOffset)
+{
+ mOutlineOffset = outlineOffset;
+}
+
void VisualModel::SetOutlineColor(const Vector4& color)
{
mOutlineColor = color;
}
+void VisualModel::SetOutlineBlurRadius(const float& outlineBlurRadius)
+{
+ mOutlineBlurRadius = outlineBlurRadius;
+}
+
void VisualModel::SetUnderlineEnabled(bool enabled)
{
mUnderlineEnabled = enabled;
mStrikethroughHeight = height;
}
+void VisualModel::SetCharacterSpacing(float characterSpacing)
+{
+ mCharacterSpacing = characterSpacing;
+}
+
const Vector4& VisualModel::GetTextColor() const
{
return mTextColor;
return mUnderlineColor;
}
+const Vector2& VisualModel::GetOutlineOffset() const
+{
+ return mOutlineOffset;
+}
+
const Vector4& VisualModel::GetOutlineColor() const
{
return mOutlineColor;
}
+const float& VisualModel::GetOutlineBlurRadius() const
+{
+ return mOutlineBlurRadius;
+}
+
bool VisualModel::IsUnderlineEnabled() const
{
return mUnderlineEnabled;
return mBackgroundColor;
}
+const float VisualModel::GetCharacterSpacing() const
+{
+ return mCharacterSpacing;
+}
+
bool VisualModel::IsBackgroundEnabled() const
{
return mBackgroundEnabled;
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;
+}
+
+void VisualModel::SetCutoutEnabled(bool enable)
+{
+ mCutoutEnabled = enable;
+}
+
+bool VisualModel::IsCutoutEnabled() const
+{
+ return mCutoutEnabled;
+}
+
+void VisualModel::SetBackgroundWithCutoutEnabled(bool enable)
+{
+ mBackgroundWithCutoutEnabled = enable;
+}
+
+bool VisualModel::IsBackgroundWithCutoutEnabled() const
+{
+ return mBackgroundWithCutoutEnabled;
+}
+
+void VisualModel::SetBackgroundColorWithCutout(const Vector4& color)
+{
+ mBackgroundColorWithCutout = color;
+}
+
+const Vector4& VisualModel::GetBackgroundColorWithCutout() const
+{
+ return mBackgroundColorWithCutout;
+}
+
+void VisualModel::SetOffsetWithCutout(const Vector2& offset)
+{
+ mOffsetWithCutout = offset;
+}
+
+const Vector2& VisualModel::GetOffsetWithCutout() const
+{
+ return mOffsetWithCutout;
+}
+
VisualModel::~VisualModel()
{
}
mStrikethroughColor(Color::BLACK),
mControlSize(),
mShadowOffset(),
+ mOutlineOffset(),
mUnderlineHeight(0.0f),
mStrikethroughHeight(0.0f),
mUnderlineType(Text::Underline::SOLID),
mDashedUnderlineWidth(2.0f),
mDashedUnderlineGap(1.0f),
mShadowBlurRadius(0.0f),
+ mOutlineBlurRadius(0.0f),
mOutlineWidth(0u),
mNaturalSize(),
mLayoutSize(),
+ mHeightForWidth(0.0f, 0.0f),
mCachedLineIndex(0u),
mEllipsisPosition(DevelText::EllipsisPosition::END),
mStartIndexOfElidedGlyphs(0u),
mUnderlineColorSet(false),
mBackgroundEnabled(false),
mMarkupProcessorEnabled(false),
- mStrikethroughEnabled(false)
-
+ mStrikethroughEnabled(false),
+ mCharacterSpacing(0.0f),
+ mCutoutEnabled(false),
+ mBackgroundWithCutoutEnabled(false)
{
}