12static bool is_word_delim(
unsigned char c)
17 return c ==
' ' || c ==
'\n' || c ==
'-' || c ==
'_';
21unsigned int ux_layout_paging_compute(
const char *text_to_split,
22 unsigned int page_to_display,
23 ux_layout_paging_state_t *paging_state,
31 memset(paging_state->offsets, 0,
sizeof(paging_state->offsets));
32 memset(paging_state->lengths, 0,
sizeof(paging_state->lengths));
35 if (page_to_display >= paging_state->count && page_to_display != (
unsigned int) -1) {
40 unsigned int page = 0;
41 unsigned int line = 0;
42 const char *start = (text_to_split ?
STRPIC(text_to_split) :
G_ux.externalText);
43 const char *start2 = start;
44 const char *end = start + strlen(start);
47 unsigned int linew = 0;
48 const char *last_word_delim = start;
50 while (start + len < end
52 && linew <= PIXEL_PER_LINE
60 linew = se_compute_line_width_light(start, len + 1,
G_ux.layout_paging.format);
63 if (linew > PIXEL_PER_LINE) {
67 unsigned char c = start[len];
68 if (is_word_delim(c)) {
69 last_word_delim = &start[len];
80 if (start + len < end && last_word_delim != start && len) {
82 if ((!is_word_delim(start[len - 1]) && !is_word_delim(start[len]))) {
83 len = last_word_delim - start;
88 if (page_to_display != (
unsigned int) -1 && page_to_display == page
89 && page_to_display < paging_state->count) {
90 paging_state->offsets[line] = start - start2;
91 paging_state->lengths[line] = len;
94#if UX_LAYOUT_PAGING_LINE_COUNT > 1
95 if (line >= UX_LAYOUT_PAGING_LINE_COUNT - 1)
109#
if UX_LAYOUT_PAGING_LINE_COUNT > 1
110 line >= UX_LAYOUT_PAGING_LINE_COUNT &&
#define BAGL_ENCODING_DEFAULT