// Enable the text elide.
controller->SetTextElideEnabled( true );
+
+ // Disable match system language direction
+ controller->SetMatchSystemLanguageDirection(false);
}
void ConfigureTextField( ControllerPtr controller )
// Disable the text elide.
controller->SetTextElideEnabled( false );
+
+ // Disable match system language direction
+ controller->SetMatchSystemLanguageDirection(false);
}
void ConfigureTextEditor( ControllerPtr controller )
// Disable the text elide.
controller->SetTextElideEnabled( false );
+
+ // Disable match system language direction
+ controller->SetMatchSystemLanguageDirection(false);
}
} // namespace Text
application.SendNotification();
application.Render();
- // The default value of MATCH_SYSTEM_LANGUAGE_DIRECTION is 'false'.
- DALI_TEST_EQUALS( editor.GetProperty<bool>( DevelTextEditor::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION ), false, TEST_LOCATION );
-
- // Check the enable match system language direction property
- editor.SetProperty( DevelTextEditor::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION, true );
+ // The default value of MATCH_SYSTEM_LANGUAGE_DIRECTION is 'true'.
DALI_TEST_EQUALS( editor.GetProperty<bool>( DevelTextEditor::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION ), true, TEST_LOCATION );
+ // Check the disable match system language direction property
+ editor.SetProperty( DevelTextEditor::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION, false );
+ DALI_TEST_EQUALS( editor.GetProperty<bool>( DevelTextEditor::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION ), false, TEST_LOCATION );
+
application.SendNotification();
application.Render();
application.SendNotification();
application.Render();
- // The default value of MATCH_SYSTEM_LANGUAGE_DIRECTION is 'false'.
- DALI_TEST_EQUALS( field.GetProperty<bool>( DevelTextField::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION ), false, TEST_LOCATION );
+ // The default value of MATCH_SYSTEM_LANGUAGE_DIRECTION is 'true'.
+ DALI_TEST_EQUALS( field.GetProperty<bool>( DevelTextField::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION ), true, TEST_LOCATION );
// Check the match system language direction property
- field.SetProperty( DevelTextField::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION, true );
- DALI_TEST_EQUALS( field.GetProperty<bool>( DevelTextField::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION ), true, TEST_LOCATION );
+ field.SetProperty( DevelTextField::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION, false );
+ DALI_TEST_EQUALS( field.GetProperty<bool>( DevelTextField::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION ), false, TEST_LOCATION );
application.SendNotification();
application.Render();
label.SetProperty( TextLabel::Property::TEXT, "Hello world" );
label.SetProperty( TextLabel::Property::POINT_SIZE, 20 );
+ label.SetProperty( DevelTextLabel::Property::MATCH_SYSTEM_LANGUAGE_DIRECTION, false );
application.GetScene().Add( label );
// Test LTR text
// CLASS HEADER
#include <dali-toolkit/internal/text/text-model.h>
+// EXTERNAL INCLUDES
+#include <dali/devel-api/adaptor-framework/environment-variable.h>
+
namespace Dali
{
namespace Toolkit
{
namespace Text
{
+namespace
+{
+const char* DALI_ENV_MATCH_SYSTEM_LANGUAGE_DIRECTION("DALI_MATCH_SYSTEM_LANGUAGE_DIRECTION");
+}
+
ModelPtr Model::New()
{
return ModelPtr(new Model());
mAlignmentOffset(0.0f),
mElideEnabled(false),
mIgnoreSpacesAfterText(true),
- mMatchSystemLanguageDirection(false)
+ mMatchSystemLanguageDirection(true)
{
mLogicalModel = LogicalModel::New();
mVisualModel = VisualModel::New();
+
+ // Check environment variable for DALI_MATCH_SYSTEM_LANGUAGE_DIRECTION
+ auto match = Dali::EnvironmentVariable::GetEnvironmentVariable(DALI_ENV_MATCH_SYSTEM_LANGUAGE_DIRECTION);
+ mMatchSystemLanguageDirection = match ? (std::atoi(match) == 0 ? false : true) : mMatchSystemLanguageDirection;
}
Model::~Model()