Moved Text Controller & Markup Processor to sub-folders Change-Id: If5a17c1c568584840ec7f07ebe24cd72bc6a0356
Support align attribute for paragraph tag in markup <p align='center'> text </p> Values: begin | center | end //How to apply it: textEditorMultiAlign.SetProperty(TextEditor::Property::TEXT, "text outside<p align='end'>Paragraph end</p><p align='center'>Paragraph center</p><p align='begin' >Paragraph begin</p><p>Paragraph property alignment</p>"); textEditorMultiAlign.SetProperty(TextEditor ::Property::ENABLE_MARKUP, true); //The alignment on property level works on outside text or on a paragraph without the align attribute textEditorMultiAlign.SetProperty(TextEditor::Property::HORIZONTAL_ALIGNMENT, Dali::Toolkit::Text::HorizontalAlignment::CENTER); Change-Id: I3ccd6e6669a5887cdcbfa80be44998fd487e580c
Refactor some parts in Markup processor Simplify some functions and reduce duplicated code Adding some needed common functions Change-Id: I41104772649633e5bfe864d8b23730f1a4ff26a6
Extending Text Styles - Adding Dashed/Double Underline *********************************************************** Description: Adding the dashed & double underlines for the text-editor and the text-label. The sample code below can be used to test the underline using the property maps. the type can be specified to be DASHED or DOUBLE and if left unspecified, the default is the SOLID underline. Other params can be specified such as the color, color2, type, width and gap. Their defaults are respectively: black, black, SOLID, 2 and 1. *********************************************************** 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)); //text editor dashed underline 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, "Sara"); //label code // TextLabel label = TextLabel::New(); // label.SetProperty(Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_CENTER); // label.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_CENTER); // label.SetProperty(Actor::Property::POSITION, Vector3(0.f, 0.0f, 0.f)); // label.SetProperty(Actor::Property::SIZE, Vector2(200.f, 100.0f)); // label.SetBackgroundColor(Vector4(0.04f, 0.345f, 0.392f, 1.0f)); // label.SetProperty(TextEditor::Property::TEXT, "Sara"); // use the code below for the text-editor Property::Map underlineMapSet; underlineMapSet.Insert("enable", true); underlineMapSet.Insert("color", Color::RED); underlineMapSet.Insert("height", 1); underlineMapSet.Insert("type", Text::Underline::DASHED); underlineMapSet.Insert("dashWidth", 5); underlineMapSet.Insert("dashGap", 3); mEditor.SetProperty(TextEditor::Property::UNDERLINE, underlineMapSet); //use the code below for the text-label // Property::Map underlineMapSet; // underlineMapSet.Insert("enable",true); // underlineMapSet.Insert("color", Color::RED); // underlineMapSet.Insert("height", 1); // underlineMapSet.Insert("type", Text::Underline::DASHED); // underlineMapSet.Insert("dashWidth", 5); // underlineMapSet.Insert("dashGap", 3); // label.SetProperty(TextLabel::Property::UNDERLINE, underlineMapSet); //window.Add(label); window.Add(mEditor); } bool OnButtonClicked(Button button) { if(button == mButton) { Vector3 originalSize = mEditor.GetNaturalSize(); } return true; } private: Application& mApplication; TextEditor mEditor; PushButton mButton; }; int DALI_EXPORT_API main(int argc, char** argv) { Application application = Application::New(&argc, &argv); SimpleApp test(application); application.MainLoop(); return 0; } *********************************************************** Change-Id: Ie89bcf532ffc3d5ad19d7b39261ac10f4f1b2fda
Updated all header files to new format Change-Id: I68b3cf032fa1758fff92509f463101bdfd36cce1
Purge underscored header file barriers Change-Id: I167a9472588dd950f075991332325dd5f22edc05
Text improvement 1. Text - Layout text & icons. * Feature added to layout text and icons. Icons can be added using the mark-up string feature. i.e. "Hello <item 'url'='icon.png'/>" The icon can be resized with the 'width' and 'height' properties. "Hello <item 'url'='icon.png' 'width'=24 'height'=24/>" Optionally only a size can be specified. The layout engine will layout the text with the gaps of the given size and retrieve the layout info of those gaps. It's the responsability of the user to fill the pixel buffer with the images. * New 'item' tag added to the mark-up processor. 2. Text - Bitmap fonts * Add support for bitmap fonts. 3. Text renderer utils - Set color to glyphs. * Required to set the color of the embedded items and the glyphs of the bitmap fonts. * Attribute added to the <item> tag that specifies if the color of the item has to be blended with the color of the text. * <color> tag processed and sent to the TextRenderer class in adaptor. * The color of font and bitmap font glyphs can be set individually with the <color> tag in a markup string or globally if the default color is set. If no default color is set, font glyphs will be white and bitmap font glyphs will use their colors. * By default embedded items will use their colors. If the attribute 'color-blending' is set to 'multiply' the color of the text will be multiplied by the color of the item image. If the image is white the result will be the color of the text. "Hello <item 'url'='image.png' 'color-blending'='multiply'> 4. Text Utils - Render color Emojis. * Cairo renders Emojis in black and white. This patch tells the Cairo renderer whether each glyph is an Emoji. 5. Circular text implementation. * New parameters added to the DevelText::RendererParameters struct for circular text. - layout: The type of layout: one of {"singleLine", "multiLine", "circular"} - circularAlignment: The text alignment within the arc: one of {"begin", "center", "end"} - radius: The radius in pixels of the circular text. Measured from the center to the top of the line. - beginAngle: The begin angle in degrees of the text area on the circle. The top of the circle is 0°, the right side 90°, the bottom 180° and the left 270°. - incrementAngle: The increment angle in degrees of the text area on the circle. The @p incrementAngle defines a direction. If positive, the text will be laid out clockwise. @note the horizontalAlignment and verticalAlignment can be used to align the whole text within the text area. * Example: How to set parameters for circular text from a C++ application Dali::Toolkit::DevelText::RendererParameters textParameters; textParameters.text = "Hello world, this is a demo of circular text."; textParameters.horizontalAlignment = "center"; textParameters.verticalAlignment = "center"; textParameters.circularAlignment = "center"; textParameters.layout = "circular"; textParameters.textColor = Color::BLACK; textParameters.fontSize = 16.f; textParameters.textWidth = 360u; textParameters.textHeight = 360u; textParameters.radius = 130u; textParameters.beginAngle = 180.f; textParameters.incrementAngle = 360.f; textParameters.ellipsisEnabled = true; 6. Text Utils - Rotate emojis/embedded items. * Retrieves the layout for rotated embedded items added in a second step. * When the emoji glyph is the one that is replaced by the ellipsis glyph, the 'isEmoji' vector pased to the cairo-renderer needs to be updated to state that '...' is not an emoji. 7. Software italic/bold issues fixed. * Fixes issues with the synthesis of bold and italic style by software. Change-Id: I74129ae2e79e23e825a2ef92baa651d7db4e1e57
Text outline support in TextField & TextEditor Measured using memps on TM1 target by creating 500 TextFields. Memory consumption is increased by 9% after outline is enabled. Without outiline, the memory comsumption is almost the same as before. TextField with text only (no outline): Before applying this patch: PID CODE DATA PEAK PSS 3D GEM(PSS) 11272 13572 75120 88692 76920 58860 5568 After applying this patch: PID CODE DATA PEAK PSS 3D GEM(PSS) 5782 13580 75244 88824 77055 58508 5568 TextField with text and outline: After applying this patch: PID CODE DATA PEAK PSS 3D GEM(PSS) 5851 13588 82056 95644 83874 63364 5568 Change-Id: I9838fb0867102e920bcc07650ff5c3a8903a7e24
Convert the Underline and Shadow deprecated APIs to the new ones. This needs to be done to pass the UTC in the TextVisual patch currently in developement. Change-Id: I517fba6b78115d9bf77ea0998c54e500475102a6 Signed-off-by: Victor Cebollada <v.cebollada@samsung.com>
Markup procesor - Font. Signed-off-by: Victor Cebollada <v.cebollada@samsung.com> Change-Id: Icd3e97862b96f2631a17595136359a08fdfd2371
Markup procesor. Color Change-Id: I112a2492c0b6e2f20e864015d9f14ae3ae92d762 Signed-off-by: Victor Cebollada <v.cebollada@samsung.com>
Markup processor. Creates a 'skeleton' of the mark-up processor. Change-Id: Id98953bda8a22cb9ef2a38c2995c7aa757c95307 Signed-off-by: Victor Cebollada <v.cebollada@samsung.com>