summaryrefslogtreecommitdiff
path: root/src/hb-ot-shape-complex-arabic.cc
diff options
context:
space:
mode:
authorBehdad Esfahbod <behdad@behdad.org>2012-11-13 14:42:35 -0800
committerBehdad Esfahbod <behdad@behdad.org>2012-11-13 14:42:35 -0800
commit0c7df2222862122ebbdc8665a21d6771ef5e0252 (patch)
tree07dfd0dff81bae4108425f9726a4de3d7ac7f55b /src/hb-ot-shape-complex-arabic.cc
parent1c7e55511a870f2689680ca8f977e00879f3b3e3 (diff)
Add buffer flags
New API: hb_buffer_flags_t HB_BUFFER_FLAGS_DEFAULT HB_BUFFER_FLAG_BOT HB_BUFFER_FLAG_EOT HB_BUFFER_FLAG_PRESERVE_DEFAULT_IGNORABLES hb_buffer_set_flags() hb_buffer_get_flags() We use the BOT flag to decide whether to insert dottedcircle if the first char in the buffer is a combining mark. The PRESERVE_DEFAULT_IGNORABLES flag prevents removal of characters like ZWNJ/ZWJ/...
Diffstat (limited to 'src/hb-ot-shape-complex-arabic.cc')
-rw-r--r--src/hb-ot-shape-complex-arabic.cc40
1 files changed, 21 insertions, 19 deletions
diff --git a/src/hb-ot-shape-complex-arabic.cc b/src/hb-ot-shape-complex-arabic.cc
index cba79339..59c97167 100644
--- a/src/hb-ot-shape-complex-arabic.cc
+++ b/src/hb-ot-shape-complex-arabic.cc
@@ -250,17 +250,18 @@ arabic_joining (hb_buffer_t *buffer)
HB_BUFFER_ALLOCATE_VAR (buffer, arabic_shaping_action);
/* Check pre-context */
- for (unsigned int i = 0; i < buffer->context_len[0]; i++)
- {
- unsigned int this_type = get_joining_type (buffer->context[0][i], buffer->unicode->general_category (buffer->context[0][i]));
+ if (!(buffer->flags & HB_BUFFER_FLAG_BOT))
+ for (unsigned int i = 0; i < buffer->context_len[0]; i++)
+ {
+ unsigned int this_type = get_joining_type (buffer->context[0][i], buffer->unicode->general_category (buffer->context[0][i]));
- if (unlikely (this_type == JOINING_TYPE_T))
- continue;
+ if (unlikely (this_type == JOINING_TYPE_T))
+ continue;
- const arabic_state_table_entry *entry = &arabic_state_table[state][this_type];
- state = entry->next_state;
- break;
- }
+ const arabic_state_table_entry *entry = &arabic_state_table[state][this_type];
+ state = entry->next_state;
+ break;
+ }
for (unsigned int i = 0; i < count; i++)
{
@@ -282,18 +283,19 @@ arabic_joining (hb_buffer_t *buffer)
state = entry->next_state;
}
- for (unsigned int i = 0; i < buffer->context_len[1]; i++)
- {
- unsigned int this_type = get_joining_type (buffer->context[1][i], buffer->unicode->general_category (buffer->context[0][i]));
+ if (!(buffer->flags & HB_BUFFER_FLAG_EOT))
+ for (unsigned int i = 0; i < buffer->context_len[1]; i++)
+ {
+ unsigned int this_type = get_joining_type (buffer->context[1][i], buffer->unicode->general_category (buffer->context[0][i]));
- if (unlikely (this_type == JOINING_TYPE_T))
- continue;
+ if (unlikely (this_type == JOINING_TYPE_T))
+ continue;
- const arabic_state_table_entry *entry = &arabic_state_table[state][this_type];
- if (entry->prev_action != NONE && prev != (unsigned int) -1)
- buffer->info[prev].arabic_shaping_action() = entry->prev_action;
- break;
- }
+ const arabic_state_table_entry *entry = &arabic_state_table[state][this_type];
+ if (entry->prev_action != NONE && prev != (unsigned int) -1)
+ buffer->info[prev].arabic_shaping_action() = entry->prev_action;
+ break;
+ }
HB_BUFFER_DEALLOCATE_VAR (buffer, arabic_shaping_action);