Commit Graph

72 Commits

Author SHA1 Message Date
Daniel Hirt 2b40860f78 Evas/Textblock: Introduce PS deletion bug test and fix
Summary:
This test should make the test suite fail. It sets "a<ps>b" and
"a<ps/>b" markups, and deletes the PS format. Essentially, these two
different markups should have the same result by this deletion. Instead,
only the <ps/> format gets deleted properly.
A follow-up commit is added with this as a fix.

Evas/Textblock: fix deletion of PS bug

Fixes an issue with deletion of "<ps>". Format deletion was only
performed for formats that are own-closers. This sets the paragraph
separator to be an own-closer format.

@fix

Reviewers: tasn

Reviewed By: tasn

CC: JackDanielZ, id213sin

Differential Revision: https://phab.enlightenment.org/D1046
2014-06-17 11:11:33 +01:00
Youngbok Shin 3e81b73aa8 evas/tests - textblock: add a test case for item format with ellipsis.
Summary:
When item format is cutoff by ellipsis, *_cursor_format_item_geometry_get API
should be failed at the item position.
But, it can be success and returns abnormal geometry.

Reviewers: woohyun, tasn

CC: cedric, herdsman

Differential Revision: https://phab.enlightenment.org/D974
2014-06-10 15:17:41 +01:00
Tom Hacohen 3b70b4f28f Evas textblock: Fix crash when cutting ligatures with formats.
"f<color=#f00>i</color>f" could cause textblock to crash. It doesn't
crash anymore. It doesn't render the colours correctly either, but at
least this is the first step.

This is the start of fixing T1308

@bugfix
2014-06-04 10:14:24 +01:00
Daniel Hirt 177135ff0d Evas/Textblock: add support for ellipsis values
Summary:
This enables textblock to support more values other than 1.0.
For 0 <= ellipsis < 1.0, it splits the text such that it fits the
textblock's width. The ellipsis is relatively position according to the
ellipsis value, and characters are removed also relatively.
For example, a value of 0.5 will position the ellipsis right in the
center of the textblock's width, while removing characters equally right
and left from the center.

Basic approach to this feature was to do some work before the layout
process. We calculate the expected total width of the items, and by how
much we exceed from the textblock's width. Afterwards is it just some
careful work to set the boundaries of the width we want to cut, and
deciding which characters we need to removed to fulfill this requirement.
The rest is splitting the text and visually-removing the part we
need to cut.
This is all handled before any logical lines are created, so the
_layout_par function remains almost intact. A designated _ellip_prev_it
field in the Paragraph struct instructs after which item we place the
ellipsis item, if at all.

Note that we keep the fast path for ellipsis 1.0, as heavier work needs
to be done for the other values.

Added tests to evas_suite for a range of ellipsis values.

Also, multiline is unsupported at the moment.
@feature

Test Plan: Anything that uses Evas Textblock (single-line, please)

Reviewers: tasn, id213sin, raster

CC: cedric, JackDanielZ, raster

Differential Revision: https://phab.enlightenment.org/D905
2014-05-29 15:52:01 +01:00
Youngbok Shin e4158510bd evas/text: add text ellipsis test case for ligatures special case.
Summary:
Some fonts has combination information for "ff".
When harfbuzz is enabled with the font, evas text ellipsis logic can be broken.

Reviewers: tasn, woohyun, cedric

Reviewed By: tasn

CC: cedric, herdsman

Differential Revision: https://phab.enlightenment.org/D870

Some comment/commit message improvements by TAsn.
2014-05-21 10:41:29 +01:00
Jean-Philippe Andre 7a6943ad1e Evas test: Update filters tests (Lua) - part 2
Rendering & padding tests
2014-05-09 16:57:39 +09:00
Jean-Philippe Andre 4c4d65c388 Evas test: Update filters test (Lua) - part 1 2014-05-09 16:57:39 +09:00
Jean-Philippe Andre 1a43bb565c tests: Disable the evas filters test suite for now
Yes, it's a bad move. But I'd rather avoid breaking make check
for now until I have a proper test suite.

The script language has been changed to Lua, and so its
limitations and syntax are not the same. Remember this is a beta
API so it shouldn't even be exposed to normal apps.
2014-04-27 17:41:40 +09:00
Jean-Philippe Andre 59cf013db9 Evas filters: Add support for Evas_Object_Image
This adds filter support to Image objects as well.
The exact same filters can run on Text and on Images
(provided some colorspace limitations are respected).

This basically adds:
- Support for RGBA input buffer
- Eo entry points for Image filter support
- Implement basic filter support in Evas_Image
2014-04-27 17:41:40 +09:00
Daniel Zaoui dbe02d593e Tests: fix annoying warning.
The function is not used so I commented it, in case it has to be used
later.
2014-04-27 11:05:03 +03:00
Tom Hacohen 30506b9025 Revert "tests: Add a case for ellipsis in complex markup text."
Opened a task (1151) for it and should revert this when ready to fix.

