# General #
The annotation API is planned to replace our way of formatting the text.
In general, we need a way to use API and set a specific style to a given range in the text.
The API should be straightforward and look like the following:
`evas_obj_textblock_annotate_set(tb, start, end, format);`
Once ~~the markup handling in Textblock is properly ported to use this API~~, and duplicate code is removed, the task is considered as done.
## Usage ##
The provided `format` is a string and reflects our current formatting scheme e.g. `color=#ff0` and its counterpart `/color=#ff0`.
Maybe later we will move to another representation like enums, but we will still be required to maintain the current way.
Given `start`, `end` will essentially create both opening and closing format nodes for the style at their respective offsets and text nodes.
Using a negative value for `end` will not create a closing format node. The format can always be closed later with an additional call again with a negative `end` and with the closing format.
This will return a space-separated list of format instances in the specified range. Note that it will not return all the formats that apply on the range (like if a format was added before `start`), but rather just where they were added (at `start` and `end`, usually).
annotate_set(0, 10, "color=#0ff")
annotate_set(5, 10, "font_weight=bold")
formats = annotate_get(5, 10); // formats = "font_wight=bold /color=#0ff /font_weight=bold"