Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions src/raqm.c
Original file line number Diff line number Diff line change
Expand Up @@ -512,8 +512,8 @@ raqm_clear_contents (raqm_t *rq)
* @len: the length of @text.
*
* Adds @text to @rq to be used for layout. It must be a valid UTF-32 text, any
* invalid characters will be replaced with U+FFFD. The text should typically
* represent a full paragraph, since doing the layout of chunks of text
* invalid characters will be replaced with U+FFFD. The text must
* represent a single full paragraph, since doing the layout of chunks of text
* separately can give improper output.
*
* Return value:
Expand Down Expand Up @@ -1300,6 +1300,15 @@ _raqm_itemize (raqm_t *rq);
static bool
_raqm_shape (raqm_t *rq);

static bool
_raqm_is_paragraph_separator (uint32_t ch)
{
/* Unicode characters with Bidi class B (Paragraph_Separator). */
return ch == 0x000A || ch == 0x000D ||
ch == 0x001C || ch == 0x001D || ch == 0x001E ||
ch == 0x0085 || ch == 0x2029;
}

/**
* raqm_layout:
* @rq: a #raqm_t.
Expand All @@ -1309,7 +1318,8 @@ _raqm_shape (raqm_t *rq);
* text shaping, and any other part of the layout process.
*
* Return value:
* `true` if the layout process was successful, `false` otherwise.
* `true` if the layout process was successful, `false` otherwise. It also fails
* if the text is not a single paragraph (see raqm_set_text()).
*
* Since: 0.1
*/
Expand All @@ -1329,6 +1339,10 @@ raqm_layout (raqm_t *rq)
{
if (!rq->text_info[i].ftface)
return false;

/* The text must be a single paragraph. */
if (_raqm_is_paragraph_separator (rq->text[i]))
return false;
}

if (!_raqm_itemize (rq))
Expand Down
45 changes: 0 additions & 45 deletions tests/cursor-position-GB3.test

This file was deleted.

1 change: 0 additions & 1 deletion tests/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ tests = [
'cursor-position-2.test',
'cursor-position-3.test',
'cursor-position-4.test',
#'cursor-position-GB3.test',
'cursor-position-GB4.test',
'cursor-position-GB5.test',
'cursor-position-GB8a.test',
Expand Down
Loading