hb_direction_t direction)
{
- buffer->direction = direction;
+ buffer->props.direction = direction;
}
hb_direction_t
hb_buffer_get_direction (hb_buffer_t *buffer)
{
- return buffer->direction;
+ return buffer->props.direction;
}
void
hb_buffer_set_script (hb_buffer_t *buffer,
hb_script_t script)
{
- buffer->script = script;
+ buffer->props.script = script;
}
hb_script_t
hb_buffer_get_script (hb_buffer_t *buffer)
{
- return buffer->script;
+ return buffer->props.script;
}
void
hb_buffer_set_language (hb_buffer_t *buffer,
hb_language_t language)
{
- buffer->language = language;
+ buffer->props.language = language;
}
hb_language_t
hb_buffer_get_language (hb_buffer_t *buffer)
{
- return buffer->language;
+ return buffer->props.language;
}
HB_TAG('r','l','i','g')
};
-enum {
- MASK_ALWAYS_ON = 1 << 0,
- MASK_RTLM = 1 << 1
-};
-#define MASK_BITS_USED 2
-
struct lookup_map {
unsigned int index;
hb_mask_t mask;
unsigned int language_index)
{
global_mask = 0;
- next_bit = MASK_BITS_USED;
+ unsigned int next_bit = 1;
if (!count)
return;
unsigned int count;
feature_info_t infos[MAX_FEATURES];
- feature_map_t maps[MAX_FEATURES];
+ feature_map_t maps[MAX_FEATURES];
hb_mask_t global_mask;
- unsigned int next_bit;
};
static void
*num_lookups = 0;
hb_ot_layout_table_choose_script (face, table_tag,
- hb_ot_tags_from_script (buffer->script),
+ hb_ot_tags_from_script (buffer->props.script),
&script_index);
hb_ot_layout_script_find_language (face, table_tag, script_index,
- hb_ot_tag_from_language (buffer->language),
+ hb_ot_tag_from_language (buffer->props.language),
&language_index);
if (hb_ot_layout_language_get_required_feature_index (face, table_tag, script_index, language_index,
break;
case HB_DIRECTION_RTL:
allocator.add_feature (HB_TAG ('r','t','l','a'), 1, true);
- //allocator.add_feature (HB_TAG ('r','t','l','m'), false);
- allocator.add_feature (HB_TAG ('r','t','l','m'), 1, true);
+ allocator.add_feature (HB_TAG ('r','t','l','m'), 1, false);
break;
case HB_DIRECTION_TTB:
case HB_DIRECTION_BTT:
case HB_DIRECTION_RTL:
map = allocator.find_feature (HB_TAG ('r','t','l','a'));
add_feature (face, table_tag, map->index, map->mask, lookups, num_lookups, room_lookups);
- //map = allocator.find_feature (HB_TAG ('r','t','l','m'));
- add_feature (face, table_tag, map->index, MASK_RTLM, lookups, num_lookups, room_lookups);
+ map = allocator.find_feature (HB_TAG ('r','t','l','m'));
+ add_feature (face, table_tag, map->index, map->mask, lookups, num_lookups, room_lookups);
break;
case HB_DIRECTION_TTB:
case HB_DIRECTION_BTT:
static hb_direction_t
hb_ensure_native_direction (hb_buffer_t *buffer)
{
- hb_direction_t original_direction = buffer->direction;
+ hb_direction_t original_direction = buffer->props.direction;
/* TODO vertical */
if (HB_DIRECTION_IS_HORIZONTAL (original_direction) &&
- original_direction != _hb_script_get_horizontal_direction (buffer->script))
+ original_direction != _hb_script_get_horizontal_direction (buffer->props.script))
{
hb_buffer_reverse_clusters (buffer);
- buffer->direction = HB_DIRECTION_REVERSE (buffer->direction);
+ buffer->props.direction = HB_DIRECTION_REVERSE (buffer->props.direction);
}
return original_direction;
{
hb_unicode_get_mirroring_func_t get_mirroring = buffer->unicode->v.get_mirroring;
- if (HB_DIRECTION_IS_FORWARD (buffer->direction))
+ if (HB_DIRECTION_IS_FORWARD (buffer->props.direction))
return;
+// map = allocator.find_feature (HB_TAG ('r','t','l','m'));
+
unsigned int count = buffer->len;
for (unsigned int i = 0; i < count; i++) {
hb_codepoint_t codepoint = get_mirroring (buffer->info[i].codepoint);
if (likely (codepoint == buffer->info[i].codepoint))
- buffer->info[i].mask |= MASK_RTLM;
+;// buffer->info[i].mask |= map->mask;
else
buffer->info[i].codepoint = codepoint;
}
/* SUBSTITUTE */
{
-
buffer->clear_masks ();
/* Mirroring needs to see the original direction */
if (substitute_fallback)
hb_substitute_complex_fallback (font, face, buffer, features, num_features);
-
}
/* POSITION */
{
-
buffer->clear_masks ();
hb_position_default (font, face, buffer, features, num_features);
if (position_fallback)
hb_position_complex_fallback (font, face, buffer, features, num_features);
- if (HB_DIRECTION_IS_BACKWARD (buffer->direction))
+ if (HB_DIRECTION_IS_BACKWARD (buffer->props.direction))
hb_buffer_reverse (buffer);
if (position_fallback)
hb_position_complex_fallback_visual (font, face, buffer, features, num_features);
}
- buffer->direction = original_direction;
+ buffer->props.direction = original_direction;
}