Need to handle this with special care as Efl.Text.Cursor is used in
some functions that are specific to Efl.Canvas.Text, was well as
functions in Efl.Text.Cursor interface.
Value-based alignment (e.g. 0.5, 0.3 etc) isn't very practical.
Horizontal and vertical alignments will be assigned with enums
"left", "center", "right", "auto", "locale", for horizontal alignment,
and "top", "center" and "bottom" for vertical alignment.
This changes the previously added "halign" and "valign" properties.
Summary:
There are many requests to add a new feature for handling horizontal align
according to current locale. For example, in RTL locale setting,
users want to see right aligned text for every list's item.
Even if some of list's items only contain LTR characters!
It is useful for the needs.
@feature
Test Plan: N/A
Reviewers: herdsman, tasn, woohyun, raster, cedric
Reviewed By: herdsman, raster
Subscribers: z-wony, jpeg
Differential Revision: https://phab.enlightenment.org/D4664
eo_prefix are set to "efl_text".
Also, "Efl.Text.Format" is shortened to now include the "_format"
prefix.
"Efl.Text.Font" keeps the "_font" prefix, for better readability.
Originally it was its own object.
There are some valid claims that there is no justification for it to
remain an object.
Furthermore, it's apparent that it added little benefit: changes of
each cursors, in practice, triggered a query for all objects of the
same textblock. There wasn't real advantage to have a finer resolution
of controlling the cursors with their own events.
This ports back a lot of code, and changes a lot of other code in the
higher-up widgets, such as Efl.Ui.Text and co.
The usage was replaces from:
efl_canvas_text_cursor_char_next(cur_obj)
to
efl_canvas_text_cursor_char_next(text_obj, cur_obj)
that is, it is an operations on the TEXT OBJECT, rather than on the
(now removed) cursor object.
So, one less efl object to worry about now.
Hopefully, the port went smooth.
This reverts commit 0a28cb97af, as the
addressed issue was still occurring.
Non-dirty paragraphs were not considered when recalculating the
formatted width of the text.
This could easily be reproduced with two paragraphs, getting the width,
and then updating only the second paragraph.
Added a test case.
@fix
Summary:
_layout_ellipsis_item_new() function deallocates "ellip_ti" and
allocates memory for new one. The local "ellip_ti" pointer should be
updated.
@fix
Test Plan: N/A
Reviewers: raster, cedric, herdsman, jpeg, woohyun
Differential Revision: https://phab.enlightenment.org/D4854
This is the first step toward handling multi output. This patch
remove engine.data.output from Evas structure and use an Eina_List
for it instead. It also start moving code around to fetch an output
or an engine context (which are the same at the moment, but will be
split in a later patch).
This might not be used as over two consecutive runs all the
same buffers should be used. But it could happen if some
parameters in the filter change (eg. blur radius).
Fixes major (GPU) memory leaks. Reuse mode is still leaking.
This will reuse existing buffers by resetting only the minimum
required in the filter context (also reused). Work in progress,
as the actual reuse is disabled for now.
This avoids creating one more FBO and doing one more draw,
by rendering the image input data directly into the input
buffer. This also makes the code common between SW and GL.
This will be most useful in a special case, where a filter is
used in a window decoration, applied to a snapshot object.
Another optimization that might be wanted is passing a list
of update regions (from the proxy or snapshot).
The filters don't support the obscuring region yet, only some
of the high-level logic is implemented.
Summary:
If the last item before ellipsis item has bigger width than its advance,
evas_common_font_query_last_up_to_pos() function can find wrong ellipsis position.
When Evas finds a position for non last item, Evas must care about additionally
available space for glyph's width of the given x position.
ex) the last item's glyph before ellipsis item has a tail to draw above the ellipsis item.
@fix
Test Plan:
Test case will added as comment.
(Becasue of font license problem.)
Reviewers: herdsman, raster, jpeg, woohyun
Subscribers: cedric, Blackmole
Differential Revision: https://phab.enlightenment.org/D4727
Summary:
valign tag is for handling vertical align according to line's height and
text's height. But, it worked in a line which has only one font and
one font size, too. And the result was abnormal depending its font.
The line's height is [ascent + descent]. But, Textblock uses max ascent and
items's height(could be used max ascent + max descent according to its position)
when Textblock calculates item's yoff.
So, If Textblock calculate yoff based on line's height,
it should use only ascent and descent instead of max ascent and max descent.
@fix
Test Plan: Will attached in comment section.
Reviewers: raster, herdsman, jpeg, woohyun
Reviewed By: raster
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D4760
This reverts commit b8beb6834b.
this now actually works... for some mysterious reason... ? :/ i am
baffled. go back in until we can find the issue then...
In this case data_scope_get is more appropriate as the data is
indeed stored on the stack (function scope) and not somewhere else.
After this last fix I see no eo_debug error logs in elementary test.
Yay! eo_debug is now usable :)
This reverts commit c39855a8ac.
This actually breaks 1 dialog in e (app exited with error exit code).
it worked everywhere else so i thought it was good. seemingly not
after i saw one of these. revert D3595
Summary:
When a size calculation is skipped because of some reasons,
Evas Textblock should keep same size with the previous size.
@fix
Test Plan: N/A
Reviewers: raster, herdsman, cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D4659
if balue is NULL the data binding is removed and freed, but we don't
return at that point but instead fall back to using/replacing the
databinding.
this fixes CID 1369022
several calls, specifically evas_object_change_reset,
evas_object_cur_prev, and evas_object_clip_changes_clean that are
called directly or indirectly as part of evas render on at least every
active object if not more, were doing full eo obj lookups when their
calling functions already all had the eo protected data looked up.
tha's silly and just adds overhead we don't need. my test dropped
_eo_obj_pointer_get overhead in perf profiles from 4.48% to 2.65%. see:
4.48% libeo.so.1.18.99 [.] _eo_obj_pointer_get
4.23% libevas.so.1.18.99 [.] evas_render_updates_internal
2.61% libevas.so.1.18.99 [.] evas_render_updates_internal_loop
1.68% libeo.so.1.18.99 [.] efl_data_scope_get
1.57% libc-2.24.so [.] _int_malloc
1.42% libevas.so.1.18.99 [.] evas_object_smart_changed_get
1.09% libevas.so.1.18.99 [.] evas_object_clip_recalc.part.37
1.08% libpthread-2.24.so [.] pthread_getspecific
1.05% libevas.so.1.18.99 [.] efl_canvas_object_class_get
1.01% libevas.so.1.18.99 [.] evas_object_cur_prev
0.99% libeo.so.1.18.99 [.] _efl_object_event_callback_legacy_call
0.87% libevas.so.1.18.99 [.] _evas_render_phase1_object_ctx_render_cache_append
0.82% libpthread-2.24.so [.] pthread_mutex_lock
0.81% libevas.so.1.18.99 [.] _evas_render_phase1_object_process
0.79% libc-2.24.so [.] _int_free
vs now the improved:
4.82% libevas.so.1.18.99 [.] evas_render_updates_internal
3.44% libevas.so.1.18.99 [.] evas_render_updates_internal_loop
2.65% libeo.so.1.18.99 [.] _eo_obj_pointer_get
2.22% libc-2.24.so [.] _int_malloc
1.46% libevas.so.1.18.99 [.] evas_object_smart_changed_get
1.04% libeo.so.1.18.99 [.] _efl_object_event_callback_legacy_call
1.03% libevas.so.1.18.99 [.] _evas_render_phase1_object_ctx_render_cache_append
0.97% libeina.so.1.18.99 [.] eina_chained_mempool_malloc
0.93% libevas.so.1.18.99 [.] evas_object_clip_recalc.part.37
0.92% libpthread-2.24.so [.] pthread_mutex_lock
0.91% libevas.so.1.18.99 [.] _evas_render_phase1_object_process
0.84% libc-2.24.so [.] _int_free
0.84% libevas.so.1.18.99 [.] evas_object_cur_prev
0.83% libeina.so.1.18.99 [.] eina_chained_mempool_free
0.80% libeo.so.1.18.99 [.] efl_data_scope_get
of course other things "increase their percentage" as oe overhead now
dropped, and things seem to move around a bit, but it does make sense
to do this with no downsides i can see as we already are accessing the
protected data ptr in the parent func.
Now the size evaluation will query for the native size of the
canvas.text object, and continue with calculations to set the min size
of itself.
This fixes a bug in containers where the widget's size wasn't picked up.
Also, the canvas.text object wasn't reporting 'changed' on text changes.
Signed-off-by: Jean-Philippe Andre <jp.andre@samsung.com>
Textblock filters support RGBA input which means legacy styles
can be used in conjunction with filtering. Not recommended, but
it works. Note: We may decide to drop this behaviour and use
alpha-only inputs for simplicity.
Still missing: support for filtering strikethrough, underline, or
embedded items
Filters can have sources like image proxy, and should trigger
a redraw in case the source has changed. Since we cache the
filter's output, we need to first check whether the sources
have changed before reusing a previous output buffer.
If the line height is different from the text item height (eg.
because there are large embedded items) then we need to add
an extra offset to the draw commands.
Note: items themselves are not filtered (yet, at least).
This is a first step before implementing some form of caching of
those output buffers. At the moment, it very aggressively deletes
any buffer that falls outside the clip of the textblock object.
Note that this is better in terms of memory usage but way worse
in terms of render performance (eg. scrolling). If a textblock
is a proxy source then we keep all the buffers (the entire object
is to be rendered).
+ fix a crash
This will be triggered in the rare case when a textblock's
insets are changed (ie. the padding due to filters or style).
This fixes invalid sizing in the test case in elm (due to a
lack of event after program_set).
@feature
This is the most basic optimization that needs to be done for
filters to be useful: cache the output rgba buffers for each
filtered element. Hopefully this doesn't leak. I'm not making
any promises about that though :)
This is a function that allows passing variables from C or EDC
to the filter's Lua code. Useful in particular for color classes
from EDC.
This data would be the global data but we could eventually add
a markup tag to specify a data value per filter instance. For now
a single data value per tb object should be more than enough though.
This makes gfx filters padding work just like the standard style
padding, which means the tb user must offset the object position
by -l, -t and increase the object size by l+r,t+b.
If a gfx filter was applied to a block of text spanning over
multiple text items, then it would improperly render as the
filter context was stored in the format, rather than the text
item. This is fixed by using a list of contexts in the format
node rather than a single context.
This is only for testing purposes for now. Eventually we need
to fix the following things:
- terrible performance (cache buffers)
- force redraws based on filter padding
- expand textblock padding based on max filter padding
- add sources, data and a filter name/code hash
- test! :)
i found evas_common_draw_context_apply_cutouts() was procsessing 300+
cutouts and as it's O(n^2)/2 to try and merge adjacent rects for
cutouts this really performs like complete junk. we apply cutout rects
a LOT. this is not the best solution, but it's quick and much faster
than doing the clipouts which drop framerate to like 1-2fps or so in the
nasty case i say (tyls -m of photos in a dir with a 2160 high
terminal).
this figures out the target area to limit the count of rects
significantly so O(n^2) is far far better when n is now < 10 most of
the time. and for the few operations where it's a high value this now
uses qsort to speed up merges etc. etc.
@optimize
It's a rare case but a possible scenario that textblock is not updated
properly in case of textblock rendering via proxy/map.
If the textblock state turned out with an invisible state,
its relayouting won't be up to date. But actually, it could be rendered
by map/proxy. In that case textblock text layouting would be incorrect.
Additionally, removed evas event freeze state there because map/proxy won't
be drawn under the event freeze state always.
@fix
preparing an object is a good idea. especially with gl. you want to do
texture uploads BEFORE using textures all in one batch. otherwise this
may mean the gl implementation has to make a copy of your data in a
tmp location then copy it in later when texture becomes "unused" as it
may be in use at the moment, or it may have to stall and wait.
i have seen somewhere around 7-10% speedups on nvidia and intel
drivers with this on given a very special test case i brewed up (1000
32x32 images where i change 1 pixel every frame). this should have
impact really when we are modifying textures a lot. this is all i've
implemented for now, but this should/would/could do much more like
re-order map, proxy renders to render FIRST in a pre-render list
instead of inline and to pre-render fbo/buffer content for complex
objects like text or textblock etc.
Coverity reports this as a dereference before null check which implies
that 'cur' May be null here, so let's not use it before we check it.
Fixes CID1363765
Signed-off-by: Chris Michael <cp.michael@samsung.com>
We need a method that allows us to place the cursors at the start and end of an
annotation. This is required for things like getting the geometry of a range.
@feature
The ported geometry_get was actually the legacy simple_geometry_get.
For getting simple geometries like selection this was enough, but I forgot that
we also need to query more complex geometries e.g. links.
This is required to implement link anchors in Ui Text.
Now geometry_get and simple_geometry_get are the same as their legacy
counterparts.
@feature
It has been discussed on the ML (thread: "[RFC] rename efl_self") and
IRC, and has been decided we should rename it to this in order to avoid
confusion with the already established meaning of self which is very
similar to what we were using it for, but didn't have complete overlap.
Kudos to Marcel Hollerbach for initiating the discussion and
fighting for it until he convinced a significant mass. :)
This commit breaks API, and depending on compiler potentially ABI.
@feature
First, fixing ellipsis text positions: ellipsis items should be assigned the
text positions of the omitted text (while maintaining the formatting of the
last visual item). In the case where an entire item was rejected, it
will be assigned that item's text position. If an item was split, it will be
assigned the text position of the split portion.
The BiDi reorder code relies on properly-assigned text positions.
Second, fixing ellipsis handling: the width calc was only considering the
ellipsis item's width. However, if the ellipsis is placed as e.g. the first
visual item (such as in RTL cases), its advance value should've be considered,
instead.
Thanks Youngbok Shin for the test case and information.
@fix
Efl.Object.event_callback_call no longer calls legacy smart callbacks;
calling only event callbacks registered with the given event description
pointer.
Create the method Efl.Object.event_callback_legacy_call to inherit the old
behavior from Efl.Object.event_callback_call, calling both Efl.Object events
and legacy smart callbacks.
Update all other files accordingly in order to still supply legacy
callbacks while they are necessary.
This event should not be exposed at all, it's not necessary
anymore, EFL_EVENT_DEL already exists and should be good enough.
This does move the callback call a little bit ealier in the del
process, but at first glance, this shouldn't have any impact.
The specific handling for (0.0 <= ellip < 1) doesn't support multi-line cases.
One of the main reasons is that we haven't had the chance to define the wanted
behavior for multi-line.
This is a temporary hack to fix a segfault. The behavior is still undefined,
though.
Fixes T3885.
The cursor position was not set correctly to the respective fnode, causing
annotation to not be applied correctly with text that has more than one
paragraph.
The trivial case of [pos,pos] (i.e. range of length 0) didn't work if there is a
format item in 'pos'.
The condition was fixed to not include such items. The reason it was not
apparent for text items is that these have further handling in the rest of the
code and would've been disposed of.
@fix
Summary:
Font size is scaled according to scale factor.
The linesize, linegap formats also have to be scaled properly.
@fix
Test Plan:
Test cases are included.
Run "make check"
Reviewers: woohyun, Jieun, tasn, herdsman
Reviewed By: tasn
Subscribers: raster, cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D3688
The issue is that in some cases we were calling user code (callbacks)
when some of the nodes were referencing already deleted text nodes. This
caused invalid memory access. This commit delays the callback calling
until after all of the cursors got into a consistent legal state.
This was discussed and still wasn't decided whether this is required to be
supported internally.
The reason for this revert is that the behavior still needs tweaking to work
just right along with the legacy behavior.
The cursor update hasn't considered when the pararaph is broken. The reason the
code path is different from legacy is because that it was originally intended to
support append and prepend operations in the new API. Since we don't anymore
(only supporting append operations in the new cursor with 'text_insert'), we can
simplify the insertion implementation and fix this.
The implementation depends on creating different code paths from the now-legacy
behavior of text appending.
The annotation system introduced in this commit replaces the current way of
applying formats on text.
Up until now it has been quite a hassle for the user to control the formats, as
it required keeping track of the format positions with an opener and closer
formats almost every time (with the exception of own-closing formats).
The combination of Efl.Text API along with the Efl.Canvas.Text annotation API
essentially replaces the capabilities of the old format.
There is additional annotation API to allow more control, so be sure to check
the documentation/.eo files and the wiki page of Efl.Canvas.Text.
The style API now accepts actual strings of format style. There is not longer
need to instantiate as style with style_new() followed later by style_free().
@feature
Summary:
add null check in _style_match_tag()
if evas_object_textblock_text_markup_set() is called with markup text before setting style,
segmentation fault is occurred in _style_match_tag()
@fix
Test Plan:
Insert this situation to test suite
-> test id : evas_textblock_simple
Test for without this patch:
1. apply patch just "src/tests/evas/evas_test_textblock.c" partially.
2. $make check
Test for with this patch:
1. apply this patch completely (2 files)
2. $make check
Reviewers: id213sin, herdsman
Subscribers: Blackmole, cedric, jpeg
Projects: #efl
Differential Revision: https://phab.enlightenment.org/D3818
I just ran my script (email to follow) to migrate all of the EFL
automatically. This commit is *only* the automatic conversion, so it can
be easily reverted and re-run.
This optimization makes use of already stringshare'd text and avoids
unnecessary stringshare_add calls in markup_set. It improves the
performance of edje_calc when reapplying text to the textblock part.
The last fix 34020ed131 was missing a
stringshare_del for the NOP case of markup_set. It led to a
constantly increasing ref count of the cached markup.
@fix
The markup cache was completely broken. It was not compared correctly,
so it wasn't even used, but regardless it was cleared just after being
set in some of the cases.
This is the first part of a performance regression fix in elm label.
@fix
This reverts commit 5b083ace84.
The "--enable-hyphen" option refers to using the optional hyphenation
dictionaries. We support hyphenation via SHY-HYPHEN hints regardless of
this option.
The following commit will provide finer handling to address the issue in
the reverted one.
Summary:
Commonly, only few hyphenation dictionaries are used at a application.
So, loading all of dictionary files could cause waste of memory.
Evas textblock has to load hyphenation dictionaries only when it is
really needed.
Test Plan: N/A
Reviewers: woohyun, tasn, herdsman
Subscribers: cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D3626
Summary:
Evas Text, Textblock, Textgrid keeps own language information.
This language information could be vary from the result of setlocale().
Especially, Evas Textblock supports <lang> tag. The language could be
changed in the middle of text. All of these language has to be used
for harfbuzz shaping.
@fix
Test Plan: N/A
Reviewers: herdsman, raster, woohyun, tasn
Reviewed By: tasn
Subscribers: cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D3628
Summary:
If a underline is drawn with seperated thickness and position, it doesn't look good.
It will take the thickest and the lowest underline.
@feature
Test Plan:
Set the following markup text in Evas Textblock.
<underline=on underline_color=#fff><font_size=20>Markup text <font_size=50>with</font_size> underline tag</font_size></underline>
It shows the underline is split to 3 underlines with different thickness and positions.
Commonly, underline has to be drawn with same thickness ans position per each line.
Reviewers: woohyun, herdsman, tasn
Reviewed By: tasn
Subscribers: jpeg, raster, subodh6129, cedric
Differential Revision: https://phab.enlightenment.org/D2971
Summary:
The configuration files for Fontconfig can describe
how font list is made according to language information.
EFL also set the language for each Evas textblock styles
and used for loading font list.
But, this is inconvenient to use if we want to apply language
for loading font list according to system-wide locale information.
This patch will apply locale information for font list if there is
no specific language in description.
And it also add [lang=auto] for Evas Textblock.
auto - It loads locale for language.
none - It disables language.
@feature
Test Plan: N/A
Reviewers: woohyun, herdsman, tasn
Subscribers: jpeg, cedric
Differential Revision: https://phab.enlightenment.org/D3344
Summary:
it->h is sum of max ascent and max descent. It shouldn't be used
when handle ellipsis. Because, Evas Textblock uses these values for
each lines differently according to its location.
(start, end, else, single)
So, for handling ellipsis exactly, it has to be fixed.
Test Plan: A test case is included in Evas Test suite.
Reviewers: woohyun, tasn, herdsman
Subscribers: cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D3475
This patch was *REJECTED*. I don't understand why it was snuck in among
a batch of 24 other unrelated patches. That made me miss it originally,
but found it now. This is wrong and shouldn't be in.
This reverts commit 3f0d0daf0d.
Summary:
Use width of item format to position cursor.
Sometimes it becomes very difficult to
position cursor over item and selection
becomes very difficult as we position the
cursor once the input X coord reached end of the item,
like one attached in the test plan. So this patch
decides over 50% of item width for X coord reaches
to position it at start or end.
@ix
Test Plan:
Attached setup shows how difficult to position cursor at the end when clicked
over item and selection is also very difficult. Consider such case in mobile
device, its becomes impossible to position cursor at the end and selection is
too much difficult.
{F27036}
Also added test cases in evas test suite
Reviewers: herdsman, tasn
Subscribers: cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D3390
Summary:
Even if the given two cursor is NULL, it shouldn't be crashed.
@fix
Test Plan:
Test case included in Evas test suite.
Run "make check".
Reviewers: herdsman, tasn
Subscribers: cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D3422
The line range rectangles geometries needed a bit of adjusting. I
started out with fixing T2648. In order to fill the gap between the end
of the line and the margins, the geometry of the last line's character
was used. I am not really sure why. Anyway, we have the line geometry,
so I replaced it with that.
Then, it led me to do some alignment checks, and indeed alignment cases
were not treated. For instance, an LTR paragraph could have a line
aligned with a value greater than 0.0. That means that we should fill
the gap from the left of the line, if it was the last line in a
multi-line selection. The inverse case is for RTL.
I think it now works as it should. Will see if the selection logic is
missing some more stuff once I come up with more example cases.
Fixes T2648.
@fix
The line_set function should set the cursor to the first logical
position in the line. We can't use the first text position of the
first item in the line, due to BiDi considerations (the line may be
reordered). I've split evas_textblock_cursor_line_char_first to avoid
code duplication, as it already handles these cases.
@fix
Summary:
Evas textblock could cause infinite loop if there is no fonts to use.
If there is no fonts, text_props.text_len is never set.
When text_props.text_len is 0, the for loop in _layout_par runs forever.
It is ridiculous to use Textblock without fonts. But, it shouldn't runs
infinite loop in any situation.
@fix
Test Plan:
1. Remove all of fonts in your EFL or Tizen device.
(Or you can test it modifying some codes in Textblock by skipping load fonts.)
2. Run elementary_test -to entry3 or see any multiline textblocks.
Reviewers: tasn, herdsman, woohyun
Subscribers: cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D3402
Line advance should finalize the line with its last item, and not the
item we're currently wrapping. This fixes T1583, where some line
wrapping cases would look different than their equivalent <ps>
versions.
@fix
Summary:
Text is disappearing when we resize a singleline Evas Textblock with ellipsis.
It is happened by putting a Text item at logical_items list without considering about logical position.
It is only happended the text is made up with multiple items.
@fix
Test Plan:
1. Run elementary_test
2. Click Label Ellipsis
3. Resize the window dynamically and see the result.
Reviewers: woohyun, tasn, herdsman
Subscribers: jpeg, subodh6129, shilpasingh, cedric
Maniphest Tasks: T2709
Differential Revision: https://phab.enlightenment.org/D3022
Summary:
Evas supports UltraLight, UltraBold as font weight.
These terms have same weight value as ExtraLight, ExtraBold.
Some applications, for example, fontforge, use ExtraLight, ExtraBold terms for these weight values.
So, it would be better to support these terms, too.
@feature
Test Plan: None
Reviewers: tasn, woohyun, herdsman
Reviewed By: herdsman
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D3126
We now support hyphenation in style. Use "wrap=hyphenation" to use this
wrap option. It will hyphenate based on explicit SOFT HYPHEN (­)
placement in the text, and with the (optional) assistance of dictionaries
compatible with Hunspell's "hyphen" library.
This wrap mode favors breaking at hyphen positions in a word, over moving
the whole word to the next line. It will put an additional "-" at the
break position if it was hyphened.
Enabling the hyphen dictionaries is done by adding these configure
options:
--enable-hyphen (requires Hunspell's "hyphen" library installed)
--with-dictionaries-hyphen-dir=DIR (specifies the install location of
the actual .dic dictionary files e.g. /usr/share/hyphen)
Note that dictionary files are expected to be in the form of "en_US.dic"
or anything that ends with it e.g. "hyph_en_US.dic" (this how they are
named in Arch Linux).
@feature
Summary:
It adds evas_object_paragraph_direction_set, get APIs.
The APIs set or get paragraph direction to/from the given object.
It changes BiDi calculations and affect the direction and aligning of text.
It doesn't have any effect to text without Fribidi library.
The default paragraph direction is EVAS_BIDI_DIRECTION_INHERIT.
If dir is EVAS_BIDI_DIRECTION_INHERIT, paragraph direction is changed
according to smart parent object. If there is no smart parent object,
paragraph direction works as EVAS_BIDI_DIRECTION_NEUTRAL.
@feature
Test Plan:
Test cases included to the following files.
- evas_test_textblock.c
- evas_test_text.c
- evas_test_object_smart.c
Run "make check".
Reviewers: woohyun, raster, herdsman, tasn
Subscribers: c, raster, cedric
Differential Revision: https://phab.enlightenment.org/D1690
Summary:
If textblock has linegap and multi language, ascent/descent calculation is
incorrect.
In _layout_format_ascent_descent_adjust(), descent is accumulated.
(for example, for a line gap of 50, the first line gap is more than 100)
Test Plan:
Textblock has "linegap=50" and multi language (ex.
"This is a test suite for line gap -
ഈ ലൈൻ വിടവ് ടെസ്റ്റ് ടെസ്റ്റ് ടെസ്റ്റ് ടെസ്റ്റ് ഒരു പരീക്ഷണ വെയര് ")
Added test suite in evas_test_textblock.c file.
Reviewers: tasn
Subscribers: subodh6129, cedric
Differential Revision: https://phab.enlightenment.org/D3311
Summary:
Fix memory leak
Delimiter string is being saved using
eina_stringshare_replace without any del or free
when object is deleted.
@fix
Test Plan: N/A
Reviewers: tasn, herdsman
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D3175
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
If the textblock object was not visible in the main canvas, but
still needs to be rendered in a proxy surface, then _relayout may
not have been called. This forces generation of paragraphs based on
the current geometry.
This patch is ugly. I know. This is evas render :)
Looks like it was assumed that an fnode->orig_format always ends with a
'/' character if the fnode is an own_closer.
The problem is that a paragraph separator ("ps" and "br" - the latter in
legacy newline mode) is also an own_closer, but might not have '/' at the
end, so decrementing the length is wrong.
This fixes T2654. The example markup had "br" read as "b", which led to
a mismatch with the "font_weight=Bold" tag. Coincidentally, "ps" was not
affected as there was no matching "p" in the style.
@fix
This fixes a scenario in which paragraphs in the current layout still
store visual lines from the previous layout. This is possible if the
text uses an ellipsis format, allowing the layout work to stop at a
certain paragraph. This inconsistency affects some query functions that
consider lines which may be irrelevant in the current layout.
Test Case: see added test case to evas_suite.
@fix
Summary:
Introducing a new feature for Evas Textblock. This allows the layout to
wrap around other evas objects.
The following API is added:
- obstacle_add
- obstacle_del
- obstacle_update
Evas objects can now serve as textblock obstacles, if positioned and
visible on the text area. The text will wrap around the obstacles
according to the wrapping mode set to it.
This also modifies the current wrapping code to handle obstacle wrap
points as well. The wrap index query function is modified so that
forward-scanning (specific cases) may be disabled when treating
obstacle wrap point.
RTL text is currently unsupported by this feature.
Consult added docs and example for usage.
@feature
Test Plan: Evas example and test in evas_suite are provided with this.
Reviewers: tasn
Subscribers: raster, JackDanielZ, cedric
Differential Revision: https://phab.enlightenment.org/D2405
This updates it->x when visiting each item in the line layout code,
as it was always 0, even when it was used during item rollback.
Fortunately, in the above case a 0 value was actually expected, so
this does not actually affect current behavior.
This fix is mainly for consistency and future development.
This fixes a case with wrapping, where the text has a mixture of 'none'
and 'word' wrapping modes, and the layout function decides to
roll-back a few items.
The test case is added to the evas_suite.
This might not be a common case, or even a case we had defined a proper
behavior to, but since it causes an infinite loop, it needs to be fixed.
@fix
Let's assume we have a textblock with one paragraph at y = 3 and h = 50
At the moment, passing 60 (after the paragraph) to line_coord_set picks
the last line, however passing 0, just fails. This fixes that.
Thanks to Vladyslav Shevchenko for reporting it in D2574.
@fix
Otherwise there would be conflicts in certain circumstances.
This also requires adding const on many existing functions,
and similar work is necessary in Elementary.
@fix
Summary:
As we always call evas_object_inject in every Evas Object's ctcor,
it seems sensible to move this repeated bit of code to the super
(Evas.Object).
Test Plan: Expedite, Elementary_Test and pretty much everything
Reviewers: cedric, raster
Subscribers: JackDanielZ, cedric
Differential Revision: https://phab.enlightenment.org/D2665
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Summary:
For showing text error like spell error thick underline is used hence added the underline height support.
@feature
Test Plan: test case added in evas textblock test.
Reviewers: raster, shilpasingh, tasn
Subscribers: govi, rajeshps, cedric
Differential Revision: https://phab.enlightenment.org/D2531
TAsn comment: I wonder if the format should be renamed to
underline_relheight instead of height. If you have any thoughts, please
let me know.
From now on, constructors should return a value, usually the object
being worked on, or NULL (if the constructor failed). This can also
be used for implementing singletons, by just always returning the same
object from the constructor.
This is one of the final steps towards stabilizing Eo.
@feature
Summary: It caused crash when clipper is NULL and it makes evas test-suite fail.
Test Plan: Run evas test-suite. (make check)
Reviewers: woohyun, tasn, herdsman, Hermet
Reviewed By: Hermet
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D2215
this adds a lock for when walking all the objects to generate render
commands for an async render. this allows even the object tree walk
plus update area caluclation to be moved off into async if every oject
that can change canvas state actually does so correctly. this change
adds all those lock block calls to synchronise with an async object
tree walk.
Summary:
There was no conversion to the double quotation mark in the evas_textblock_text_utf8_to_markup function.
The price of the text coming out to API and text coming out to Textblock was different as a result.
As a result, Two text lengths came out differently.
So, I added the exceptional treatment part in the evas_textblock_text_utf8_to_markup function.
@fix
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D1853
Summary:
The selection performance is slow if we select large chunk of text.
This is caused by many rectangles created and deleted.
This patch provides a way to improve it by combine selection rectangles
of line in middle into one rectangles (i.e, if we have N lines,
the selection rectangle for lines 2 to N-1 will be combined into one.)
@feature
Reviewers: raster, cedric, tasn
Subscribers: herdsman, woohyun, cedric
Differential Revision: https://phab.enlightenment.org/D1508
Summary:
If a RTL textblock has right margin, text is wrongly placed
(right margin is moved to left).
This patch fixes this issue.
Test cases are also added to test text position with margins.
@fix
Reviewers: tasn, herdsman
Subscribers: woohyun, cedric
Differential Revision: https://phab.enlightenment.org/D1691
Summary:
Since Evas_Textblock_Cursor has pos of type size_t so changed
pos argument in _find_layout_item_line_match from int to size_t
Also Evas_Object_Textblock_Item has text_pos of size_t so defined
variable p of type size_t
Signed-off-by: kabeer khan <kabeer.khan@samsung.com>
Reviewers: tasn
Subscribers: devilhorns, cedric
Differential Revision: https://phab.enlightenment.org/D1692
Summary:
Currently, in cursor geometry get function, the text direction is not
returned if cursor is under cursor.
This patch fixs it by returning text direction for under cursor.
@fix
Reviewers: tasn
Subscribers: herdsman, cedric
Differential Revision: https://phab.enlightenment.org/D1505
Summary:
This fixes an issue that causes BiDi text to get wrapped even when
resizing the textblock to its native size.
The way we find the last visual item in the native line is wrong. The
'visual_pos' describes the visual position in the formatted layout, in
which wrapping may occur. So, this is really bad to use it for native
width calculations as well.
Also, there's no need to actually reorder the line - we just need the
last visual item.
This adds and uses a function very similar to _layout_line_reorder, in
which we retrieve the last visual item in the native line. This
function does not do any actual reordering, as the native layout is
disposed of after calculation is done.
Also, added GET_ITEM_LEN macro for convenience.
Fixes T1532
@fix
Test Plan: Added to evas textblock test suite in this patch
Reviewers: tasn
Subscribers: id213sin, JackDanielZ, cedric
Maniphest Tasks: T1532
Differential Revision: https://phab.enlightenment.org/D1353
Summary:
In some cases of char or word wrapping, an empty line might be
accidentally added at the end of the paragraph. That line contains
no items. Of course, this line should not exist.
One outcome of this is that it causes wrong height values of the
paragraph, when the finalizing code uses the
_layout_last_line_max_descent_adjust_calc, which in turn
looks at that empty line to calculate the descent values.
@fix
Test Plan: Char-wrap and word-wrap tests to test suite included in this revision.
Reviewers: tasn
Subscribers: JackDanielZ, cedric
Projects: #efl
Differential Revision: https://phab.enlightenment.org/D1444
Before this change eo_add() used to create an object with 1 ref, and if
the object had a parent, a second ref.
Now, eo_add() always returns an object with 1 ref, and eo_add_ref()
preserves the old behaviour (for bindings).
eo_unref now un-parents if refcount is 0, and eo_del() is an alias for
eo_unref (will change to be a way to ensure an object is dead and goes
to zombie-land even if still refed).
Summary:
This is a fix to one of the FIXME in the code, evas_object_textblock.c
Signed-off-by: Srivardhan Hebbar <sri.hebbar@samsung.com>
Reviewers: herdsman, tasn
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D1383
Summary:
Evas Textblock ellipsis is handled in a item.
When the ellipsis item is added in the text, some characters are cut off
considering width of ellipsis character.
But, it is handled in only one text item.
If there are many short text item, the ellipsis item can be cut off visually.
And there was a bug in the patch when text is displayed in two lines or more.
The bug is also fixed.
Fixes Phab ticket T1213
@fix
Test Plan: This commit includes test case.
Reviewers: woohyun, seoz, sohyun, tasn, raster
Subscribers: cedric, herdsman
Differential Revision: https://phab.enlightenment.org/D1360
This patch fixes an issue causing text to be cut off in some cases.
The problem was that we were calculating line width and alignment before
we did any bidi calculations, which in turn caused us to use the wrong
text items for those calculations.
Many thanks to Daniel Hirt for investigating this deeply, finding all
the nitty-gritty and generally pointing me to where the problem is.
Daniel also provided the test case.
His patch (D1291) was close, but not enough.
Fixes T1496
@Fix
This reverts commit d408408283.
this breaks mult-line "long" filenames in efm. 2nd line is just ...
for almost all of them (ones that are actually in need of 3 or more
lines). break break! REVERT!
Summary:
Evas Textblock ellipsis is handled in a item.
When the ellipsis item is added in the text, some characters are cut off
considering width of ellipsis character.
But, it is handled in only one text item.
If there are many short text item, the ellipsis item can be cut off visually.
Fixes Phab ticket T1213
@fix
Test Plan: This commit includes test case.
Reviewers: woohyun, seoz, sohyun, tasn
Subscribers: herdsman, cedric
Differential Revision: https://phab.enlightenment.org/D1311
this addresses CID 1230994. as such eina_unicode_unicode_to_utf8()
always returns a nul terminated string. so it's guaranteed. but yes -
if string is 7 bytes or longer it will not put a nul byte on the
destination. as such for a single unicode char this can never happen
as in utf8 it's 6 bytes. but since eina_unicode_unicode_to_utf8()
safely returns a nul terminated string at all times - we can just use
strcpy safely. no need for strncpy. also handle null return from
eina_unicode_unicode_to_utf8()
Summary:
In items loop of _size_native_calc_line_finalize,
last_it should be replaced with new item according to position.
But, visual_pos is not prepared and it is always zero in the function.
So, we need to update visual_pos.
And when textblock only has LTR text,
we can replace last_it according to item list sequence.
@fix
Test Plan:
It includes test cases using the following test case.
1. "i<b>。</b>"
2. "。<b>i</b>"
Reviewers: seoz, woohyun, sohyun, tasn
Subscribers: raster, herdsman, cedric
Differential Revision: https://phab.enlightenment.org/D859
Summary:
We can define a style tag as opener, closer and own closer.
If there is a markup tag that is matched to style tag,
it is reprocessed to format node inside of textblock.
But, when the format node will be converted to markup text,
'/' character can be appended to text at closer and own closer style tag.
Even if original markup tag does not has '/' character,
it will be appended according to format node information.
It makes some issue when compare input text with output text.
@fix
Test Plan: This commit includes test case.
Reviewers: woohyun, raster, sohyun, tasn
Subscribers: herdsman, cedric
Differential Revision: https://phab.enlightenment.org/D1037
Summary:
Word start/end works incorrectly when it goes to new line or line begins with spaces.
Ex: In elementary_test/Entry, place cursor at the end of line, press ctrl + right arrow keys: cursor moves to begin of next line. In this case, cursor should move to end of 1st word in next line.
Ex2: In elementary_test/Entry, add some spaces to begin of 2nd line (" uses markup"), place cursor at the first word ("uses"), press ctrl + left arrow keys twice, cursor moves to begin of 2nd line. In this case, cursor should move to begin of last word in 1st line.
This patch provides a fix by considerring next/previous text node to move cursor to correct place.
@fix
Reviewers: woohyun, raster, tasn
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D1140
Summary:
In evas_textblock_cursor_word_end function, the breaks' memory is allocated but not freed when cursor position is equal to text length.
Fix: Remove memory allocating.
@fix
Reviewers: raster, tasn
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D1225
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
Summary:
When format item is cut off by ellipsis, result of "_find_layout_item_line_match"
can be TEXT type item. And it keeps ellipsis item's information.
@fix
Test Plan: D974
Reviewers: woohyun, tasn
CC: cedric, herdsman
Differential Revision: https://phab.enlightenment.org/D975
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
We need to increase ref count for the format prior to calling of
functions that handle the layout.
This resolves valgrind error of accessing already freed memory.
Please note that a scenerio to trigger this exists in test suite, and
for some reason is not being detected by jenkins.
@fix
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.