Fixing issue: On Text, reducing font-point-size when the Glyph-block-size be larger... 22/254922/33
authorShrouq Sabah <s.sabah@samsung.com>
Wed, 10 Mar 2021 12:57:22 +0000 (14:57 +0200)
committershrouq Sabah <s.sabah@samsung.com>
Tue, 27 Apr 2021 10:44:03 +0000 (10:44 +0000)
commit7bf1419272a6c8231c3f3adf74694696efd43595
tree6a8eca6bc305b634adc3878837f2ccc4ee7e4e01
parentcb464ae66d950ea3149785f60e3aaa2b66ce05d3
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: Ia47462aa74b9807ed916fd63c4ba8b47437582e6
automated-tests/resources/fonts/dejavu/DejaVuSans.ttf [new file with mode: 0644]
automated-tests/src/dali-adaptor-internal/utc-Dali-FontClient.cpp
dali/devel-api/text-abstraction/font-client.cpp
dali/devel-api/text-abstraction/font-client.h
dali/internal/text/text-abstraction/font-client-impl.cpp
dali/internal/text/text-abstraction/font-client-impl.h
dali/internal/text/text-abstraction/font-client-plugin-impl.cpp
dali/internal/text/text-abstraction/font-client-plugin-impl.h