X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Fvisual-model-impl.cpp;h=5ef2b508ae747529144f4cd065b24369059d7b69;hb=702cdc29b907688eef62afbc63f0edb9e2dfb7d2;hp=e138e3cea45fcd7e003e066f172e564dc89cfc24;hpb=fa834a987e844fb79531954c882581624aef0e68;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/text/visual-model-impl.cpp b/dali-toolkit/internal/text/visual-model-impl.cpp index e138e3c..5ef2b50 100644 --- a/dali-toolkit/internal/text/visual-model-impl.cpp +++ b/dali-toolkit/internal/text/visual-model-impl.cpp @@ -1,5 +1,5 @@ /* - * 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. @@ -305,13 +305,13 @@ LineIndex VisualModel::GetLineOfCharacter(CharacterIndex characterIndex) 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) @@ -380,6 +380,21 @@ void VisualModel::SetUnderlineHeight(float height) mUnderlineHeight = height; } +void VisualModel::SetUnderlineType(Text::Underline::Type type) +{ + mUnderlineType = type; +} + +void VisualModel::SetDashedUnderlineWidth(float width) +{ + mDashedUnderlineWidth = width; +} + +void VisualModel::SetDashedUnderlineGap(float gap) +{ + mDashedUnderlineGap = gap; +} + void VisualModel::SetOutlineWidth(uint16_t width) { mOutlineWidth = width; @@ -445,6 +460,11 @@ void VisualModel::SetStrikethroughHeight(float height) mStrikethroughHeight = height; } +void VisualModel::SetCharacterSpacing(float characterSpacing) +{ + mCharacterSpacing = characterSpacing; +} + const Vector4& VisualModel::GetTextColor() const { return mTextColor; @@ -485,6 +505,21 @@ float VisualModel::GetUnderlineHeight() const return mUnderlineHeight; } +Text::Underline::Type VisualModel::GetUnderlineType() const +{ + return mUnderlineType; +} + +float VisualModel::GetDashedUnderlineWidth() const +{ + return mDashedUnderlineWidth; +} + +float VisualModel::GetDashedUnderlineGap() const +{ + return mDashedUnderlineGap; +} + uint16_t VisualModel::GetOutlineWidth() const { return mOutlineWidth; @@ -495,6 +530,11 @@ const Vector4& VisualModel::GetBackgroundColor() const return mBackgroundColor; } +const float VisualModel::GetCharacterSpacing() const +{ + return mCharacterSpacing; +} + bool VisualModel::IsBackgroundEnabled() const { return mBackgroundEnabled; @@ -555,11 +595,40 @@ float VisualModel::GetStrikethroughHeight() const 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& VisualModel::GetCharacterSpacingGlyphRuns() const +{ + return mCharacterSpacingRuns; +} + void VisualModel::ClearCaches() { mCachedLineIndex = 0u; } +const Vector& VisualModel::GetGlyphsToCharacters() const +{ + return mGlyphsToCharacters; +} + VisualModel::~VisualModel() { } @@ -582,6 +651,9 @@ VisualModel::VisualModel() mShadowOffset(), mUnderlineHeight(0.0f), mStrikethroughHeight(0.0f), + mUnderlineType(Text::Underline::SOLID), + mDashedUnderlineWidth(2.0f), + mDashedUnderlineGap(1.0f), mShadowBlurRadius(0.0f), mOutlineWidth(0u), mNaturalSize(), @@ -597,7 +669,8 @@ VisualModel::VisualModel() mUnderlineColorSet(false), mBackgroundEnabled(false), mMarkupProcessorEnabled(false), - mStrikethroughEnabled(false) + mStrikethroughEnabled(false), + mCharacterSpacing(0.0f) { }