forked from enlightenment/efl
Evas font-engine: Fixed inset to use the string objects instead of strings.
SVN revision: 56895
This commit is contained in:
parent
daafddb571
commit
6e68ec8b42
|
@ -872,8 +872,7 @@ evas_object_text_inset_get(const Evas_Object *obj)
|
|||
MAGIC_CHECK_END();
|
||||
if (!o->engine_data) return 0;
|
||||
if (!o->items) return 0;
|
||||
text = o->items->text;
|
||||
return ENFN->font_inset_get(ENDT, o->engine_data, text);
|
||||
return ENFN->font_inset_get(ENDT, o->engine_data, &o->items->text_props);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -2635,7 +2635,7 @@ _text_item_update_sizes(Ctxt *c, Evas_Object_Textblock_Text_Item *ti)
|
|||
inset = 0;
|
||||
if (fmt->font.font)
|
||||
inset = c->ENFN->font_inset_get(c->ENDT, fmt->font.font,
|
||||
ti->text);
|
||||
&ti->parent.text_props);
|
||||
ti->inset = inset;
|
||||
adv = 0;
|
||||
if (fmt->font.font)
|
||||
|
|
|
@ -57,7 +57,7 @@ EAPI void evas_common_font_all_clear (void);
|
|||
|
||||
EAPI int evas_common_font_query_kerning (RGBA_Font_Int* fi, FT_UInt left, FT_UInt right, int* kerning);
|
||||
EAPI void evas_common_font_query_size (RGBA_Font *fn, const Eina_Unicode *text, const Evas_Text_Props *intl_props, int *w, int *h);
|
||||
EAPI int evas_common_font_query_inset (RGBA_Font *fn, const Eina_Unicode *text);
|
||||
EAPI int evas_common_font_query_inset (RGBA_Font *fn __UNUSED__, const Evas_Text_Props *text_props);
|
||||
EAPI void evas_common_font_query_advance (RGBA_Font *fn, const Eina_Unicode *text, const Evas_Text_Props *intl_props, int *h_adv, int *v_adv);
|
||||
EAPI int evas_common_font_query_char_coords (RGBA_Font *fn, const Eina_Unicode *text, const Evas_Text_Props *intl_props, int pos, int *cx, int *cy, int *cw, int *ch);
|
||||
EAPI int evas_common_font_query_pen_coords (RGBA_Font *fn, const Eina_Unicode *text, const Evas_Text_Props *intl_props, int pos, int *cpen_x, int *cy, int *cadv, int *ch);
|
||||
|
|
|
@ -61,48 +61,10 @@ evas_common_font_query_kerning(RGBA_Font_Int* fi,
|
|||
/* text x inset */
|
||||
/* FIXME: should use OT info when available. */
|
||||
EAPI int
|
||||
evas_common_font_query_inset(RGBA_Font *fn, const Eina_Unicode *text)
|
||||
evas_common_font_query_inset(RGBA_Font *fn __UNUSED__, const Evas_Text_Props *text_props)
|
||||
{
|
||||
FT_UInt index;
|
||||
RGBA_Font_Glyph *fg;
|
||||
int gl;
|
||||
RGBA_Font_Int *fi;
|
||||
|
||||
fi = fn->fonts->data;
|
||||
|
||||
if (!*text) return 0;
|
||||
gl = *text;
|
||||
if (gl == 0) return 0;
|
||||
// evas_common_font_size_use(fn);
|
||||
index = evas_common_font_glyph_search(fn, &fi, gl);
|
||||
LKL(fi->ft_mutex);
|
||||
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;
|
||||
}
|
||||
fg = evas_common_font_int_cache_glyph_get(fi, index);
|
||||
LKU(fi->ft_mutex);
|
||||
if (!fg) return 0;
|
||||
/*
|
||||
INF("fg->glyph_out->left = %i, "
|
||||
"fi->src->ft.face->glyph->bitmap_left = %i, "
|
||||
"fi->src->ft.face->glyph->metrics.horiBearingX = %i, "
|
||||
"fi->src->ft.face->glyph->metrics.horiBearingY = %i, "
|
||||
"fi->src->ft.face->glyph->metrics.horiAdvance = %i"
|
||||
,
|
||||
(int)fg->glyph_out->left,
|
||||
(int)fi->src->ft.face->glyph->bitmap_left,
|
||||
(int)fi->src->ft.face->glyph->metrics.horiBearingX >> 6,
|
||||
(int)fi->src->ft.face->glyph->metrics.horiBearingY >> 6,
|
||||
(int)fi->src->ft.face->glyph->metrics.horiAdvance >> 6
|
||||
);
|
||||
*/
|
||||
evas_common_font_int_use_trim();
|
||||
return fg->glyph_out->left;
|
||||
if (!text_props->len) return 0;
|
||||
return text_props->info->glyph[text_props->start].x_bear;
|
||||
}
|
||||
|
||||
/* size of the string (width and height) in pixels
|
||||
|
|
|
@ -650,7 +650,7 @@ struct _Evas_Func
|
|||
int (*font_max_ascent_get) (void *data, void *font);
|
||||
int (*font_max_descent_get) (void *data, void *font);
|
||||
void (*font_string_size_get) (void *data, void *font, const Eina_Unicode *text, const Evas_Text_Props *intl_props, int *w, int *h);
|
||||
int (*font_inset_get) (void *data, void *font, const Eina_Unicode *text);
|
||||
int (*font_inset_get) (void *data, void *font, const Evas_Text_Props *text_props);
|
||||
int (*font_h_advance_get) (void *data, void *font, const Eina_Unicode *text, const Evas_Text_Props *intl_props);
|
||||
int (*font_v_advance_get) (void *data, void *font, const Eina_Unicode *text, const Evas_Text_Props *intl_props);
|
||||
int (*font_char_coords_get) (void *data, void *font, const Eina_Unicode *text, const Evas_Text_Props *intl_props, int pos, int *cx, int *cy, int *cw, int *ch);
|
||||
|
|
|
@ -89,7 +89,7 @@ static int eng_font_descent_get(void *data, void *font);
|
|||
static int eng_font_max_ascent_get(void *data, void *font);
|
||||
static int eng_font_max_descent_get(void *data, void *font);
|
||||
static void eng_font_string_size_get(void *data, void *font, char *text, int *w, int *h);
|
||||
static int eng_font_inset_get(void *data, void *font, char *text);
|
||||
static int eng_font_inset_get(void *data, void *font, const Evas_Text_Props *intl_props);
|
||||
static int eng_font_h_advance_get(void *data, void *font, char *text);
|
||||
static int eng_font_v_advance_get(void *data, void *font, char *text);
|
||||
static int eng_font_char_coords_get(void *data, void *font, char *text, int pos, int *cx, int *cy, int *cw, int *ch);
|
||||
|
@ -1238,7 +1238,7 @@ eng_font_string_size_get(void *data, void *font, char *text, int *w, int *h)
|
|||
}
|
||||
|
||||
static int
|
||||
eng_font_inset_get(void *data, void *font, char *text)
|
||||
eng_font_inset_get(void *data, void *font, const Evas_Text_Props *intl_props)
|
||||
{
|
||||
Render_Engine *re;
|
||||
|
||||
|
|
|
@ -1050,7 +1050,7 @@ eng_font_string_size_get(void *data, void *font, const char *text, const Evas_Te
|
|||
}
|
||||
|
||||
static int
|
||||
eng_font_inset_get(void *data, void *font, const char *text)
|
||||
eng_font_inset_get(void *data, void *font, const Evas_Text_Props *intl_props)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@ static int eng_font_descent_get(void *data, void *font);
|
|||
static int eng_font_max_ascent_get(void *data, void *font);
|
||||
static int eng_font_max_descent_get(void *data, void *font);
|
||||
static void eng_font_string_size_get(void *data, void *font, const char *text, const Evas_Text_Props *intl_props, int *w, int *h);
|
||||
static int eng_font_inset_get(void *data, void *font, const char *text);
|
||||
static int eng_font_inset_get(void *data, void *font, const Evas_Text_Props *intl_props);
|
||||
static int eng_font_h_advance_get(void *data, void *font, const char *text, const Evas_Text_Props *intl_props);
|
||||
static int eng_font_v_advance_get(void *data, void *font, const char *text, const Evas_Text_Props *intl_props);
|
||||
static int eng_font_char_coords_get(void *data, void *font, const char *text, const Evas_Text_Props *intl_props, int pos, int *cx, int *cy, int *cw, int *ch);
|
||||
|
|
|
@ -511,9 +511,9 @@ eng_font_string_size_get(void *data __UNUSED__, void *font, const Eina_Unicode *
|
|||
}
|
||||
|
||||
static int
|
||||
eng_font_inset_get(void *data __UNUSED__, void *font, const Eina_Unicode *text)
|
||||
eng_font_inset_get(void *data __UNUSED__, void *font, const Evas_Text_Props *text_props)
|
||||
{
|
||||
return evas_common_font_query_inset(font, text);
|
||||
return evas_common_font_query_inset(font, text_props);
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
@ -568,9 +568,9 @@ eng_font_string_size_get(void *data __UNUSED__, void *font, const Eina_Unicode *
|
|||
}
|
||||
|
||||
static int
|
||||
eng_font_inset_get(void *data __UNUSED__, void *font, const Eina_Unicode *text)
|
||||
eng_font_inset_get(void *data __UNUSED__, void *font, const Evas_Text_Props *text_props)
|
||||
{
|
||||
return evas_common_font_query_inset(font, text);
|
||||
return evas_common_font_query_inset(font, text_props);
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
@ -689,9 +689,9 @@ eng_font_string_size_get(void *data __UNUSED__, void *font, const Eina_Unicode *
|
|||
}
|
||||
|
||||
static int
|
||||
eng_font_inset_get(void *data __UNUSED__, void *font, const Eina_Unicode *text)
|
||||
eng_font_inset_get(void *data __UNUSED__, void *font, const Evas_Text_Props *text_props)
|
||||
{
|
||||
return evas_common_font_query_inset(font, text);
|
||||
return evas_common_font_query_inset(font, text_props);
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
Loading…
Reference in New Issue