From: Seoyeon Kim Date: Mon, 5 Nov 2018 08:20:05 +0000 (+0900) Subject: Revert "[Tizen] support match align for system language direciton" X-Git-Tag: accepted/tizen/5.0/unified/20181106.070355~15 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ce96793b0e8a68de6c562c1ad3114145b5223203;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git Revert "[Tizen] support match align for system language direciton" This reverts commit 1223956ada996a7663f727343f86267c184a57db. --- diff --git a/automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/toolkit-text-utils.cpp b/automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/toolkit-text-utils.cpp index ccd24b5..08f2c63 100755 --- a/automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/toolkit-text-utils.cpp +++ b/automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/toolkit-text-utils.cpp @@ -307,8 +307,7 @@ void CreateTextModel( const std::string& text, Text::HorizontalAlignment::BEGIN, Text::LineWrap::WORD, outlineWidth, - true, - false ); + true ); Vector& lines = visualModel->mLines; @@ -367,9 +366,7 @@ void CreateTextModel( const std::string& text, characterCount, Text::HorizontalAlignment::BEGIN, lines, - alignmentOffset, - Dali::LayoutDirection::LEFT_TO_RIGHT, - false ); + alignmentOffset ); } } diff --git a/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Layout.cpp b/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Layout.cpp old mode 100755 new mode 100644 index bc9d08b..ab15b46 --- a/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Layout.cpp +++ b/automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Layout.cpp @@ -174,8 +174,7 @@ bool LayoutTextTest( const LayoutTextData& data ) Text::HorizontalAlignment::BEGIN, Text::LineWrap::WORD, outlineWidth, - true, - false ); + true ); layoutParameters.isLastNewParagraph = isLastNewParagraph; @@ -395,8 +394,7 @@ bool ReLayoutRightToLeftLinesTest( const ReLayoutRightToLeftLinesData& data ) Text::HorizontalAlignment::BEGIN, Text::LineWrap::WORD, outlineWidth, - true, - false ); + true ); layoutParameters.numberOfBidirectionalInfoRuns = logicalModel->mBidirectionalLineInfo.Count(); layoutParameters.lineBidirectionalInfoRunsBuffer = logicalModel->mBidirectionalLineInfo.Begin(); @@ -449,8 +447,6 @@ struct AlignData unsigned int numberOfCharacters; unsigned int numberOfLines; float* lineOffsets; - Dali::LayoutDirection::Type layoutDirection; - bool matchSystemLanguageDirection; }; bool AlignTest( const AlignData& data ) @@ -503,9 +499,7 @@ bool AlignTest( const AlignData& data ) data.numberOfCharacters, data.horizontalAlignment, visualModel->mLines, - alignmentOffset, - data.layoutDirection, - data.matchSystemLanguageDirection ); + alignmentOffset ); // Compare results. if( data.numberOfLines != visualModel->mLines.Count() ) @@ -525,6 +519,7 @@ bool AlignTest( const AlignData& data ) return false; } } + return true; } @@ -4242,9 +4237,7 @@ int UtcDaliTextAlign01(void) 0u, 22u, 6u, - positions, - Dali::LayoutDirection::LEFT_TO_RIGHT, - false + positions }; if( !AlignTest( data ) ) @@ -4363,9 +4356,7 @@ int UtcDaliTextAlign02(void) 22u, 26u, 6u, - positions, - Dali::LayoutDirection::LEFT_TO_RIGHT, - false + positions }; if( !AlignTest( data ) ) @@ -4484,9 +4475,7 @@ int UtcDaliTextAlign03(void) 48u, 26u, 6u, - positions, - Dali::LayoutDirection::LEFT_TO_RIGHT, - false + positions }; if( !AlignTest( data ) ) @@ -4605,9 +4594,7 @@ int UtcDaliTextAlign04(void) 0u, 22u, 6u, - positions, - Dali::LayoutDirection::LEFT_TO_RIGHT, - false + positions }; if( !AlignTest( data ) ) @@ -4726,9 +4713,7 @@ int UtcDaliTextAlign05(void) 22u, 26u, 6u, - positions, - Dali::LayoutDirection::LEFT_TO_RIGHT, - false + positions }; if( !AlignTest( data ) ) @@ -4847,9 +4832,7 @@ int UtcDaliTextAlign06(void) 48u, 26u, 6u, - positions, - Dali::LayoutDirection::LEFT_TO_RIGHT, - false + positions }; if( !AlignTest( data ) ) @@ -4968,9 +4951,7 @@ int UtcDaliTextAlign07(void) 0u, 22u, 6u, - positions, - Dali::LayoutDirection::LEFT_TO_RIGHT, - false + positions }; if( !AlignTest( data ) ) @@ -5089,9 +5070,7 @@ int UtcDaliTextAlign08(void) 22u, 26u, 6u, - positions, - Dali::LayoutDirection::LEFT_TO_RIGHT, - false + positions }; if( !AlignTest( data ) ) @@ -5210,130 +5189,7 @@ int UtcDaliTextAlign09(void) 48u, 26u, 6u, - positions, - Dali::LayoutDirection::LEFT_TO_RIGHT, - false - }; - - if( !AlignTest( data ) ) - { - tet_result(TET_FAIL); - } - - tet_result(TET_PASS); - END_TEST; -} - -int UtcDaliTextAlign10(void) -{ - ToolkitTestApplication application; - tet_infoline(" UtcDaliTextAlign10"); - - // Calculate text alignment. - - const std::string fontLatin( "TizenSans" ); - const std::string fontHebrew( "TizenSansHebrew" ); - const std::string fontArabic( "TizenSansArabic" ); - - // Set a known font description - FontDescriptionRun fontDescriptionRun01; - fontDescriptionRun01.characterRun.characterIndex = 0u; - fontDescriptionRun01.characterRun.numberOfCharacters = 12u; - fontDescriptionRun01.familyLength = fontLatin.size(); - fontDescriptionRun01.familyName = new char[fontDescriptionRun01.familyLength]; - memcpy( fontDescriptionRun01.familyName, fontLatin.c_str(), fontDescriptionRun01.familyLength ); - fontDescriptionRun01.familyDefined = true; - fontDescriptionRun01.weightDefined = false; - fontDescriptionRun01.widthDefined = false; - fontDescriptionRun01.slantDefined = false; - fontDescriptionRun01.sizeDefined = false; - - FontDescriptionRun fontDescriptionRun02; - fontDescriptionRun02.characterRun.characterIndex = 12u; - fontDescriptionRun02.characterRun.numberOfCharacters = 10u; - fontDescriptionRun02.familyLength = fontHebrew.size(); - fontDescriptionRun02.familyName = new char[fontDescriptionRun02.familyLength]; - memcpy( fontDescriptionRun02.familyName, fontHebrew.c_str(), fontDescriptionRun02.familyLength ); - fontDescriptionRun02.familyDefined = true; - fontDescriptionRun02.weightDefined = false; - fontDescriptionRun02.widthDefined = false; - fontDescriptionRun02.slantDefined = false; - fontDescriptionRun02.sizeDefined = false; - - FontDescriptionRun fontDescriptionRun03; - fontDescriptionRun03.characterRun.characterIndex = 22u; - fontDescriptionRun03.characterRun.numberOfCharacters = 14u; - fontDescriptionRun03.familyLength = fontArabic.size(); - fontDescriptionRun03.familyName = new char[fontDescriptionRun03.familyLength]; - memcpy( fontDescriptionRun03.familyName, fontArabic.c_str(), fontDescriptionRun03.familyLength ); - fontDescriptionRun03.familyDefined = true; - fontDescriptionRun03.weightDefined = false; - fontDescriptionRun03.widthDefined = false; - fontDescriptionRun03.slantDefined = false; - fontDescriptionRun03.sizeDefined = false; - - FontDescriptionRun fontDescriptionRun04; - fontDescriptionRun04.characterRun.characterIndex = 36u; - fontDescriptionRun04.characterRun.numberOfCharacters = 12u; - fontDescriptionRun04.familyLength = fontLatin.size(); - fontDescriptionRun04.familyName = new char[fontDescriptionRun04.familyLength]; - memcpy( fontDescriptionRun04.familyName, fontLatin.c_str(), fontDescriptionRun04.familyLength ); - fontDescriptionRun04.familyDefined = true; - fontDescriptionRun04.weightDefined = false; - fontDescriptionRun04.widthDefined = false; - fontDescriptionRun04.slantDefined = false; - fontDescriptionRun04.sizeDefined = false; - - FontDescriptionRun fontDescriptionRun05; - fontDescriptionRun05.characterRun.characterIndex = 48u; - fontDescriptionRun05.characterRun.numberOfCharacters = 12u; - fontDescriptionRun05.familyLength = fontLatin.size(); - fontDescriptionRun05.familyName = new char[fontDescriptionRun05.familyLength]; - memcpy( fontDescriptionRun05.familyName, fontLatin.c_str(), fontDescriptionRun05.familyLength ); - fontDescriptionRun05.familyDefined = true; - fontDescriptionRun05.weightDefined = false; - fontDescriptionRun05.widthDefined = false; - fontDescriptionRun05.slantDefined = false; - fontDescriptionRun05.sizeDefined = false; - - FontDescriptionRun fontDescriptionRun06; - fontDescriptionRun06.characterRun.characterIndex = 60u; - fontDescriptionRun06.characterRun.numberOfCharacters = 14u; - fontDescriptionRun06.familyLength = fontArabic.size(); - fontDescriptionRun06.familyName = new char[fontDescriptionRun06.familyLength]; - memcpy( fontDescriptionRun06.familyName, fontArabic.c_str(), fontDescriptionRun06.familyLength ); - fontDescriptionRun06.familyDefined = true; - fontDescriptionRun06.weightDefined = false; - fontDescriptionRun06.widthDefined = false; - fontDescriptionRun06.slantDefined = false; - fontDescriptionRun06.sizeDefined = false; - - Vector fontDescriptionRuns; - fontDescriptionRuns.PushBack( fontDescriptionRun01 ); - fontDescriptionRuns.PushBack( fontDescriptionRun02 ); - fontDescriptionRuns.PushBack( fontDescriptionRun03 ); - fontDescriptionRuns.PushBack( fontDescriptionRun04 ); - fontDescriptionRuns.PushBack( fontDescriptionRun05 ); - fontDescriptionRuns.PushBack( fontDescriptionRun06 ); - - float positions[] = { -4.f, 0.f, 0.f, 0.f, 0.f, 0.f }; - - Size textArea( 100.f, 300.f ); - AlignData data = - { - "Begin alignment for the first paragraph.", - "Hello world שלום עולם\nمرحبا بالعالم Hello world\nHello world مرحبا بالعالم.", - textArea, - 6u, - fontDescriptionRuns.Begin(), - Text::HorizontalAlignment::END, - Text::VerticalAlignment::TOP, - 0u, - 22u, - 6u, - positions, - Dali::LayoutDirection::RIGHT_TO_LEFT, - true + positions }; if( !AlignTest( data ) ) diff --git a/automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp b/automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp old mode 100755 new mode 100644 index ffa0a61..f19cb12 --- a/automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp @@ -1062,22 +1062,6 @@ int UtcDaliToolkitTextlabelEllipsis(void) tet_result(TET_FAIL); } - - label.SetProperty( TextLabel::Property::TEXT, "Hello world" ); - label.SetProperty( DevelTextLabel::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION, true ); - label.SetSize( 400.0f, 10.f ); - - try - { - // Render the text. - application.SendNotification(); - application.Render(); - } - catch( ... ) - { - tet_result(TET_FAIL); - } - END_TEST; } @@ -1350,4 +1334,4 @@ int UtcDaliToolkitTextlabelVerticalLineAlignment(void) DALI_TEST_EQUALS( label.GetProperty< int >( DevelTextLabel::Property::VERTICAL_LINE_ALIGNMENT ), static_cast< int >( Toolkit::DevelText::VerticalLineAlignment::BOTTOM ), TEST_LOCATION ); END_TEST; -} +} \ No newline at end of file diff --git a/dali-toolkit/devel-api/controls/text-controls/text-label-devel.h b/dali-toolkit/devel-api/controls/text-controls/text-label-devel.h old mode 100755 new mode 100644 index ec6b935..0b16273 --- a/dali-toolkit/devel-api/controls/text-controls/text-label-devel.h +++ b/dali-toolkit/devel-api/controls/text-controls/text-label-devel.h @@ -101,27 +101,6 @@ namespace Property * @note The default value is true */ IGNORE_SPACES_AFTER_TEXT, - - /** - * @brief Modifies the default text alignment to match the direction of the system language. - * @details Name "matchSystemLanguageDirection", type (Property::BOLEAN), Read/Write - * @note The default value is false - * - * If MATCH_SYSTEM_LANGUAGE_DIRECTION property set true, the default text alignment to match the direction of the system language. - * - * ex) Current system language direction LTR. - * TextLabel::New("Hello world \n ﻡﺮﺤﺑﺍ. "); - * TextLabel::Property::HORIZONTAL_ALIGNMENT, "END" - * - * | TextLabel::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION | - * |----------------------------------------------------------------------- - * | false (default) | true | - * |-----------------------------------|----------------------------------| - * | Hello world | Hello world | - * | ﻡﺮﺤﺑﺍ. | ﻡﺮﺤﺑﺍ. | - * - */ - MATCH_SYSTEM_LANGUAGE_DIRECTION, }; } // namespace Property diff --git a/dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp b/dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp index af57128..94d0f20 100755 --- a/dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp +++ b/dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp @@ -1351,7 +1351,7 @@ void TextEditor::OnRelayout( const Vector2& size, RelayoutContainer& container ) mActiveLayer.SetPosition( padding.start, padding.top ); } - const Text::Controller::UpdateTextType updateTextType = mController->Relayout( contentSize, layoutDirection ); + const Text::Controller::UpdateTextType updateTextType = mController->Relayout( contentSize ); if( ( Text::Controller::NONE_UPDATED != updateTextType ) || !mRenderer ) diff --git a/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp b/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp index d4485ba..95e4765 100755 --- a/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp +++ b/dali-toolkit/internal/controls/text-controls/text-field-impl.cpp @@ -1397,7 +1397,7 @@ void TextField::OnRelayout( const Vector2& size, RelayoutContainer& container ) mActiveLayer.SetPosition( padding.start, padding.top ); } - const Text::Controller::UpdateTextType updateTextType = mController->Relayout( contentSize, layoutDirection ); + const Text::Controller::UpdateTextType updateTextType = mController->Relayout( contentSize ); if( ( Text::Controller::NONE_UPDATED != updateTextType ) || !mRenderer ) diff --git a/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp b/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp old mode 100755 new mode 100644 index 7a8c283..bb40d00 --- a/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp +++ b/dali-toolkit/internal/controls/text-controls/text-label-impl.cpp @@ -132,7 +132,6 @@ DALI_DEVEL_PROPERTY_REGISTRATION_READ_ONLY( Toolkit, TextLabel, "textDirection", DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextLabel, "verticalLineAlignment", INTEGER, VERTICAL_LINE_ALIGNMENT ) DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextLabel, "textBackground", MAP, BACKGROUND ) DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextLabel, "ignoreSpacesAfterText", BOOLEAN, IGNORE_SPACES_AFTER_TEXT ) -DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextLabel, "matchSystemLanguageDirection", BOOLEAN, MATCH_SYSTEM_LANGUAGE_DIRECTION ) DALI_ANIMATABLE_PROPERTY_REGISTRATION_WITH_DEFAULT( Toolkit, TextLabel, "textColor", Color::BLACK, TEXT_COLOR ) DALI_ANIMATABLE_PROPERTY_COMPONENT_REGISTRATION( Toolkit, TextLabel, "textColorRed", TEXT_COLOR_RED, TEXT_COLOR, 0 ) DALI_ANIMATABLE_PROPERTY_COMPONENT_REGISTRATION( Toolkit, TextLabel, "textColorGreen", TEXT_COLOR_GREEN, TEXT_COLOR, 1 ) @@ -540,11 +539,6 @@ void TextLabel::SetProperty( BaseObject* object, Property::Index index, const Pr impl.mController->SetIgnoreSpacesAfterText(value.Get< bool >()); break; } - case Toolkit::DevelTextLabel::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION: - { - impl.mController->SetMatchSystemLanguageDirection(value.Get< bool >()); - break; - } } // Request relayout when text update is needed. It's necessary to call it @@ -848,11 +842,6 @@ Property::Value TextLabel::GetProperty( BaseObject* object, Property::Index inde value = impl.mController->IsIgnoreSpacesAfterText(); break; } - case Toolkit::DevelTextLabel::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION: - { - value = impl.mController->IsMatchSystemLanguageDirection(); - break; - } } } @@ -973,10 +962,7 @@ void TextLabel::OnRelayout( const Vector2& size, RelayoutContainer& container ) Vector2 contentSize( size.x - ( padding.start + padding.end ), size.y - ( padding.top + padding.bottom ) ); - // Support Right-To-Left - Dali::LayoutDirection::Type layoutDirection = static_cast( Self().GetProperty( Dali::Actor::Property::LAYOUT_DIRECTION ).Get() ); - - const Text::Controller::UpdateTextType updateTextType = mController->Relayout( contentSize, layoutDirection ); + const Text::Controller::UpdateTextType updateTextType = mController->Relayout( contentSize ); if( ( Text::Controller::NONE_UPDATED != ( Text::Controller::MODEL_UPDATED & updateTextType ) ) || mTextUpdateNeeded ) @@ -987,6 +973,7 @@ void TextLabel::OnRelayout( const Vector2& size, RelayoutContainer& container ) TextVisual::EnableRendererUpdate( mVisual ); // Support Right-To-Left of padding + Dali::LayoutDirection::Type layoutDirection = static_cast( Self().GetProperty( Dali::Actor::Property::LAYOUT_DIRECTION ).Get() ); if( Dali::LayoutDirection::RIGHT_TO_LEFT == layoutDirection ) { std::swap( padding.start, padding.end ); diff --git a/dali-toolkit/internal/text/layouts/layout-engine.cpp b/dali-toolkit/internal/text/layouts/layout-engine.cpp old mode 100755 new mode 100644 index 0c3d9df..061707a --- a/dali-toolkit/internal/text/layouts/layout-engine.cpp +++ b/dali-toolkit/internal/text/layouts/layout-engine.cpp @@ -1104,9 +1104,7 @@ struct Engine::Impl Length numberOfCharacters, Text::HorizontalAlignment::Type horizontalAlignment, Vector& lines, - float& alignmentOffset, - Dali::LayoutDirection::Type layoutDirection, - bool matchSystemLanguageDirection ) + float& alignmentOffset ) { const CharacterIndex lastCharacterPlusOne = startIndex + numberOfCharacters; @@ -1134,9 +1132,7 @@ struct Engine::Impl // the box width, line length, and the paragraph's direction. CalculateHorizontalAlignment( size.width, horizontalAlignment, - line, - layoutDirection, - matchSystemLanguageDirection ); + line ); // Updates the alignment offset. alignmentOffset = std::min( alignmentOffset, line.alignmentOffset ); @@ -1145,24 +1141,16 @@ struct Engine::Impl void CalculateHorizontalAlignment( float boxWidth, HorizontalAlignment::Type horizontalAlignment, - LineRun& line, - Dali::LayoutDirection::Type layoutDirection, - bool matchSystemLanguageDirection ) + LineRun& line ) { line.alignmentOffset = 0.f; - bool isRTL = RTL == line.direction; + const bool isRTL = RTL == line.direction; float lineLength = line.width; - HorizontalAlignment::Type alignment = horizontalAlignment; - - // match align for system language direction - if( matchSystemLanguageDirection ) - { - isRTL = layoutDirection == LayoutDirection::RIGHT_TO_LEFT; - } - // Swap the alignment type if the line is right to left. + HorizontalAlignment::Type alignment = horizontalAlignment; if( isRTL ) { + // Swap the alignment type if the line is right to left. switch( alignment ) { case HorizontalAlignment::BEGIN: @@ -1181,7 +1169,6 @@ struct Engine::Impl break; } } - } // Calculate the horizontal line offset. @@ -1313,18 +1300,14 @@ void Engine::Align( const Size& size, Length numberOfCharacters, Text::HorizontalAlignment::Type horizontalAlignment, Vector& lines, - float& alignmentOffset, - Dali::LayoutDirection::Type layoutDirection, - bool matchSystemLanguageDirection ) + float& alignmentOffset ) { mImpl->Align( size, startIndex, numberOfCharacters, horizontalAlignment, lines, - alignmentOffset, - layoutDirection, - matchSystemLanguageDirection ); + alignmentOffset ); } void Engine::SetDefaultLineSpacing( float lineSpacing ) diff --git a/dali-toolkit/internal/text/layouts/layout-engine.h b/dali-toolkit/internal/text/layouts/layout-engine.h old mode 100755 new mode 100644 index 5e80d8c..66525d1 --- a/dali-toolkit/internal/text/layouts/layout-engine.h +++ b/dali-toolkit/internal/text/layouts/layout-engine.h @@ -21,7 +21,6 @@ // EXTERNAL INCLUDE #include #include -#include // INTERNAL INCLUDE #include @@ -141,17 +140,13 @@ public: * @param[in] horizontalAlignment The horizontal alignment. * @param[in,out] lines The laid-out lines. * @param[out] alignmentOffset The alignment offset. - * @param[in] layoutDirection The direction of the system language. - * @param[in] matchSystemLanguageDirection Whether match align for system language direction or not. */ void Align( const Size& size, CharacterIndex startIndex, Length numberOfCharacters, Text::HorizontalAlignment::Type horizontalAlignment, Vector& lines, - float& alignmentOffset, - Dali::LayoutDirection::Type layoutDirection, - bool matchSystemLanguageDirection ); + float& alignmentOffset ); /** * @brief Sets the default line spacing. diff --git a/dali-toolkit/internal/text/layouts/layout-parameters.h b/dali-toolkit/internal/text/layouts/layout-parameters.h old mode 100755 new mode 100644 index ecd1f6b..5a77d86 --- a/dali-toolkit/internal/text/layouts/layout-parameters.h +++ b/dali-toolkit/internal/text/layouts/layout-parameters.h @@ -60,9 +60,6 @@ struct Parameters * @param[in] totalNumberOfGlyphs The number of glyphs. * @param[in] horizontalAlignment The horizontal alignment. * @param[in] lineWrapMode The text wrap mode. - * @param[in] outlineWidth The outline width. - * @param[in] ignoreSpaceAfterText Whether ignoring spaces after text or not. - * @param[in] matchSystemLanguageDirection Whether match align for system language direction or not.. */ Parameters( const Vector2& boundingBox, const Character* const textBuffer, @@ -78,8 +75,7 @@ struct Parameters Text::HorizontalAlignment::Type horizontalAlignment, Text::LineWrap::Mode lineWrapMode, float outlineWidth, - bool ignoreSpaceAfterText, - bool matchSystemLanguageDirection ) + bool ignoreSpaceAfterText ) : boundingBox( boundingBox ), textBuffer( textBuffer ), lineBreakInfoBuffer( lineBreakInfoBuffer ), @@ -101,8 +97,7 @@ struct Parameters lineWrapMode( lineWrapMode ), outlineWidth( outlineWidth ), isLastNewParagraph( false ), - ignoreSpaceAfterText( ignoreSpaceAfterText ), - matchSystemLanguageDirection ( matchSystemLanguageDirection ) + ignoreSpaceAfterText( ignoreSpaceAfterText ) {} Vector2 boundingBox; ///< The size of the box containing the text. @@ -127,7 +122,6 @@ struct Parameters float outlineWidth; ///< The outline width. bool isLastNewParagraph:1; ///< Whether the last character is a new paragraph character. bool ignoreSpaceAfterText:1; ///< Whether ignoring spaces after text or not. Default is true. - bool matchSystemLanguageDirection:1; ///< Whether match align for system language direction or not. Default is false. }; } // namespace Layout diff --git a/dali-toolkit/internal/text/text-controller-impl.h b/dali-toolkit/internal/text/text-controller-impl.h index 3e50faf..34601f5 100755 --- a/dali-toolkit/internal/text/text-controller-impl.h +++ b/dali-toolkit/internal/text/text-controller-impl.h @@ -329,8 +329,7 @@ struct Controller::Impl mShadowSetByString( false ), mOutlineSetByString( false ), mFontStyleSetByString( false ), - mShouldClearFocusOnEscape( true ), - mLayoutDirection( LayoutDirection::LEFT_TO_RIGHT ) + mShouldClearFocusOnEscape( true ) { mModel = Model::New(); @@ -766,7 +765,6 @@ public: bool mOutlineSetByString:1; ///< Set when outline is set by string (legacy) instead of map bool mFontStyleSetByString:1; ///< Set when font style is set by string (legacy) instead of map bool mShouldClearFocusOnEscape:1; ///< Whether text control should clear key input focus - LayoutDirection::Type mLayoutDirection; ///< Current system language direction }; } // namespace Text diff --git a/dali-toolkit/internal/text/text-controller.cpp b/dali-toolkit/internal/text/text-controller.cpp index f0b496f..033433b 100755 --- a/dali-toolkit/internal/text/text-controller.cpp +++ b/dali-toolkit/internal/text/text-controller.cpp @@ -417,17 +417,6 @@ void Controller::SetIgnoreSpacesAfterText( bool ignore ) mImpl->mModel->mIgnoreSpacesAfterText = ignore; } -bool Controller::IsMatchSystemLanguageDirection() const -{ - return mImpl->mModel->mMatchSystemLanguageDirection; -} - -void Controller::SetMatchSystemLanguageDirection( bool match ) -{ - mImpl->mModel->mMatchSystemLanguageDirection = match; -} - - void Controller::SetLineWrapMode( Text::LineWrap::Mode lineWrapMode ) { if( lineWrapMode != mImpl->mModel->mLineWrapMode ) @@ -2239,13 +2228,12 @@ void Controller::SetVerticalLineAlignment( Toolkit::DevelText::VerticalLineAlign // public : Relayout. -Controller::UpdateTextType Controller::Relayout( const Size& size, Dali::LayoutDirection::Type layoutDirection ) +Controller::UpdateTextType Controller::Relayout( const Size& size ) { DALI_LOG_INFO( gLogFilter, Debug::Verbose, "-->Controller::Relayout %p size %f,%f, autoScroll[%s]\n", this, size.width, size.height, mImpl->mIsAutoScrollEnabled ?"true":"false" ); UpdateTextType updateTextType = NONE_UPDATED; - mImpl->mLayoutDirection = layoutDirection; if( ( size.width < Math::MACHINE_EPSILON_1000 ) || ( size.height < Math::MACHINE_EPSILON_1000 ) ) { if( 0u != mImpl->mModel->mVisualModel->mGlyphPositions.Count() ) @@ -3555,8 +3543,7 @@ bool Controller::DoRelayout( const Size& size, mImpl->mModel->mHorizontalAlignment, mImpl->mModel->mLineWrapMode, outlineWidth, - mImpl->mModel->mIgnoreSpacesAfterText, - mImpl->mModel->mMatchSystemLanguageDirection ); + mImpl->mModel->mIgnoreSpacesAfterText ); // Resize the vector of positions to have the same size than the vector of glyphs. Vector& glyphPositions = mImpl->mModel->mVisualModel->mGlyphPositions; @@ -3674,9 +3661,7 @@ bool Controller::DoRelayout( const Size& size, requestedNumberOfCharacters, mImpl->mModel->mHorizontalAlignment, lines, - mImpl->mModel->mAlignmentOffset, - mImpl->mLayoutDirection, - mImpl->mModel->mMatchSystemLanguageDirection ); + mImpl->mModel->mAlignmentOffset ); viewUpdated = true; } diff --git a/dali-toolkit/internal/text/text-controller.h b/dali-toolkit/internal/text/text-controller.h index f92a69d..25bb13b 100755 --- a/dali-toolkit/internal/text/text-controller.h +++ b/dali-toolkit/internal/text/text-controller.h @@ -1243,18 +1243,6 @@ public: // Queries & retrieves. */ void SetIgnoreSpacesAfterText( bool ignore ); - /** - * @brief Retrieves matchSystemLanguageDirection value from model - * @return The value of matchSystemLanguageDirection - */ - bool IsMatchSystemLanguageDirection() const; - - /** - * @brief Sets matchSystemLanguageDirection value to model - * @param[in] match The value of matchSystemLanguageDirection for the text - */ - void SetMatchSystemLanguageDirection( bool match ); - public: // Relayout. /** @@ -1262,11 +1250,10 @@ public: // Relayout. * * @note UI Controls are expected to minimize calls to this method e.g. call once after size negotiation. * @param[in] size A the size of a bounding box to layout text within. - * @param[in] layoutDirection The direction of the system language. * * @return Whether the text model or decorations were updated. */ - UpdateTextType Relayout( const Size& size, Dali::LayoutDirection::Type layoutDirection = Dali::LayoutDirection::LEFT_TO_RIGHT ); + UpdateTextType Relayout( const Size& size ); /** * @brief Request a relayout using the ControlInterface. diff --git a/dali-toolkit/internal/text/text-model.cpp b/dali-toolkit/internal/text/text-model.cpp index 474b3ae..65494e5 100755 --- a/dali-toolkit/internal/text/text-model.cpp +++ b/dali-toolkit/internal/text/text-model.cpp @@ -188,8 +188,7 @@ Model::Model() mLineWrapMode( Text::LineWrap::WORD ), mAlignmentOffset( 0.0f ), mElideEnabled( false ), - mIgnoreSpacesAfterText( true ), - mMatchSystemLanguageDirection( false ) + mIgnoreSpacesAfterText( true ) { mLogicalModel = LogicalModel::New(); mVisualModel = VisualModel::New(); diff --git a/dali-toolkit/internal/text/text-model.h b/dali-toolkit/internal/text/text-model.h index 688eac4..1ea725c 100755 --- a/dali-toolkit/internal/text/text-model.h +++ b/dali-toolkit/internal/text/text-model.h @@ -239,7 +239,6 @@ public: float mAlignmentOffset; ///< The alignment offset. bool mElideEnabled:1; ///< Whether the text's elide is enabled. bool mIgnoreSpacesAfterText:1; ///< Whether ignoring spaces after text or not. Default is true. - bool mMatchSystemLanguageDirection:1; ///< Whether match align for system language direction or not. Default is false. }; } // namespace Text diff --git a/dali-toolkit/internal/visuals/text/text-visual.cpp b/dali-toolkit/internal/visuals/text/text-visual.cpp index 4b3176c..b8edc7a 100755 --- a/dali-toolkit/internal/visuals/text/text-visual.cpp +++ b/dali-toolkit/internal/visuals/text/text-visual.cpp @@ -634,9 +634,7 @@ void TextVisual::UpdateRenderer() return; } - Dali::LayoutDirection::Type layoutDirection = static_cast( control.GetProperty( Dali::Actor::Property::LAYOUT_DIRECTION ).Get() ); - - const Text::Controller::UpdateTextType updateTextType = mController->Relayout( relayoutSize, layoutDirection ); + const Text::Controller::UpdateTextType updateTextType = mController->Relayout( relayoutSize ); if( Text::Controller::NONE_UPDATED != ( Text::Controller::MODEL_UPDATED & updateTextType ) || mRendererUpdateNeeded ) diff --git a/dali-toolkit/styles/1920x1080/dali-toolkit-default-theme.json b/dali-toolkit/styles/1920x1080/dali-toolkit-default-theme.json index 842a568..43bd4e5 100644 --- a/dali-toolkit/styles/1920x1080/dali-toolkit-default-theme.json +++ b/dali-toolkit/styles/1920x1080/dali-toolkit-default-theme.json @@ -67,8 +67,7 @@ "autoScrollLoopCount":2, "autoScrollGap":50, "autoScrollSpeed":80, - "ignoreSpacesAfterText":false, - "matchSystemLanguageDirection":true + "ignoreSpacesAfterText":false }, "TextLabelFontSize0": diff --git a/docs/content/images/text-controls/HelloWorld-Default-END.png b/docs/content/images/text-controls/HelloWorld-Default-END.png deleted file mode 100755 index 3302d08..0000000 Binary files a/docs/content/images/text-controls/HelloWorld-Default-END.png and /dev/null differ diff --git a/docs/content/images/text-controls/HelloWorld-System-END.png b/docs/content/images/text-controls/HelloWorld-System-END.png deleted file mode 100755 index 2794090..0000000 Binary files a/docs/content/images/text-controls/HelloWorld-System-END.png and /dev/null differ diff --git a/docs/content/shared-javascript-and-cpp-documentation/text-label.md b/docs/content/shared-javascript-and-cpp-documentation/text-label.md old mode 100755 new mode 100644 index 9b463e4..f1c3b77 --- a/docs/content/shared-javascript-and-cpp-documentation/text-label.md +++ b/docs/content/shared-javascript-and-cpp-documentation/text-label.md @@ -89,30 +89,6 @@ label.HorizontalAlignment = "BEGIN"; // "CENTER" or "END" | ![ ](../assets/img/text-controls/LatinEnd.png) ![ ](LatinEnd.png) | ![ ](../assets/img/text-controls/ArabicEnd.png) ![ ](ArabicEnd.png) | - -The text's alignment can be modified to match the direction of the system language. - -If the MATCH_SYSTEM_LANGUAGE_DIRECTION property is set to true then the direction of the text is ignored, instead the text is aligned as the system default language. - -~~~{.cpp} -// C++ - -label.SetProperty( TextLabel::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION, true ); -~~~ - -~~~{.js} -// JavaScript - -label.matchSystemLanguageDirection = true; -~~~ - -| | | -|--|--| -| Current system language direction left-to-right | | -| END alignment and MATCH_SYSTEM_LANGUAGE_DIRECTION set to TRUE. | END alignment and MATCH_SYSTEM_LANGUAGE_DIRECTION set to FALSE (default). | -| ![ ](HelloWorld-System-END.png) | ![ ](HelloWorld-Default-END.png) | - - The examples above assume that the TextLabel size greater than the minimum required. The next section provides details about the other size related options.