Text improvement 73/197773/28
authorJoogab Yun <joogab.yun@samsung.com>
Wed, 16 Jan 2019 07:18:38 +0000 (16:18 +0900)
committerVíctor Cebollada <v.cebollada@samsung.com>
Tue, 19 Feb 2019 07:28:17 +0000 (07:28 +0000)
commitd82494a77e405d5924cf1af3fe55b2d9b9577e3f
tree55cfd12c7557aee25f871b865c09a3c47df28813
parentb60fd26436c5a04b5f7e9d1f135181aabcfc6518
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
46 files changed:
automated-tests/src/dali-toolkit-internal/CMakeLists.txt
automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/toolkit-text-utils.cpp
automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Circular.cpp [new file with mode: 0755]
automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Markup.cpp
automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Shaping.cpp [changed mode: 0644->0755]
dali-toolkit/devel-api/file.list
dali-toolkit/devel-api/text/bitmap-font.cpp [new file with mode: 0755]
dali-toolkit/devel-api/text/bitmap-font.h [new file with mode: 0755]
dali-toolkit/devel-api/text/text-utils-devel.cpp [new file with mode: 0755]
dali-toolkit/devel-api/text/text-utils-devel.h [new file with mode: 0755]
dali-toolkit/internal/file.list
dali-toolkit/internal/text/embedded-item.h [new file with mode: 0755]
dali-toolkit/internal/text/font-run.h
dali-toolkit/internal/text/glyph-metrics-helper.cpp [changed mode: 0644->0755]
dali-toolkit/internal/text/layouts/layout-engine.cpp
dali-toolkit/internal/text/logical-model-impl.cpp [changed mode: 0644->0755]
dali-toolkit/internal/text/logical-model-impl.h [changed mode: 0644->0755]
dali-toolkit/internal/text/markup-processor-embedded-item.cpp [new file with mode: 0755]
dali-toolkit/internal/text/markup-processor-embedded-item.h [new file with mode: 0755]
dali-toolkit/internal/text/markup-processor-helper-functions.cpp [changed mode: 0644->0755]
dali-toolkit/internal/text/markup-processor-helper-functions.h [changed mode: 0644->0755]
dali-toolkit/internal/text/markup-processor.cpp
dali-toolkit/internal/text/markup-processor.h [changed mode: 0644->0755]
dali-toolkit/internal/text/metrics.h [changed mode: 0644->0755]
dali-toolkit/internal/text/multi-language-support-impl.cpp
dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager-impl.cpp
dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager-impl.h
dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager.cpp
dali-toolkit/internal/text/rendering/atlas/atlas-glyph-manager.h
dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.cpp
dali-toolkit/internal/text/rendering/text-typesetter.cpp
dali-toolkit/internal/text/rendering/view-model.cpp
dali-toolkit/internal/text/rendering/view-model.h
dali-toolkit/internal/text/shaper.cpp
dali-toolkit/internal/text/text-controller.cpp
dali-toolkit/internal/text/text-controller.h
dali-toolkit/internal/text/text-definitions.h [changed mode: 0644->0755]
dali-toolkit/internal/text/text-effects-style.cpp
dali-toolkit/internal/text/text-model-interface.h
dali-toolkit/internal/text/text-model.cpp
dali-toolkit/internal/text/text-model.h
dali-toolkit/internal/text/text-view-interface.h [changed mode: 0644->0755]
dali-toolkit/internal/text/text-view.cpp [changed mode: 0644->0755]
dali-toolkit/internal/text/text-view.h [changed mode: 0644->0755]
dali-toolkit/internal/text/visual-model-impl.cpp
dali-toolkit/internal/text/visual-model-impl.h