const Evas_Text_Props *text_props, RGBA_Gfx_Func func, int ext_x, int ext_y, int ext_w,
int ext_h, RGBA_Font_Int *fi, int im_w, int im_h __UNUSED__)
{
+#if !defined(OT_SUPPORT) && defined(BIDI_SUPPORT)
+ (void) in_text;
+ const Eina_Unicode *text = text_props->info->shaped_text +
+ text_props->text_offset;
+#else
const Eina_Unicode *text = in_text;
+#endif
DATA32 *im;
FT_Face pface = NULL;
EVAS_FONT_WALK_TEXT_INIT();
if (props->info->ot)
free(props->info->ot);
#endif
+#if !defined(OT_SUPPORT) && defined(BIDI_SUPPORT)
+ if (props->info->shaped_text)
+ free(props->info->shaped_text);
+#endif
free(props->info);
props->info = NULL;
}
EAPI Eina_Bool
evas_common_text_props_content_create(void *_fn, const Eina_Unicode *text,
- Evas_Text_Props *text_props, int len)
+ Evas_Text_Props *text_props, const Evas_BiDi_Paragraph_Props *par_props,
+ size_t par_pos, int len)
{
RGBA_Font *fn = (RGBA_Font *) _fn;
RGBA_Font_Int *fi;
size_t char_index;
Evas_Font_Glyph_Info *gl_itr;
const Eina_Unicode *base_char;
+ (void) par_props;
+ (void) par_pos;
+
evas_common_font_ot_populate_text_props(fn, text, text_props, len);
/* Load the glyph according to the first letter of the script, preety
FT_UInt prev_index;
FT_Face pface = NULL;
int adv_d, i;
+#if !defined(OT_SUPPORT) && defined(BIDI_SUPPORT)
+ text = text_props->info->shaped_text = eina_unicode_strndup(text, len);
+ evas_bidi_shape_string(text_props->info->shaped_text, par_props, par_pos,
+ len);
+#else
+ (void) par_props;
+ (void) par_pos;
+#endif
+
FTLOCK();
use_kerning = FT_HAS_KERNING(fi->src->ft.face);
FTUNLOCK();
unsigned int refcount;
Evas_Font_Glyph_Info *glyph;
Evas_Font_OT_Info *ot;
+#if !defined(OT_SUPPORT) && defined(BIDI_SUPPORT)
+ Eina_Unicode *shaped_text;
+#endif
};
/* Sorted in visual order when created */
EAPI Eina_Bool
evas_common_text_props_content_create(void *_fn, const Eina_Unicode *text,
- Evas_Text_Props *text_props, int len);
+ Evas_Text_Props *text_props, const Evas_BiDi_Paragraph_Props *par_props,
+ size_t par_pos, int len);
void
evas_common_text_props_content_copy_and_ref(Evas_Text_Props *dst,
}
static Eina_Bool
-eng_font_text_props_info_create(void *data __UNUSED__, void *font, const Eina_Unicode *text, Evas_Text_Props *text_props, const Evas_BiDi_Paragraph_Props *par_props, size_t pos, size_t len)
-{
- Eina_Bool ret;
- (void) par_props;
- (void) pos;
-#if !defined(OT_SUPPORT) && defined(BIDI_SUPPORT)
- Eina_Unicode *tmp = eina_unicode_strndup(text, len);
- text = tmp;
- evas_bidi_shape_string(text, par_props, pos, len);
-#endif
- ret = evas_common_text_props_content_create(font, text, text_props, len);
-
-#if !defined(OT_SUPPORT) && defined(BIDI_SUPPORT)
- free(tmp);
-#endif
- return ret;
+eng_font_text_props_info_create(void *data __UNUSED__, void *font, const Eina_Unicode *text, Evas_Text_Props *text_props, const Evas_BiDi_Paragraph_Props *par_props, size_t par_pos, size_t len)
+{
+ return evas_common_text_props_content_create(font, text, text_props,
+ par_props, par_pos, len);
}
static int