Update approval test for text Due to the patch below, there are some changes to the text placement position. https://review.tizen.org/gerrit/#/c/platform/core/uifw/dali-adaptor/+/294254/ Change-Id: Ia1c79209405beedd6c26a63ebcbfee9928b31725 Signed-off-by: Bowon Ryu <bowon.ryu@samsung.com>
Handle Emoji clustering for cursor handling Checked cases: - cursor movement (arrows): it works fine - line-breaking: it works fine Resolved cases: - deletion: this patch handled delete cases when the cursor is before or after Emoji :: Before: when use delete key and cursor is before Emoji :: After: when use backspace key and cursor is after Emoji - Emoji layoutted at the end of line: this patch handle the below scenario 1) When there is Emoji contains multi unicodes and it is layoutted at the end of line (LineWrap case , is not new line case) 2) Try to click at the center or at the end of Emoji then the cursor appears inside Emoji 3) Example:"FamilyManWomanGirlBoy 👨‍👩‍👧‍👦" Sample code to test: ============================================================================ TextEditor textEditor = TextEditor::New(); textEditor.SetBackgroundColor(Dali::Color::GRAY); textEditor.SetProperty(Dali::Toolkit::TextEditor::Property::TEXT, "AB👨‍👩‍👧‍👦AB👩🏻‍🔬B👨‍👩‍👧‍👦AA☪︎B☪️AB"); textEditor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT); textEditor.SetProperty(Dali::Actor::Property::POSITION, Vector2(10, 30)); textEditor.SetProperty(Dali::Actor::Property::SIZE, Vector2(100, 100)); textEditor.SetProperty(Dali::Toolkit::TextEditor::Property::ENABLE_MARKUP, true); textEditor.SetProperty(Dali::Toolkit::DevelTextEditor::Property::LINE_WRAP_MODE, Dali::Toolkit::DevelText::LineWrap::WORD); ============================================================================ Change-Id: I6d142c58c5cdef5e900404cca8b777a02c8488d1
Adding Character Spacing *********************************************************** Description: Adding the CHARACTER_SPACING for text-editor, text-field and text-label. CHARACTER_SPACING determines the spaces between characters. A positive value will make the characters far apart (expanded) and a negative value will bring them closer (condensed). The sample code below can be used to test the CHARACTER_SPACING. *********************************************************** using namespace Dali; using namespace Dali::Toolkit; class SimpleApp : public ConnectionTracker { public: SimpleApp(Application &application) : mApplication(application) { mApplication.InitSignal().Connect(this, &SimpleApp::Create); } void Create(Application &application) { Window window = application.GetWindow(); window.SetBackgroundColor(Vector4(0.04f, 0.345f, 0.392f, 1.0f)); mEditor = TextEditor::New(); mEditor.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER); mEditor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER); mEditor.SetProperty(Actor::Property::POSITION, Vector3(0.f, 0.0f, 0.f)); mEditor.SetProperty(Actor::Property::SIZE, Vector2(200.f, 100.0f)); mEditor.SetBackgroundColor(Vector4(0.04f, 0.345f, 0.392f, 1.0f)); mEditor.SetProperty(TextEditor::Property::TEXT, "A long text that exceeds the editor's width."); mEditor.SetProperty(DevelTextEditor::Property::CHARACTER_SPACING, 15.0f); // mLabel = TextLabel::New(); // mLabel.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER); // mLabel.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER); // mLabel.SetProperty(Actor::Property::POSITION, Vector3(0.f, 0.0f, 0.f)); // mLabel.SetProperty(Actor::Property::SIZE, Vector2(400.f, 200.0f)); // mLabel.SetProperty(TextLabel::Property::TEXT_COLOR, Color::BLACK); // mLabel.SetProperty(TextLabel::Property::TEXT, "A long text text text that exceeds the label's width."); // mLabel.SetProperty(DevelTextLabel::Property::CHARACTER_SPACING, 10.0f); // mLabel.SetProperty(TextLabel::Property::ELLIPSIS, false); // mField = TextField::New(); // mField.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER); // mField.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER); // mField.SetProperty(Actor::Property::POSITION, Vector3(0.f, 0.0f, 0.f)); // mField.SetProperty(Actor::Property::SIZE, Vector2(200.f, 100.0f)); // mField.SetProperty(TextField::Property::TEXT, "A long text text text that exceeds the field's width."); // mField.SetProperty(DevelTextField::Property::CHARACTER_SPACING, 10.0f); // mField.SetProperty(TextField::Property::ELLIPSIS, false); //window.Add(mLabel); window.Add(mEditor); //window.Add(mField); } bool OnButtonClicked(Button button) { if (button == mButton) { Vector3 originalSize = mEditor.GetNaturalSize(); } return true; } private: Application &mApplication; TextEditor mEditor; PushButton mButton; TextField mField; TextLabel mLabel; }; int DALI_EXPORT_API main(int argc, char **argv) { Application application = Application::New(&argc, &argv); SimpleApp test(application); application.MainLoop(); return 0; } Change-Id: Ibd89f1398e391dc56e3a230c7a136cfe07edc37a
Fixing Bug: Caret is too big with LineSpacing *********************************************************** Description When using LineSpacing or MinLineSize the caret size is too big and does not look good. The primary cursor height was obtaining its height from the line height (which includes the line spacing). I've modified it to obtain the height from the default font height. Please use the code below to test the issue and its fix. *********************************************************** using namespace Dali; using namespace Dali::Toolkit; class SimpleApp : public ConnectionTracker { public: SimpleApp(Application& application) : mApplication(application) { mApplication.InitSignal().Connect(this, &SimpleApp::Create); } void Create(Application& application) { Window window = application.GetWindow(); window.SetBackgroundColor(Vector4(0.04f, 0.345f, 0.392f, 1.0f)); mEditor = TextEditor::New(); mEditor.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER); mEditor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER); mEditor.SetProperty(Actor::Property::POSITION, Vector3(0.f, 0.0f, 0.f)); mEditor.SetProperty(Actor::Property::SIZE, Vector2(200.f, 100.0f)); mEditor.SetProperty(TextEditor::Property::TEXT, "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n"); mEditor.SetProperty(TextEditor::Property::ENABLE_MARKUP, true); mEditor.SetProperty(TextEditor::Property::POINT_SIZE, 40.0f); mEditor.SetBackgroundColor(Color::WHITE); mEditor.SetProperty( DevelTextEditor::Property::MIN_LINE_SIZE, 50.f ); window.Add(mEditor); } bool OnButtonClicked(Button button) { if(button == mButton) { Vector3 originalSize = mEditor.GetNaturalSize(); } return true; } private: Application &mApplication; TextEditor mEditor; PushButton mButton; TextField mField; }; int DALI_EXPORT_API main(int argc, char** argv) { Application application = Application::New(&argc, &argv); SimpleApp test(application); application.MainLoop(); return 0; } Change-Id: I8d8accbef03b69ba4e77f4f891bae08e37f93a00
(Automated Tests) Passing on Ubuntu 20.04 Change-Id: If9881757da2feef4fb2965cca76075ca490aee2b
Support Ellipsis Position Property Added new property Ellipsis to TextEditor Added new property Ellipsis_Position to TextLabel, TextField and TextEditor Example: textLabel.SetProperty(DevelTextLabel::Property::ELLIPSIS_POSITION, DevelText::EllipsisPosition::START); Handled Ellipsis location for below cases: Positions: END, START and MIDDLE TextController: TextLabel, TextField and TextEditor SingleLine and Muilt-lines with differnat LineWrap modes Text direction LTR and RTL END algorithm already exits START and MIDDLE algorithms added according to END one Change-Id: If059878f7128141169e95cf237b690ce900c70b3
Add text wrapping hyphen mode support related to https://review.tizen.org/gerrit/c/platform/core/uifw/dali-adaptor/+/254278 using namespace Dali; using namespace Dali::Toolkit; class SimpleApp : public ConnectionTracker { public: SimpleApp(Application& application) : mApplication(application) { mApplication.InitSignal().Connect(this, &SimpleApp::Create); } void Create(Application& application) { Window window = mApplication.GetWindow(); mEditor = TextEditor::New(); mEditor.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER); mEditor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER); mEditor.SetProperty(Actor::Property::POSITION, Vector3(0.f, 0.0f, 0.f)); mEditor.SetProperty(Actor::Property::SIZE, Vector2(150, 300.0f)); window.SetBackgroundColor(Vector4(0.04f, 0.345f, 0.392f, 1.0f)); mEditor.SetProperty(TextEditor::Property::POINT_SIZE, 26.f); mEditor.SetProperty(TextEditor::Property::TEXT, "Experimental!!!!"); mEditor.SetProperty(TextEditor::Property::LINE_WRAP_MODE, Text::LineWrap::HYPHENATION); window.Add(mEditor); } private: Application& mApplication; TextEditor mEditor; }; int DALI_EXPORT_API main(int argc, char** argv) { Application application = Application::New(&argc, &argv); SimpleApp test(application); application.MainLoop(); return 0; } Change-Id: I736a8d251d1f7fb364b7bfb26520767dfd019ccb
Corrects the position. This required correction as the advance value changed after the patch https://review.tizen.org/gerrit/#/c/platform/core/uifw/dali-adaptor/+/236448/ And after applying this patch, there is a pixel alignment issue in TextField. So I add a sampler NEAREST. Change-Id: I314cd9bf5d4db9a2b7ab04b6581ac63dd1bd886a
The advance of the letters is too narrow. So, remove the floor. Change-Id: Ia45a2a9af47f3f780c562cd619dda82f8a017a37
Layout fixes. * Fixes some alignment issues with RTL text. * Reorders the RTL lines while the text is laid-out. It might happen that the length of the text changes after the reordering. In that case if the lines are reordered outside the layout engine update the lenght at that step is too late. Change-Id: If7b3bf488bde75c538a646aa48b7dfe3083597b8 Signed-off-by: Victor Cebollada <v.cebollada@samsung.com>
Text cleaning. * Refactor the Layout::Parameters struct * Remove unnecesary code. Change-Id: I1ebd7a01b3d7fe33917d51c481b536118c5c9bae Signed-off-by: Victor Cebollada <v.cebollada@samsung.com>
Text - Layout improvement. * Retrieved font metrics are not rounded. The position is rounded when is set to the glyph. Change-Id: I379a372cf5c7decaf8eea917a7da5839a58f2cd4
Add bidirectional text tct. Add bidirectional text tct. For this, made CreateTextModel() can support markup text. Change-Id: I13ad4025635ba257611875284563bce09d8c6192 Signed-off-by: minho.sun <minho.sun@samsung.com>
Fixed for single line text updates - Fixed a SINGLE_LINE_BOX text update bug. Change-Id: If1742cf19ffd75cda66ec705ae611ec8340ef48c Signed-off-by: Seoyeon Kim <seoyeon2.kim@samsung.com>
Update double tap and long press behaviour. It updates the double tap and long press event on a text area with no text. i.e. On a position clearly after the last character of the text. * Double Tap : The cursor is placed at the beginning or at the end of the text. * Long Press : The cursor is placed at the beginning or at the end of the text and shows the text's selection popup. Change-Id: Iaf9ea817a515781d20c87f60991e1996d5440a62 Signed-off-by: Victor Cebollada <v.cebollada@samsung.com>
ModelView implementation. * Creates an interface to access the text's model from the text rendering modules. * In the case the text is elided, it stores a copy of the elided text, the ellipsis glyph and the modified layout. * It creates a basic Text::RenderingController class which stores the pointer to the text's model. Change-Id: Ied29583a0e1648dab9d78575dcbc042353c949dc Signed-off-by: Victor Cebollada <v.cebollada@samsung.com>
Multi-line text. Cursor hit and cursor's position. Change-Id: I28f664ea7d1dfed61fcd4e69a3de8ec850b4df58 Signed-off-by: Victor Cebollada <v.cebollada@samsung.com>