From: Paul Wisbey Date: Fri, 20 Mar 2015 14:45:17 +0000 (+0000) Subject: Added TextLabel guide X-Git-Tag: dali_1.0.38~11^2~37 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=d0a152d96425ba19d9dc37c2da0a307e95f8ee57 Added TextLabel guide Change-Id: Ia2caf9462b4cd81a60830eb5259da8bdb5f3e20d --- diff --git a/docs/content/images/background/BackgroundTextView.png b/docs/content/images/background/BackgroundTextLabel.png similarity index 100% rename from docs/content/images/background/BackgroundTextView.png rename to docs/content/images/background/BackgroundTextLabel.png diff --git a/docs/content/images/text-controls/ArabicBegin.png b/docs/content/images/text-controls/ArabicBegin.png new file mode 100644 index 0000000..56dcec1 Binary files /dev/null and b/docs/content/images/text-controls/ArabicBegin.png differ diff --git a/docs/content/images/text-controls/ArabicCenter.png b/docs/content/images/text-controls/ArabicCenter.png new file mode 100644 index 0000000..cbc77d3 Binary files /dev/null and b/docs/content/images/text-controls/ArabicCenter.png differ diff --git a/docs/content/images/text-controls/ArabicEnd.png b/docs/content/images/text-controls/ArabicEnd.png new file mode 100644 index 0000000..e35e1a8 Binary files /dev/null and b/docs/content/images/text-controls/ArabicEnd.png differ diff --git a/docs/content/images/text-controls/LatinBegin.png b/docs/content/images/text-controls/LatinBegin.png new file mode 100644 index 0000000..bec2507 Binary files /dev/null and b/docs/content/images/text-controls/LatinBegin.png differ diff --git a/docs/content/images/text-controls/LatinCenter.png b/docs/content/images/text-controls/LatinCenter.png new file mode 100644 index 0000000..ef5aa57 Binary files /dev/null and b/docs/content/images/text-controls/LatinCenter.png differ diff --git a/docs/content/images/text-controls/LatinEnd.png b/docs/content/images/text-controls/LatinEnd.png new file mode 100644 index 0000000..4e22cbc Binary files /dev/null and b/docs/content/images/text-controls/LatinEnd.png differ diff --git a/docs/content/images/text-controls/TextLabelCenter.png b/docs/content/images/text-controls/TextLabelCenter.png new file mode 100644 index 0000000..07558e3 Binary files /dev/null and b/docs/content/images/text-controls/TextLabelCenter.png differ diff --git a/docs/content/images/text-controls/TextLabelTopLeft.png b/docs/content/images/text-controls/TextLabelTopLeft.png new file mode 100644 index 0000000..ad8f492 Binary files /dev/null and b/docs/content/images/text-controls/TextLabelTopLeft.png differ diff --git a/docs/content/images/text-view/AlessBlessC.png b/docs/content/images/text-view/AlessBlessC.png deleted file mode 100644 index b4cc01c..0000000 Binary files a/docs/content/images/text-view/AlessBlessC.png and /dev/null differ diff --git a/docs/content/images/text-view/Black-Shadow.png b/docs/content/images/text-view/Black-Shadow.png deleted file mode 100644 index 899c8b3..0000000 Binary files a/docs/content/images/text-view/Black-Shadow.png and /dev/null differ diff --git a/docs/content/images/text-view/Blue-Glow.png b/docs/content/images/text-view/Blue-Glow.png deleted file mode 100644 index a9b6cfb..0000000 Binary files a/docs/content/images/text-view/Blue-Glow.png and /dev/null differ diff --git a/docs/content/images/text-view/Bold.png b/docs/content/images/text-view/Bold.png deleted file mode 100644 index 0f4f60e..0000000 Binary files a/docs/content/images/text-view/Bold.png and /dev/null differ diff --git a/docs/content/images/text-view/FontAppendix01.png b/docs/content/images/text-view/FontAppendix01.png deleted file mode 100644 index e600bf4..0000000 Binary files a/docs/content/images/text-view/FontAppendix01.png and /dev/null differ diff --git a/docs/content/images/text-view/FontAppendix02.png b/docs/content/images/text-view/FontAppendix02.png deleted file mode 100644 index 7b002b3..0000000 Binary files a/docs/content/images/text-view/FontAppendix02.png and /dev/null differ diff --git a/docs/content/images/text-view/FontAppendix03.png b/docs/content/images/text-view/FontAppendix03.png deleted file mode 100644 index 024a977..0000000 Binary files a/docs/content/images/text-view/FontAppendix03.png and /dev/null differ diff --git a/docs/content/images/text-view/FontAppendix04.png b/docs/content/images/text-view/FontAppendix04.png deleted file mode 100644 index 337a1d7..0000000 Binary files a/docs/content/images/text-view/FontAppendix04.png and /dev/null differ diff --git a/docs/content/images/text-view/FontAppendix05.png b/docs/content/images/text-view/FontAppendix05.png deleted file mode 100644 index 331daf4..0000000 Binary files a/docs/content/images/text-view/FontAppendix05.png and /dev/null differ diff --git a/docs/content/images/text-view/FreeSerifFont.png b/docs/content/images/text-view/FreeSerifFont.png deleted file mode 100644 index fa945ff..0000000 Binary files a/docs/content/images/text-view/FreeSerifFont.png and /dev/null differ diff --git a/docs/content/images/text-view/Italic.png b/docs/content/images/text-view/Italic.png deleted file mode 100644 index 61fe21e..0000000 Binary files a/docs/content/images/text-view/Italic.png and /dev/null differ diff --git a/docs/content/images/text-view/Red-Outline.png b/docs/content/images/text-view/Red-Outline.png deleted file mode 100644 index 794960b..0000000 Binary files a/docs/content/images/text-view/Red-Outline.png and /dev/null differ diff --git a/docs/content/images/text-view/Smooth-Text.png b/docs/content/images/text-view/Smooth-Text.png deleted file mode 100644 index 7ca0d3b..0000000 Binary files a/docs/content/images/text-view/Smooth-Text.png and /dev/null differ diff --git a/docs/content/images/text-view/Underline.png b/docs/content/images/text-view/Underline.png deleted file mode 100644 index 468cac3..0000000 Binary files a/docs/content/images/text-view/Underline.png and /dev/null differ diff --git a/docs/content/images/text-view/text-view-example-01.png b/docs/content/images/text-view/text-view-example-01.png deleted file mode 100644 index 3b8eacd..0000000 Binary files a/docs/content/images/text-view/text-view-example-01.png and /dev/null differ diff --git a/docs/content/images/text-view/text-view-example-02.png b/docs/content/images/text-view/text-view-example-02.png deleted file mode 100644 index 32a532a..0000000 Binary files a/docs/content/images/text-view/text-view-example-02.png and /dev/null differ diff --git a/docs/content/images/text-view/text-view-example-03.png b/docs/content/images/text-view/text-view-example-03.png deleted file mode 100644 index 0fd7457..0000000 Binary files a/docs/content/images/text-view/text-view-example-03.png and /dev/null differ diff --git a/docs/content/images/text-view/text-view-example-04.png b/docs/content/images/text-view/text-view-example-04.png deleted file mode 100644 index 5d0a2dc..0000000 Binary files a/docs/content/images/text-view/text-view-example-04.png and /dev/null differ diff --git a/docs/content/images/text-view/text-view-example-05.png b/docs/content/images/text-view/text-view-example-05.png deleted file mode 100644 index eccfde5..0000000 Binary files a/docs/content/images/text-view/text-view-example-05.png and /dev/null differ diff --git a/docs/content/images/text-view/text-view-example-06.png b/docs/content/images/text-view/text-view-example-06.png deleted file mode 100644 index 02a5f19..0000000 Binary files a/docs/content/images/text-view/text-view-example-06.png and /dev/null differ diff --git a/docs/content/images/text-view/text-view-example-07.png b/docs/content/images/text-view/text-view-example-07.png deleted file mode 100644 index 2326de4..0000000 Binary files a/docs/content/images/text-view/text-view-example-07.png and /dev/null differ diff --git a/docs/content/images/text-view/text-view-example-08.png b/docs/content/images/text-view/text-view-example-08.png deleted file mode 100644 index 0224b2e..0000000 Binary files a/docs/content/images/text-view/text-view-example-08.png and /dev/null differ diff --git a/docs/content/images/text-view/text-view.png b/docs/content/images/text-view/text-view.png deleted file mode 100644 index 5d11c48..0000000 Binary files a/docs/content/images/text-view/text-view.png and /dev/null differ diff --git a/docs/content/main-page.h b/docs/content/main-page.h index e40f89c..1073c3f 100644 --- a/docs/content/main-page.h +++ b/docs/content/main-page.h @@ -31,6 +31,7 @@ * - \link constraints-intro Introduction to Constraints \endlink * * \section UIControls UI Controls + * - \link text-label Text Label \endlink * - \link item-view Item View \endlink * - \link scroll-view Scroll View \endlink * - \link size-negotiation Size Negotiation \endlink diff --git a/docs/content/programming-guide/background.h b/docs/content/programming-guide/background.h index 44972f4..a8dc916 100644 --- a/docs/content/programming-guide/background.h +++ b/docs/content/programming-guide/background.h @@ -16,15 +16,15 @@ control.SetBackgroundColor( Dali::Color::RED ); -This can be used for ALL existing controls like TextView as well: +This can be used for ALL existing controls like TextLabel as well: @code -Dali::Toolkit::TextView textView = Dali::Toolkit::TextView::New( "Hello World" ); -textView.SetBackgroundColor( Dali::Color::RED ); +Dali::Toolkit::TextLabel label = Dali::Toolkit::TextLabel::New( "Hello World" ); +label.SetBackgroundColor( Dali::Color::RED ); @endcode
-\image html BackgroundTextView.png +\image html BackgroundTextLabel.png
diff --git a/docs/content/programming-guide/text-label.h b/docs/content/programming-guide/text-label.h new file mode 100644 index 0000000..35754de --- /dev/null +++ b/docs/content/programming-guide/text-label.h @@ -0,0 +1,108 @@ +/*! \page text-label Text Label + * +\section overview Overview +The Dali::Toolkit::TextLabel is a Dali::Toolkit::Control which renders a short text string.\n +Text labels are lightweight, non-editable and do not respond to user input. + +\subsection basictextlabelusage Basic usage + +To display a TextLabel the TEXT property must be set using a UTF-8 string. + +\code +TextLabel label = TextLabel::New(); +label.SetProperty( TextLabel::Property::TEXT, "Hello World" ); +Stage::GetCurrent().Add( label ); +\endcode + +The label must also be added to the stage, or to an actor which is on the stage.\n +In this example the text-label will be automatically given a natural size i.e. large enough to fit the text.\n +The position of the label on-screen is dependent on the parent-origin and anchor-point properties: + + + + + + + + + + +
+ \image html TextLabelTopLeft.png + + \image html TextLabelCenter.png +
+ (ParentOrigin::TOP_LEFT, AnchorPoint::TOP_LEFT) + + (ParentOrigin::CENTER, AnchorPoint::CENTER) +
+ +\subsection fontselection Font Selection + +By default TextLabel will automatically select a suitable font from the platform.\n +Typically fonts do not support all scripts, for example Latin fonts often do not provide Arabic glyphs.\n +Therefore you should expect TextLabel to select different fonts for each script. + +Alternatively a font may be requested using eiter or all of FONT_FAMILY, FONT_STYLE, and POINT_SIZE properties: +\code +label.SetProperty( TextLabel::Property::FONT_FAMILY, "HelveticaNue" ); +label.SetProperty( TextLabel::Property::FONT_STYLE, "Regular" ); +label.SetProperty( TextLabel::Property::POINT_SIZE, 12.0f ); +\endcode +However the TextLabel will fall-back to using the default font, if the requested font does not support the required scripts. + +\subsection fontselection Text Alignment + +Wrapping can be enabled using the MULTI_LINE property:\n +\code +label.SetProperty( TextLabel::Property::MULTI_LINE, true ); +\endcode + +The text can be either aligned to the start, end, or center of the available area: +\code +label.SetProperty( TextLabel::Property::ALIGNMENT, "BEGIN" ); // "CENTER" or "END" +\endcode + + + + + + + + + + + + + + + + + + + + + + + +
+ Here is the "BEGIN" alignment shown for left-to-right (Latin) and right-to-left (Arabic) scripts: +
+ \image html LatinBegin.png + + \image html ArabicBegin.png +
+ Here is the "CENTER" alignment shown for left-to-right (Latin) and right-to-left (Arabic) scripts: +
+ \image html LatinCenter.png + + \image html ArabicCenter.png +
+ Here is the "END" alignment shown for left-to-right (Latin) and right-to-left (Arabic) scripts: +
+ \image html LatinEnd.png + + \image html ArabicEnd.png +
+ +*/