diff options
Diffstat (limited to 'src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-arabic.cc')
-rw-r--r-- | src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-arabic.cc | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-arabic.cc b/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-arabic.cc index ae90864127..cde02e0a56 100644 --- a/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-arabic.cc +++ b/src/3rdparty/harfbuzz-ng/src/hb-ot-shape-complex-arabic.cc @@ -24,7 +24,7 @@ * Google Author(s): Behdad Esfahbod */ -#include "hb-ot-shape-complex-private.hh" +#include "hb-ot-shape-complex-arabic-private.hh" #include "hb-ot-shape-private.hh" @@ -33,9 +33,13 @@ /* + * Joining types: + */ + +/* * Bits used in the joining tables */ -enum { +enum hb_arabic_joining_type_t { JOINING_TYPE_U = 0, JOINING_TYPE_L = 1, JOINING_TYPE_R = 2, @@ -49,10 +53,6 @@ enum { JOINING_TYPE_X = 8 /* means: use general-category to choose between U or T. */ }; -/* - * Joining types: - */ - #include "hb-ot-shape-complex-arabic-table.hh" static unsigned int get_joining_type (hb_codepoint_t u, hb_unicode_general_category_t gen_cat) @@ -61,7 +61,7 @@ static unsigned int get_joining_type (hb_codepoint_t u, hb_unicode_general_categ if (likely (j_type != JOINING_TYPE_X)) return j_type; - return (FLAG(gen_cat) & + return (FLAG_SAFE(gen_cat) & (FLAG(HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK) | FLAG(HB_UNICODE_GENERAL_CATEGORY_ENCLOSING_MARK) | FLAG(HB_UNICODE_GENERAL_CATEGORY_FORMAT)) @@ -212,7 +212,7 @@ struct arabic_shape_plan_t arabic_fallback_plan_t *fallback_plan; }; -static void * +void * data_create_arabic (const hb_ot_shape_plan_t *plan) { arabic_shape_plan_t *arabic_plan = (arabic_shape_plan_t *) calloc (1, sizeof (arabic_shape_plan_t)); @@ -230,7 +230,7 @@ data_create_arabic (const hb_ot_shape_plan_t *plan) return arabic_plan; } -static void +void data_destroy_arabic (void *data) { arabic_shape_plan_t *arabic_plan = (arabic_shape_plan_t *) data; @@ -305,17 +305,15 @@ mongolian_variation_selectors (hb_buffer_t *buffer) info[i].arabic_shaping_action() = info[i - 1].arabic_shaping_action(); } -static void -setup_masks_arabic (const hb_ot_shape_plan_t *plan, - hb_buffer_t *buffer, - hb_font_t *font HB_UNUSED) +void +setup_masks_arabic_plan (const arabic_shape_plan_t *arabic_plan, + hb_buffer_t *buffer, + hb_script_t script) { HB_BUFFER_ALLOCATE_VAR (buffer, arabic_shaping_action); - const arabic_shape_plan_t *arabic_plan = (const arabic_shape_plan_t *) plan->data; - arabic_joining (buffer); - if (plan->props.script == HB_SCRIPT_MONGOLIAN) + if (script == HB_SCRIPT_MONGOLIAN) mongolian_variation_selectors (buffer); unsigned int count = buffer->len; @@ -326,6 +324,15 @@ setup_masks_arabic (const hb_ot_shape_plan_t *plan, HB_BUFFER_DEALLOCATE_VAR (buffer, arabic_shaping_action); } +static void +setup_masks_arabic (const hb_ot_shape_plan_t *plan, + hb_buffer_t *buffer, + hb_font_t *font HB_UNUSED) +{ + const arabic_shape_plan_t *arabic_plan = (const arabic_shape_plan_t *) plan->data; + setup_masks_arabic_plan (arabic_plan, buffer, plan->props.script); +} + static void nuke_joiners (const hb_ot_shape_plan_t *plan HB_UNUSED, |