/* buffer var allocations */
-#define props_cache() var1.u16[0] /* glyph_props cache */
+#define props_cache() var1.u16[1] /* glyph_props cache */
+/* XXX cleanup */
typedef enum {
HB_OT_LAYOUT_GLYPH_CLASS_UNCLASSIFIED = 0x0001,
HB_OT_LAYOUT_GLYPH_CLASS_BASE_GLYPH = 0x0002,
HB_BEGIN_DECLS
+
+/* buffer var allocations */
+#define arabic_shaping_action() var2.u32 /* arabic shaping action */
+
+
/*
* Bits used in the joining tables
*/
for (unsigned int i = 0; i < count; i++)
{
-
- unsigned int this_type = get_joining_type (c->buffer->info[i].codepoint, c->buffer->unicode->v.get_general_category (c->buffer->info[i].codepoint));
+ unsigned int this_type = get_joining_type (c->buffer->info[i].codepoint, (hb_category_t) c->buffer->info[i].general_category());
if (unlikely (this_type == JOINING_TYPE_T)) {
- c->buffer->info[i].var2.u32 = NONE;
+ c->buffer->info[i].arabic_shaping_action() = NONE;
continue;
}
const arabic_state_table_entry *entry = &arabic_state_table[state][this_type];
if (entry->prev_action != NONE)
- c->buffer->info[prev].var2.u32 = entry->prev_action;
+ c->buffer->info[prev].arabic_shaping_action() = entry->prev_action;
- c->buffer->info[i].var2.u32 = entry->curr_action;
+ c->buffer->info[i].arabic_shaping_action() = entry->curr_action;
prev = i;
state = entry->next_state;
mask_array[i] = c->plan->map.get_1_mask (arabic_syriac_features[i]);
for (unsigned int i = 0; i < count; i++)
- c->buffer->info[i].mask |= mask_array[c->buffer->info[i].var2.u32];
+ c->buffer->info[i].mask |= mask_array[c->buffer->info[i].arabic_shaping_action()];
}
HB_BEGIN_DECLS
+
+/* buffer var allocations */
+#define general_category() var1.u8[0] /* unicode general_category (hb_category_t) */
+#define combining_class() var1.u8[1] /* unicode combining_class (uint8_t) */
+
+
enum hb_ot_complex_shaper_t {
hb_ot_complex_shaper_none,
hb_ot_complex_shaper_arabic
hb_mask_t global_mask = c->plan->map.get_global_mask ();
c->buffer->reset_masks (global_mask);
- hb_ot_shape_complex_setup_masks (c);
+ hb_ot_shape_complex_setup_masks (c); /* BUFFER: Clobbers var2 */
for (unsigned int i = 0; i < c->num_user_features; i++)
{
}
static void
+hb_set_unicode_props (hb_ot_shape_context_t *c)
+{
+ hb_unicode_get_general_category_func_t get_general_category = c->buffer->unicode->v.get_general_category;
+ hb_unicode_get_combining_class_func_t get_combining_class = c->buffer->unicode->v.get_combining_class;
+ hb_glyph_info_t *info = c->buffer->info;
+
+ unsigned int count = c->buffer->len;
+ for (unsigned int i = 1; i < count; i++) {
+ info[i].general_category() = get_general_category (info[i].codepoint);
+ info[i].combining_class() = get_combining_class (info[i].codepoint);
+ }
+}
+
+static void
hb_form_clusters (hb_ot_shape_context_t *c)
{
unsigned int count = c->buffer->len;
for (unsigned int i = 1; i < count; i++)
- if (c->buffer->unicode->v.get_general_category (c->buffer->info[i].codepoint) == HB_CATEGORY_NON_SPACING_MARK)
+ if (c->buffer->info[i].general_category() == HB_CATEGORY_NON_SPACING_MARK)
c->buffer->info[i].cluster = c->buffer->info[i - 1].cluster;
}
/* Save the original direction, we use it later. */
c->original_direction = c->buffer->props.direction;
- hb_form_clusters (c);
+ hb_reset_glyph_infos (c); /* BUFFER: Clear buffer var1 and var2 */
- hb_ot_shape_setup_masks (c);
+ hb_set_unicode_props (c); /* BUFFER: Set general_category and combining_class in var1 */
+
+ hb_form_clusters (c);
- hb_reset_glyph_infos (c);
+ hb_ot_shape_setup_masks (c); /* BUFFER: Clobbers var2 */
/* SUBSTITUTE */
{