X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Ftext%2Frendering%2Fview-model.cpp;h=3046f455d3710b77b048a73af95dc5ba4b9ec199;hp=eb49465bd9dac714d0b2ba43eab8bce110d0fe38;hb=f0297c0a6b916f97737e3e1b46b6368cfb59b997;hpb=7b08f72b7f2a1b7467f9e3fd814fb415ecbc9657 diff --git a/dali-toolkit/internal/text/rendering/view-model.cpp b/dali-toolkit/internal/text/rendering/view-model.cpp old mode 100644 new mode 100755 index eb49465..3046f45 --- a/dali-toolkit/internal/text/rendering/view-model.cpp +++ b/dali-toolkit/internal/text/rendering/view-model.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * Copyright (c) 2019 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. @@ -61,16 +61,21 @@ const Vector2& ViewModel::GetScrollPosition() const return mModel->GetScrollPosition(); } -Layout::HorizontalAlignment ViewModel::GetHorizontalAlignment() const +HorizontalAlignment::Type ViewModel::GetHorizontalAlignment() const { return mModel->GetHorizontalAlignment(); } -Layout::VerticalAlignment ViewModel::GetVerticalAlignment() const +VerticalAlignment::Type ViewModel::GetVerticalAlignment() const { return mModel->GetVerticalAlignment(); } +DevelText::VerticalLineAlignment::Type ViewModel::GetVerticalLineAlignment() const +{ + return mModel->GetVerticalLineAlignment(); +} + bool ViewModel::IsTextElideEnabled() const { return mModel->IsTextElideEnabled(); @@ -86,6 +91,16 @@ const LineRun* const ViewModel::GetLines() const return mModel->GetLines(); } +Length ViewModel::GetNumberOfScripts() const +{ + return mModel->GetNumberOfScripts(); +} + +const ScriptRun* const ViewModel::GetScriptRuns() const +{ + return mModel->GetScriptRuns(); +} + Length ViewModel::GetNumberOfGlyphs() const { if( mIsTextElided && mModel->IsTextElideEnabled() ) @@ -138,11 +153,81 @@ const ColorIndex* const ViewModel::GetColorIndices() const return mModel->GetColorIndices(); } +const Vector4* const ViewModel::GetBackgroundColors() const +{ + return mModel->GetBackgroundColors(); +} + +const ColorIndex* const ViewModel::GetBackgroundColorIndices() const +{ + return mModel->GetBackgroundColorIndices(); +} + const Vector4& ViewModel::GetDefaultColor() const { return mModel->GetDefaultColor(); } +const Vector2& ViewModel::GetShadowOffset() const +{ + return mModel->GetShadowOffset(); +} + +const Vector4& ViewModel::GetShadowColor() const +{ + return mModel->GetShadowColor(); +} + +const float& ViewModel::GetShadowBlurRadius() const +{ + return mModel->GetShadowBlurRadius(); +} + +const Vector4& ViewModel::GetUnderlineColor() const +{ + return mModel->GetUnderlineColor(); +} + +bool ViewModel::IsUnderlineEnabled() const +{ + return mModel->IsUnderlineEnabled(); +} + +float ViewModel::GetUnderlineHeight() const +{ + return mModel->GetUnderlineHeight(); +} + +Length ViewModel::GetNumberOfUnderlineRuns() const +{ + return mModel->GetNumberOfUnderlineRuns(); +} + +void ViewModel::GetUnderlineRuns( GlyphRun* underlineRuns, UnderlineRunIndex index, Length numberOfRuns ) const +{ + mModel->GetUnderlineRuns( underlineRuns, index, numberOfRuns ); +} + +const Vector4& ViewModel::GetOutlineColor() const +{ + return mModel->GetOutlineColor(); +} + +uint16_t ViewModel::GetOutlineWidth() const +{ + return mModel->GetOutlineWidth(); +} + +const Vector4& ViewModel::GetBackgroundColor() const +{ + return mModel->GetBackgroundColor(); +} + +bool ViewModel::IsBackgroundEnabled() const +{ + return mModel->IsBackgroundEnabled(); +} + void ViewModel::ElideGlyphs() { mIsTextElided = false; @@ -222,7 +307,7 @@ void ViewModel::ElideGlyphs() // Need to reshape the glyph as the font may be different in size. const GlyphInfo& ellipsisGlyph = fontClient.GetEllipsisGlyph( fontClient.GetPointSize( glyphToRemove.fontId ) ); - if( !firstPenSet ) + if( !firstPenSet || EqualsZero( glyphToRemove.advance ) ) { const Vector2& position = *( elidedPositionsBuffer + index ); @@ -239,7 +324,10 @@ void ViewModel::ElideGlyphs() removedGlypsWidth = -ellipsisGlyph.xBearing; - firstPenSet = true; + if( !EqualsZero( firstPenX ) ) + { + firstPenSet = true; + } } removedGlypsWidth += std::min( glyphToRemove.advance, ( glyphToRemove.xBearing + glyphToRemove.width ) ); @@ -257,7 +345,6 @@ void ViewModel::ElideGlyphs() glyphInfo = ellipsisGlyph; // Change the 'x' and 'y' position of the ellipsis glyph. - if( position.x > firstPenX ) { position.x = firstPenX + removedGlypsWidth - ellipsisGlyphWidth;