c->y += c->maxascent + c->maxdescent;
if (c->w >= 0)
{
- c->ln->x = c->par->x + c->marginl + c->o->style_pad.l +
+ c->ln->x = c->marginl + c->o->style_pad.l +
((c->w - c->ln->w -
c->o->style_pad.l - c->o->style_pad.r -
c->marginl - c->marginr) * _layout_line_align_get(c));
- if ((c->ln->x + c->ln->w + c->marginr - c->o->style_pad.l) > c->wmax)
- c->wmax = c->ln->x + c->ln->w + c->marginl + c->marginr - c->o->style_pad.l;
+ if ((c->par->x + c->ln->x + c->ln->w + c->marginr - c->o->style_pad.l) > c->wmax)
+ c->wmax = c->par->x + c->ln->x + c->ln->w + c->marginl + c->marginr - c->o->style_pad.l;
}
else
{
- c->ln->x = c->par->x + c->marginl + c->o->style_pad.l;
- if ((c->ln->x + c->ln->w + c->marginr - c->o->style_pad.l) > c->wmax)
- c->wmax = c->ln->x + c->ln->w + c->marginl + c->marginr - c->o->style_pad.l;
+ c->ln->x = c->marginl + c->o->style_pad.l;
+ if ((c->par->x + c->ln->x + c->ln->w + c->marginr - c->o->style_pad.l) > c->wmax)
+ c->wmax = c->par->x + c->ln->x + c->ln->w + c->marginl + c->marginr - c->o->style_pad.l;
}
- c->par->h += c->ln->h;
- c->par->w = c->w;
+ c->par->h = c->ln->y + c->ln->h;
+ if (c->ln->w > c->par->w)
+ c->par->w = c->ln->w;
if (add_line)
_layout_line_new(c, fmt);
}
* or because of an error), cutoff index on success.
*/
static int
-_layout_text_cutoff_get(Ctxt *c, Evas_Object_Textblock_Format *fmt, Evas_Object_Textblock_Text_Item *ti)
+_layout_text_cutoff_get(Ctxt *c, Evas_Object_Textblock_Format *fmt,
+ const Evas_Object_Textblock_Text_Item *ti)
{
if (fmt->font.font)
- return c->ENFN->font_last_up_to_pos(c->ENDT, fmt->font.font, ti->text,
- &ti->parent.text_props,
- c->w -
- c->o->style_pad.l -
- c->o->style_pad.r -
- c->marginl -
- c->marginr -
- c->x,
- 0);
+ {
+ Evas_Coord x;
+ x = c->w - c->o->style_pad.l - c->o->style_pad.r - c->marginl -
+ c->marginr - c->x;
+ if (x < 0)
+ x = 0;
+ return c->ENFN->font_last_up_to_pos(c->ENDT, fmt->font.font, ti->text,
+ &ti->parent.text_props, x, 0);
+ }
return -1;
}
props->ot_data->refcount = 1;
fi = fn->fonts->data;
- if (fi->src->current_size != fi->size)
- {
- FTLOCK();
- FT_Activate_Size(fi->ft.size);
- FTUNLOCK();
- fi->src->current_size = fi->size;
- }
/* Load the font needed for this script */
{
/* Skip common chars */
if (!*tmp && (tmp > text)) tmp--;
evas_common_font_glyph_search(fn, &fi, *tmp);
}
+ evas_common_font_int_reload(fi);
+ if (fi->src->current_size != fi->size)
+ {
+ FTLOCK();
+ FT_Activate_Size(fi->ft.size);
+ FTUNLOCK();
+ fi->src->current_size = fi->size;
+ }
if (len < 0)
{
}
hb_buffer_destroy(buffer);
+ evas_common_font_int_use_trim();
return EINA_FALSE;
}
/* Shaping must be done *BEFORE* breaking to lines so there's no choice but
doing it in textblock. */
- if (!fribidi_reorder_line (FRIBIDI_FLAGS_DEFAULT,
- props->char_types + start,
- len, 0, props->direction,
- props->embedding_levels + start,
- ustr, v_to_l))
{
- goto error;
+ /* FIXME: Hack around fribidi altering embedding_levels */
+ EvasBiDiLevel *emb_lvl;
+ emb_lvl = malloc(len * sizeof(EvasBiDiLevel));
+ memcpy(emb_lvl, props->embedding_levels, len * sizeof(EvasBiDiLevel));
+ if (!fribidi_reorder_line (FRIBIDI_FLAGS_DEFAULT,
+ props->char_types + start,
+ len, 0, props->direction,
+ emb_lvl,
+ ustr, v_to_l))
+ {
+ free(emb_lvl);
+ goto error;
+ }
+ free(emb_lvl);
}