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 __UNUSED__, const Evas_Text_Props *text_props);
+EAPI int evas_common_font_query_right_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);
return text_props->info->glyph[text_props->start].x_bear;
}
+/* text right x inset */
+EAPI int
+evas_common_font_query_right_inset(RGBA_Font *fn __UNUSED__, const Evas_Text_Props *text_props)
+{
+ const Evas_Font_Glyph_Info *gli;
+ if (!text_props->len) return 0;
+ gli = text_props->info->glyph + text_props->start + text_props->len - 1;
+
+ return EVAS_FONT_ROUND_26_6_TO_INT(gli->advance) -
+ (gli->width + gli->x_bear
+#ifdef OT_SUPPORT
+ + text_props->info->ot[text_props->start + text_props->len - 1].x_offset
+#endif
+ );
+}
+
/* size of the string (width and height) in pixels
* BiDi handling: We receive the shaped string + other props from text_props,
* We only care about the size, and the size does not depend on the visual order.
int (*image_content_hint_get) (void *data, void *surface);
int (*font_pen_coords_get) (void *data, void *font, const Eina_Unicode *text, const Evas_Text_Props *intl_props, int pos, int *cpen_x, int *cy, int *cadv, int *ch);
Eina_Bool (*font_text_props_info_create) (void *data __UNUSED__, void *font, Eina_Unicode *text, Evas_Text_Props *intl_props, const Evas_BiDi_Paragraph_Props *par_props, size_t pos, size_t len);
+ int (*font_right_inset_get) (void *data, void *font, const Evas_Text_Props *text_props);
};
struct _Evas_Image_Load_Func
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, const Evas_Text_Props *intl_props);
+static int eng_font_right_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);
NULL, // eng_image_content_hint_set - software doesn't use it
NULL, // eng_image_content_hint_get - software doesn't use it
eng_font_pen_coords_get,
- eng_font_text_props_info_create
+ eng_font_text_props_info_create,
+ eng_font_right_inset_get
/* FUTURE software generic calls go here */
};
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 Evas_Text_Props *intl_props);
+static int eng_font_right_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);
}
static int
+eng_font_right_inset_get(void *data __UNUSED__, void *font, const Evas_Text_Props *text_props)
+{
+ return evas_common_font_query_right_inset(font, text_props);
+}
+
+static int
eng_font_h_advance_get(void *data __UNUSED__, void *font, const Eina_Unicode *text, const Evas_Text_Props *text_props)
{
int h, v;
NULL, // eng_image_content_hint_set - software doesn't use it
NULL, // eng_image_content_hint_get - software doesn't use it
eng_font_pen_coords_get,
- eng_font_text_props_info_create
+ eng_font_text_props_info_create,
+ eng_font_right_inset_get
/* FUTURE software generic calls go here */
};
}
static int
+eng_font_right_inset_get(void *data __UNUSED__, void *font, const Evas_Text_Props *text_props)
+{
+ return evas_common_font_query_right_inset(font, text_props);
+}
+
+static int
eng_font_h_advance_get(void *data __UNUSED__, void *font, const Eina_Unicode *text, const Evas_Text_Props *text_props)
{
int h, v;
NULL, // eng_image_content_hint_set - software doesn't use it
NULL, // eng_image_content_hint_get - software doesn't use it
eng_font_pen_coords_get,
- eng_font_text_props_info_create
+ eng_font_text_props_info_create,
+ eng_font_right_inset_get
/* FUTURE software generic calls go here */
};
}
static int
+eng_font_right_inset_get(void *data __UNUSED__, void *font, const Evas_Text_Props *text_props)
+{
+ return evas_common_font_query_right_inset(font, text_props);
+}
+
+static int
eng_font_h_advance_get(void *data __UNUSED__, void *font, const Eina_Unicode *text, const Evas_Text_Props *text_props)
{
int h, v;
NULL, // eng_image_content_hint_set - software doesn't use it
NULL, // eng_image_content_hint_get - software doesn't use it
eng_font_pen_coords_get,
- eng_font_text_props_info_create
+ eng_font_text_props_info_create,
+ eng_font_right_inset_get
/* FUTURE software generic calls go here */
};