This reverts commit 9128ac82a0.
2014-04-03 11:52:00 +01:00
Youngbok Shin 9128ac82a0 tests: Add a case for ellipsis in complex markup text.
Summary: Evas textblock can't cut off text properly when it has separated items.

Reviewers: tasn, woohyun, raster

Reviewed By: raster

CC: cedric, herdsman

Differential Revision: https://phab.enlightenment.org/D667
2014-04-02 15:57:17 +09:00
Cedric BAIL 52a36461b8 evas: add infrastructure and basic tests for loading image. 2014-04-01 22:00:14 +09:00
Jean-Philippe Andre 0a6d2e6b29 tests: Add case for filters' padding_set
Test that the padding is correct and the instruction is valid.
2014-03-26 10:48:12 +09:00
Tom Hacohen aad13a286f Evas text: Make tests more lax so they'll work on Ubuntu.
It seems that a different version of freetype is causing some different
values to be calculated for some glyphs. Also, we consider the whole
font list when calculating max ascent/descent, so there will always be
differences there.

This commit just laxes the tests, requiring the values to be at least
the values we expect from our font.

Fixes T1079
2014-03-18 15:02:13 +00:00
Tom Hacohen d175b8aa69 Evas textblock: Fix clipping issues with some texts with width > advance.
This happens with many texts. The issue occurs when the width of the
last char is larger than it's advance. Before this patch, we didn't the
width into account when calculating width, thus causing clipping issues
in some cases.
2014-03-10 14:58:18 +00:00
Jean-Philippe Andre 2fe5656b63 Evas filters: Improve test coverage of the filters
LCOV reports > 80% of coverage in evas/filters.
2014-02-20 13:27:43 +09:00
Jean-Philippe Andre 18a7939f41 Evas filters: Add render test cases with pixel verification
Force render into an Ecore_Evas, and check that the pixels
are valid:
- Not all transparent (can't really happen)
- Not all black (since there's a black rect behind the text)
- All valid premultiplied values (A >= R,G,B)

Yes, it's a bit slow. But at least it really checks something :)
2014-02-20 13:27:43 +09:00
Jean-Philippe Andre e797f7f4c4 Evas filters: Add more test cases
Set filter on a text object and check the object's geometry.
Get the padding and the geometry so we're sure they match.

Also, pad_get would return 0 if the filter did not compile,
so this checks that these filters are valid.
2014-02-20 13:27:42 +09:00
Jean-Philippe Andre 78c7931575 Evas filters: Add test cases for the script parser
Basic syntax checks and instructions coverage.
2014-02-20 13:27:42 +09:00
Tom Hacohen 00b2974a2c Evas textblock tests: Improved textblock word start/end tests.
Removed a wrong test and added some more tests.
2014-02-19 14:38:06 +00:00
Tom Hacohen e0428e9cb0 Evas textblock tests: Add a wrapping test for complex cluster wrapping.
This test uses some Devanagari text that should have more complex
clusters than what latin text can provide. This is a more complex
wrapping case that should be tested and haven't been tested until now.
2014-02-19 12:08:56 +00:00
Tom Hacohen 1dcf143192 Evas textblock: Added a test for rendering of spaces in some cases.
This checks that spaces are one again used, in a specific case
with wrapping.
2014-02-10 14:17:02 +00:00
Tom Hacohen 13664f3af1 Evas textblock: Fixed test shadow warnings. 2014-02-07 13:18:38 +00:00
Tom Hacohen 97f625c021 Evas textblock: Added tests for *_cursor_char_coord_set.
There are issues with values between the beginning of the first par and
the beginning of the first line.
2014-02-07 13:14:21 +00:00
Tom Hacohen a5691571e3 Evas textblock: Added a test for range geometry with bidi text. 2014-01-29 13:27:45 +00:00
Jean-Philippe Andre cc82e2ded5 Textblock: Add test cases for style padding
In the previous commit, style padding has been changed, so
that lines don't get extra space just because there's a special
style (glow, ...)

This adds some test cases that check the actual geometry of the
lines relatively to each other.

NOTE: This test does not fail before the padding commits, as
_relayout_if_needed() adjusts the padding properly.
2014-01-15 17:55:27 +09:00
Youngbok Shin b4106c90d9 Evas test textblock: Added a test for a broken range_text_get case.
Summary: Added a test for range_text_get case on the text that include multi text node.

Reviewers: tasn, woohyun, seoz

CC: cedric

Differential Revision: https://phab.enlightenment.org/D398
2013-12-23 11:01:57 +09:00
Youngbok Shin 8bee8853ae Evas test textblock: Added a test for a broken range_delete case.
This fixes bad integration by me (Tom) of Youngbok's patch in
42a06f24d8.
2013-12-16 12:05:47 +00:00
Youngbok Shin 42a06f24d8 Evas textblock: Added more range_delete tests.
These tests check for a regression with deletion of ranges ending with
visual formats.
Thanks to Youngbok Shin for sending me the tests.
2013-12-13 14:44:16 +00:00
Jean-Philippe Andre a1c3fef538 Evas tests: Add invalid markup test
Commit 0cb048f9b6 fixed a crash in Textblock where
a couple "key=val" had an empty value ("key=").
2013-12-10 20:57:19 +09:00
Tom Hacohen 1b51bc256b Evas tests: Add canvas free with ref tests.
This should check test for the issue fixed in:
bb4a19b5ad
8bba92fbca
2013-11-26 12:27:31 +00:00
Tom Hacohen ada27a49d7 Evas textblock: Added a test for wraps ending with whites.
This tests for word wraps of lines ending with whites.
Those whites should not be cut, they should be wrapped as well.
2013-11-25 14:41:24 +00:00
Tom Hacohen 0e363f54b4 Evas textblock tests: Added tests for correct tag ordering.
Check that tags entered are correctly ordered.
2013-11-19 15:56:49 +00:00
Tom Hacohen 61264aebe3 Evas textblock tests: Added a complex markup set/get test.
This should make things more robust as thing tests a lot.
2013-11-19 15:56:49 +00:00
Tom Hacohen 4850c4660f Evas textblock: Fixed broken test.
Item is not meant to take the size of the max ascent, just the ascent.
2013-09-23 14:37:19 +01:00
Tom Hacohen bda3ceb632 Evas textblock: fixed *_markup_get issue with escaped chars.
Markup_get was misbehaving and returning wrong results with some escaped
chars. markup_to_utf8 was working correctly. Merged the code together
and now both are consistent and correct.

Thanks to WooHyun for reporting.
2013-09-03 11:50:34 +01:00
Tom Hacohen 6ca84f0486 Evas textblock tests: Make the tests more lax.
The tests were failing on jenkins (gentoo), and on arch, but passing on an
old ubuntu. Ubuntu patches freetype, and that's probably the reason for that
with the tests more lax, both work.
2013-08-20 13:32:03 +01:00
Tom Hacohen 1e9f121f42 Evas textblock tests: Adjust tests according to descent fix. 2013-08-20 11:13:06 +01:00
Tom Hacohen 92a6d2e2d2 Evas textblock tests: Fix a broken test and add another test.
The test was running without a text being set.
The added test runs with an empty textblock.
2013-08-20 11:13:06 +01:00
Tom Hacohen ec573948b0 Evas textblock tests: use the libcheck assert macros. 2013-08-20 11:13:06 +01:00
Tom Hacohen 6583b83c73 Evas textblock: Use max ascent/descent at the edges of the textblock.
Thanks to Youngbok Shin for reporting the difference in behaviour between
textblock and text object.
2013-08-06 09:29:03 +01:00
Tom Hacohen fdbc477f79 Evas textblock: Fixed issue with textblocks without fonts segfaulting.
Fixes T184 (which is a regression).
2013-06-25 16:37:48 +01:00
Tom Hacohen e7cd15b04b Fixed text/block tests: Added Korean UnDotum font and fixed some issues. 2013-05-13 15:13:25 +01:00
Tom Hacohen 211ebc9e88 Fix broken test from previous commit. 2013-05-13 13:51:14 +01:00
Tom Hacohen a7d7cc1df1 Evas bidi test: Improved error output. 2013-05-13 13:49:51 +01:00
Yakov Goldberg 0389d46014 Evas textblock: fix split cursor tests; FIXME ligatures tests
- re-enabling split BiDi cursor tests, disabled in 0d68ffbe;
    ligatures tests are still disabled;
  - change "fail_if" to "ck_assert_int_*",
    because it prints error message with values;
  - fixing usage of embedding LTR/RTL codes in tests;

Signed-off-by: Yakov Goldberg <yakov.g@samsung.com>
2013-04-17 10:07:29 +03:00
Tom Hacohen 3f3ad67616 Evas textblock: Fixed a bug with deletion of ranges.
Fixed a bug with deletion of ranges that end just before a visual format.
Thanks to WooHyun Jung for reporting.
2013-04-15 17:15:22 +01:00
Yakov Goldberg 0d68ffbe86 Evas textblock: Revert commit 3832ec5
with additional disabling of unused function

Signed-off-by: Yakov Goldberg <yakov.g@samsung.com>
2013-04-11 18:19:46 +03:00
Yakov Goldberg 3832ec5500 Evas textblock: fixing tests
Re-enabling tests, disabled in commit:
   84fa062d6e

Signed-off-by: Yakov Goldberg <yakov.g@samsung.com>
2013-04-11 17:15:46 +03:00