fribidi_remove_bidi_marks3
Remove bidi marks out of a string
Usage
#include <../fribidi/lib/fribidi.h>
FriBidiStrIndex fribidi_remove_bidi_marks
(
FriBidiChar *str,
const FriBidiStrIndex len,
FriBidiStrIndex *positions_to_this,
FriBidiStrIndex *position_from_this_list,
FriBidiLevel *embedding_levels
);
Parameters
FriBidiChar *str
|
Input string to clean. |
|---|---|
const FriBidiStrIndex len
|
Input string length. |
FriBidiStrIndex *positions_to_this
|
List mapping positions to the order used in str. |
FriBidiStrIndex *position_from_this_list
|
List mapping positions from the order used in str. |
FriBidiLevel *embedding_levels
|
List of embedding levels. |
Overview
This function removes the bidi and boundary-neutral marks out of a string and the accompanying lists. It implements rule X9 of the Unicode Bidirectional Algorithm available at http://www.unicode.org/reports/tr9/#X9, with the exception that it removes U+200E LEFT-TO-RIGHT MARK and U+200F RIGHT-TO-LEFT MARK too.
If any of the input lists are NULL, the list is skipped. If str is the visual string, then positions_to_this is positions_L_to_V and position_from_this_list is positions_V_to_L; if str is the logical string, the other way. Moreover, the position maps should be filled with valid entries.
A position map pointing to a removed character is filled with −1. By the way, you should not use embedding_levels if str is visual string.
For best results this function should be run on a whole paragraph, not lines; but feel free to do otherwise if you know what you are doing.
Returns
New length of the string, or −1 if an error occurred (memory allocation failure most probably).
Releases
9 releases since Debian 6.0 (Squeeze); the text changed 6 times.