unsigned int combining_class)
{
hb_glyph_extents_t mark_extents;
- if (!font->get_glyph_extents (buffer->info[i].codepoint,
- &mark_extents))
+ if (!font->get_glyph_extents (buffer->info[i].codepoint, &mark_extents))
return;
hb_position_t y_gap = font->y_scale / 16;
pos.x_offset = pos.y_offset = 0;
- /* We dont position LEFT and RIGHT marks. */
+ /* We don't position LEFT and RIGHT marks. */
/* X positioning */
switch (combining_class)
case HB_UNICODE_COMBINING_CLASS_DOUBLE_BELOW:
case HB_UNICODE_COMBINING_CLASS_DOUBLE_ABOVE:
if (buffer->props.direction == HB_DIRECTION_LTR) {
- pos.x_offset += base_extents.x_bearing - mark_extents.width / 2 - mark_extents.x_bearing;
+ pos.x_offset += base_extents.x_bearing + base_extents.width - mark_extents.width / 2 - mark_extents.x_bearing;
break;
} else if (buffer->props.direction == HB_DIRECTION_RTL) {
- pos.x_offset += base_extents.x_bearing + base_extents.width - mark_extents.width / 2 - mark_extents.x_bearing;
+ pos.x_offset += base_extents.x_bearing - mark_extents.width / 2 - mark_extents.x_bearing;
break;
}
HB_FALLTHROUGH;
unsigned int end)
{
hb_direction_t horiz_dir = HB_DIRECTION_INVALID;
+
+ buffer->unsafe_to_break (base, end);
+
hb_glyph_extents_t base_extents;
if (!font->get_glyph_extents (buffer->info[base].codepoint,
&base_extents))
base_extents.y_bearing += buffer->pos[base].y_offset;
unsigned int lig_id = _hb_glyph_info_get_lig_id (&buffer->info[base]);
- unsigned int num_lig_components = _hb_glyph_info_get_lig_num_comps (&buffer->info[base]);
+ /* Use integer for num_lig_components such that it doesn't convert to unsigned
+ * when we divide or multiply by it. */
+ int num_lig_components = _hb_glyph_info_get_lig_num_comps (&buffer->info[base]);
hb_position_t x_offset = 0, y_offset = 0;
if (HB_DIRECTION_IS_FORWARD (buffer->props.direction)) {
}
hb_glyph_extents_t component_extents = base_extents;
- unsigned int last_lig_component = (unsigned int) -1;
+ int last_lig_component = -1;
unsigned int last_combining_class = 255;
hb_glyph_extents_t cluster_extents = base_extents; /* Initialization is just to shut gcc up. */
hb_glyph_info_t *info = buffer->info;
{
if (num_lig_components > 1) {
unsigned int this_lig_id = _hb_glyph_info_get_lig_id (&info[i]);
- unsigned int this_lig_component = _hb_glyph_info_get_lig_comp (&info[i]) - 1;
+ int this_lig_component = _hb_glyph_info_get_lig_comp (&info[i]) - 1;
/* Conditions for attaching to the last component. */
if (!lig_id || lig_id != this_lig_id || this_lig_component >= num_lig_components)
this_lig_component = num_lig_components - 1;
{
if (!plan->has_kern) return;
- OT::hb_apply_context_t c (1, font, buffer);
+ OT::hb_ot_apply_context_t c (1, font, buffer);
c.set_lookup_mask (plan->kern_mask);
c.set_lookup_props (OT::LookupFlag::IgnoreMarks);
- OT::hb_apply_context_t::skipping_iterator_t &skippy_iter = c.iter_input;
+ OT::hb_ot_apply_context_t::skipping_iterator_t &skippy_iter = c.iter_input;
skippy_iter.init (&c);
unsigned int count = buffer->len;
pos[idx].x_advance += kern1;
pos[skippy_iter.idx].x_advance += kern2;
pos[skippy_iter.idx].x_offset += kern2;
+ buffer->unsafe_to_break (idx, skippy_iter.idx + 1);
}
if (y_kern)
pos[idx].y_advance += kern1;
pos[skippy_iter.idx].y_advance += kern2;
pos[skippy_iter.idx].y_offset += kern2;
+ buffer->unsafe_to_break (idx, skippy_iter.idx + 1);
}
idx = skippy_iter.idx;
break;
case t::SPACE_4_EM_18:
- pos[i].x_advance = font->x_scale * 4 / 18;
+ pos[i].x_advance = (int64_t) font->x_scale * 4 / 18;
break;
case t::SPACE_FIGURE: