Go to the source code of this file.
Typedefs | |
typedef unsigned char | utf8_t |
typedef unsigned short | utf16_t |
typedef unsigned int | utf32_t |
Functions | |
void | init_linebreak (void) |
void | set_linebreaks_utf8 (const utf8_t *s, size_t len, const char *lang, char *brks) |
void | set_linebreaks_utf16 (const utf16_t *s, size_t len, const char *lang, char *brks) |
void | set_linebreaks_utf32 (const utf32_t *s, size_t len, const char *lang, char *brks) |
int | is_line_breakable (utf32_t char1, utf32_t char2, const char *lang) |
Variables | |
const int | linebreak_version |
Header file for the line breaking algorithm.
typedef unsigned char utf8_t |
Type for UTF-8 data points
typedef unsigned short utf16_t |
Type for UTF-16 data points
typedef unsigned int utf32_t |
Type for UTF-32 data points
void init_linebreak | ( | void | ) |
Initializes the second-level index to the line breaking properties. If it is not called, the performance of #get_char_lb_class_lang (and thus the main functionality) can be pretty bad, especially for big code points like those of Chinese.
void set_linebreaks_utf8 | ( | const utf8_t * | s, |
size_t | len, | ||
const char * | lang, | ||
char * | brks | ||
) |
Sets the line breaking information for a UTF-8 input string.
[in] | s | input UTF-8 string |
[in] | len | length of the input |
[in] | lang | language of the input |
[out] | brks | pointer to the output breaking data, containing LINEBREAK_MUSTBREAK, #LINEBREAK_ALLOWBREAK, |
void set_linebreaks_utf16 | ( | const utf16_t * | s, |
size_t | len, | ||
const char * | lang, | ||
char * | brks | ||
) |
Sets the line breaking information for a UTF-16 input string.
[in] | s | input UTF-16 string |
[in] | len | length of the input |
[in] | lang | language of the input |
[out] | brks | pointer to the output breaking data, containing LINEBREAK_MUSTBREAK, #LINEBREAK_ALLOWBREAK, |
void set_linebreaks_utf32 | ( | const utf32_t * | s, |
size_t | len, | ||
const char * | lang, | ||
char * | brks | ||
) |
Sets the line breaking information for a UTF-32 input string.
[in] | s | input UTF-32 string |
[in] | len | length of the input |
[in] | lang | language of the input |
[out] | brks | pointer to the output breaking data, containing LINEBREAK_MUSTBREAK, #LINEBREAK_ALLOWBREAK, |
int is_line_breakable | ( | utf32_t | char1, |
utf32_t | char2, | ||
const char * | lang | ||
) |
Tells whether a line break can occur between two Unicode characters. This is a wrapper function to expose a simple interface. Generally speaking, it is better to use set_linebreaks_utf32 instead, since complicated cases involving combining marks, spaces, etc. cannot be correctly processed.
char1 | the first Unicode character |
char2 | the second Unicode character |
lang | language of the input |
const int linebreak_version |
Version number of the library.