Fixing issue: On Text, reducing font-point-size when the Glyph-block-size be larger... 23/254923/24
authorShrouq Sabah <s.sabah@samsung.com>
Wed, 10 Mar 2021 13:03:20 +0000 (15:03 +0200)
committerShrouq Sabah <s.sabah@samsung.com>
Tue, 27 Apr 2021 10:42:46 +0000 (13:42 +0300)
commit3ca052b397ea7a3c5667c40d5a3bf0b44d42e25d
tree5e7cbb94f2ff01af44c9cc7e72b79599012f11fe
parentac501f02feab8e2fb7e613f936d3d5a511603001
Fixing issue: On Text, reducing font-point-size when the Glyph-block-size be larger than Atlas-block-size to fit into it.

Issue: On TextEditor or TextField when use font size (Point-Size) which creating Glyphs its size larger than Atlas-block size then logging error says that can’t create block and nothing appear in Text-Controller.

Solution: At Adaptor level, checking block size according to point-size if the block will be larger than Atlas size then keep decreasing point-size until achieve block that fit into Atlas size.
Toolkit calls API named “EnableAtlasLimitation” on Font-Client object to activate this validation on Adaptor level. Since the Atlas size information added as constants in Font-Client class.
Log warning that the point-size is reduced.
Automated test-cases added to Adaptor and Toolkit

Added APIs into font-client/Adaptor for Point-size & Atlas information instead of constants/literal values in toolkit.

Reproduce by:
Creating TextEditor or TextFiled then set properties:
mEditor.SetProperty( TextEditor::Property::POINT_SIZE, 330) ;
mEditor.SetProperty( TextEditor::Property::FONT_FAMILY, " DejaVu Sans ") ;

Logged error appears:
Logged ERROR: “ERROR: DALI: CreateAtlas Atlas 512 x 512 too small. Dimensions need to be at least 517x517”
Logged ERROR: “ERROR: DALI: Add Failed to create an atlas of 512 x 512 blocksize: 514 x 514.”

Change-Id: Ib4c57e80c21ca5efe905681fe050d3a65873c6f5
automated-tests/src/dali-toolkit-internal/utc-Dali-TextEditor-internal.cpp
automated-tests/src/dali-toolkit-internal/utc-Dali-TextField-internal.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp
dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.cpp
dali-toolkit/internal/text/text-controller-impl.cpp