X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Ftext-view.cpp;h=9b34dd437c4439c825a20c0002a38c89d2d456c2;hp=a5a6b3b2c485357c54c1cba98c6badf8479386de;hb=0c862d5823332bc2161c64f901395f2390c82fd2;hpb=17655f69059d8b9f766f350501b3f1ba5efb7231 diff --git a/dali-toolkit/internal/text/text-view.cpp b/dali-toolkit/internal/text/text-view.cpp index a5a6b3b..9b34dd4 100644 --- a/dali-toolkit/internal/text/text-view.cpp +++ b/dali-toolkit/internal/text/text-view.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. @@ -213,7 +213,7 @@ Length View::GetGlyphs(GlyphInfo* glyphs, if(lastGlyphIndexOfLine == index) { - penY += -line->descender; + penY += -line->descender + line->lineSpacing; // Get the next line. ++lineIndex; @@ -225,7 +225,7 @@ Length View::GetGlyphs(GlyphInfo* glyphs, lastGlyphIndexOfLine = (line->isSplitToTwoHalves ? line->glyphRunSecondHalf.glyphIndex + line->glyphRunSecondHalf.numberOfGlyphs : line->glyphRun.glyphIndex + line->glyphRun.numberOfGlyphs) - 1u; - penY += line->ascender + line->lineSpacing; + penY += line->ascender; } } } @@ -625,6 +625,36 @@ float View::GetUnderlineHeight() const return 0.0f; } +Text::Underline::Type View::GetUnderlineType() const +{ + Text::Underline::Type type = Text::Underline::Type::SOLID; + if(mImpl->mVisualModel) + { + type = mImpl->mVisualModel->GetUnderlineType(); + } + return type; +} + +float View::GetDashedUnderlineWidth() const +{ + float width = 0.0f; + if(mImpl->mVisualModel) + { + width = mImpl->mVisualModel->GetDashedUnderlineWidth(); + } + return width; +} + +float View::GetDashedUnderlineGap() const +{ + float gap = 0.0f; + if(mImpl->mVisualModel) + { + gap = mImpl->mVisualModel->GetDashedUnderlineGap(); + } + return gap; +} + Length View::GetNumberOfUnderlineRuns() const { if(mImpl->mVisualModel) @@ -742,6 +772,43 @@ GlyphIndex View::GetSecondMiddleIndexOfElidedGlyphs() const return secondMiddleIndexOfElidedGlyphs; } +const Vector4& View::GetStrikethroughColor() const +{ + return (mImpl->mVisualModel) ? mImpl->mVisualModel->GetStrikethroughColor() : Vector4::ZERO; +} + +bool View::IsStrikethroughEnabled() const +{ + return (mImpl->mVisualModel) ? mImpl->mVisualModel->IsStrikethroughEnabled() : false; +} + +float View::GetStrikethroughHeight() const +{ + return (mImpl->mVisualModel) ? mImpl->mVisualModel->GetStrikethroughHeight() : 0.0f; +} + +Length View::GetNumberOfStrikethroughRuns() const +{ + if(mImpl->mVisualModel) + { + return mImpl->mVisualModel->GetNumberOfStrikethroughRuns(); + } + + return 0u; +} + +void View::GetStrikethroughRuns(StrikethroughGlyphRun* strikethroughRuns, + StrikethroughRunIndex index, + Length numberOfRuns) const +{ + if(mImpl->mVisualModel) + { + mImpl->mVisualModel->GetStrikethroughRuns(strikethroughRuns, + index, + numberOfRuns); + } +} + } // namespace Text } // namespace Toolkit