Remove evas internal dependency from the evas_font module

Summary:
dev branch : devs/subhransu/font

The Final goal is to move the evas_font module to ector so that both ector and evas can reuse the code.
make the api simple so that sam eapi can be used by evas_textblock and ector text.

This is the 1st stage to achive that gola, first remove the evas internal dependancy as much as possible before moving to ector library.

Reviewers: jpeg, raster, herdsman, cedric, id213sin

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5419
This commit is contained in:
subhransu mohanty 2017-11-07 11:22:09 +09:00 committed by Carsten Haitzler (Rasterman)
parent a75b3dcdfb
commit b038d7df25
22 changed files with 1296 additions and 1188 deletions

View File

@ -493,7 +493,8 @@ lib/evas/common/language/evas_bidi_utils.h \
lib/evas/common/language/evas_language_utils.h \
lib/evas/common/language/evas_script_table.h \
lib/evas/common/evas_text_utils.h \
lib/evas/common/evas_font_ot.h
lib/evas/common/evas_font_ot.h \
lib/evas/common/evas_font_draw.h
lib_evas_libevas_la_CPPFLAGS = -I$(top_builddir)/src/lib/efl \
-I$(top_srcdir)/src/lib/evas/canvas \
@ -1608,7 +1609,7 @@ if BUILD_VG_LOADER_SVG
if EVAS_STATIC_BUILD_VG_SVG
lib_evas_libevas_la_SOURCES += modules/evas/vg_loaders/svg/evas_vg_load_svg.c \
static_libs/vg_common/vg_common.c \
static_libs/vg_common/vg_common.h
static_libs/vg_common/vg_common.h
lib_evas_libevas_la_CPPFLAGS += -I$(top_srcdir)/src/static_libs/vg_common \
@evas_vg_loader_svg_cflags@
lib_evas_libevas_la_LIBADD += @evas_vg_loader_svg_libs@

File diff suppressed because it is too large Load Diff

View File

@ -384,7 +384,7 @@ next_zombie:
EINA_LIST_FREE(e->obscures, r)
eina_rectangle_free(r);
evas_fonts_zero_free(eo_e);
evas_fonts_zero_free();
evas_event_callback_all_del(eo_e);
evas_event_callback_cleanup(eo_e);
@ -1289,6 +1289,139 @@ _evas_pointer_list_in_rect_get(Evas_Public_Data *edata, Evas_Object *obj,
return list;
}
/* font related api */
EOLIAN static void
_evas_canvas_font_path_clear(Eo *eo_e EINA_UNUSED, Evas_Public_Data *evas)
{
evas_canvas_async_block(evas);
while (evas->font_path)
{
eina_stringshare_del(evas->font_path->data);
evas->font_path = eina_list_remove(evas->font_path, evas->font_path->data);
}
}
EOLIAN static void
_evas_canvas_font_path_append(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, const char *path)
{
if (!path) return;
evas_canvas_async_block(e);
e->font_path = eina_list_append(e->font_path, eina_stringshare_add(path));
}
EOLIAN static void
_evas_canvas_font_path_prepend(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, const char *path)
{
if (!path) return;
evas_canvas_async_block(e);
e->font_path = eina_list_prepend(e->font_path, eina_stringshare_add(path));
}
EOLIAN static const Eina_List*
_evas_canvas_font_path_list(const Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
{
return e->font_path;
}
EOLIAN static void
_evas_canvas_font_cache_flush(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
{
evas_canvas_async_block(e);
evas_render_rendering_wait(e);
if (_evas_engine_context(e))
e->engine.func->font_cache_flush(_evas_engine_context(e));
}
EOLIAN static void
_evas_canvas_font_cache_set(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e, int size)
{
if (size < 0) size = 0;
evas_canvas_async_block(e);
evas_render_rendering_wait(e);
if (_evas_engine_context(e))
e->engine.func->font_cache_set(_evas_engine_context(e), size);
}
EOLIAN static int
_evas_canvas_font_cache_get(Eo *eo_e EINA_UNUSED, Evas_Public_Data *e)
{
if (_evas_engine_context(e))
return e->engine.func->font_cache_get(_evas_engine_context(e));
return -1;
}
EOLIAN static Eina_List*
_evas_canvas_font_available_list(const Eo *eo_e EINA_UNUSED, Evas_Public_Data *pd)
{
return evas_font_dir_available_list(pd->font_path);
}
static void
evas_font_object_rehint(Evas_Object *eo_obj)
{
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
if (obj->is_smart)
{
EINA_INLIST_FOREACH(evas_object_smart_members_get_direct(eo_obj), obj)
evas_font_object_rehint(obj->object);
}
else
{
if (!strcmp(obj->type, "text"))
_evas_object_text_rehint(eo_obj);
if (!strcmp(obj->type, "textblock"))
_evas_object_textblock_rehint(eo_obj);
}
}
EAPI void
evas_font_hinting_set(Eo *eo_e, Evas_Font_Hinting_Flags hinting)
{
Evas_Layer *lay;
EVAS_LEGACY_API(eo_e, e);
evas_canvas_async_block(e);
if (e->hinting == hinting) return;
e->hinting = hinting;
EINA_INLIST_FOREACH(e->layers, lay)
{
Evas_Object_Protected_Data *obj;
EINA_INLIST_FOREACH(lay->objects, obj)
evas_font_object_rehint(obj->object);
}
}
EAPI Evas_Font_Hinting_Flags
evas_font_hinting_get(const Evas *eo_e)
{
EVAS_LEGACY_API(eo_e, e, EVAS_FONT_HINTING_NONE);
return e->hinting;
}
EAPI Eina_Bool
evas_font_hinting_can_hint(const Evas *eo_e, Evas_Font_Hinting_Flags hinting)
{
EVAS_LEGACY_API(eo_e, e, EINA_FALSE);
if (e->engine.func->font_hinting_can_hint && _evas_engine_context(e))
return e->engine.func->font_hinting_can_hint(_evas_engine_context(e),
hinting);
else return EINA_FALSE;
}
EAPI void
evas_font_available_list_free(Evas *eo_e, Eina_List *available)
{
MAGIC_CHECK(eo_e, Evas, MAGIC_EVAS);
return;
MAGIC_CHECK_END();
evas_font_dir_available_list_free(available);
}
/* Legacy EAPI */
EAPI Eina_Bool

View File

@ -439,12 +439,15 @@ _evas_text_font_reload(Eo *eo_obj, Evas_Text_Data *o)
/* DO IT */
if (o->font)
{
evas_font_free(obj->layer->evas->evas, o->font);
evas_font_free(o->font);
o->font = NULL;
}
o->font = evas_font_load(obj->layer->evas->evas, o->cur.fdesc, o->cur.source,
(int)(((double) o->cur.size) * obj->cur->scale), o->cur.bitmap_scalable);
o->font = evas_font_load(obj->layer->evas->font_path,
obj->layer->evas->hinting,
o->cur.fdesc, o->cur.source,
(int)(((double) o->cur.size) * obj->cur->scale),
o->cur.bitmap_scalable);
{
o->ascent = 0;
o->descent = 0;
@ -1657,7 +1660,7 @@ evas_object_text_free(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
if (o->bidi_delimiters) eina_stringshare_del(o->bidi_delimiters);
if (o->cur.text) free(o->cur.text);
if (o->font && obj->layer && obj->layer->evas)
evas_font_free(obj->layer->evas->evas, o->font);
evas_font_free(o->font);
o->font = NULL;
o->cur.utf8_text = NULL;
o->cur.font = NULL;
@ -2241,8 +2244,7 @@ _evas_object_text_rehint(Evas_Object *eo_obj)
Eina_List *was = NULL;
if (!o->font) return;
evas_font_load_hinting_set(obj->layer->evas->evas, o->font,
obj->layer->evas->hinting);
evas_font_load_hinting_set(o->font, obj->layer->evas->hinting);
was = _evas_pointer_list_in_rect_get(obj->layer->evas, eo_obj, obj, 1, 1);
/* DO II */
_evas_object_text_recalc(eo_obj, o->cur.text);

View File

@ -1007,7 +1007,7 @@ _format_unref_free(Evas_Object_Protected_Data *evas_o, Evas_Object_Textblock_For
fmt->gfx_filter = NULL;
}
if ((obj->layer) && (obj->layer->evas))
evas_font_free(obj->layer->evas->evas, fmt->font.font);
evas_font_free(fmt->font.font);
free(fmt);
}
@ -2835,8 +2835,12 @@ _format_dup(Evas_Object *eo_obj, const Evas_Object_Textblock_Format *fmt)
if (fmt->font.source) fmt2->font.source = eina_stringshare_add(fmt->font.source);
/* FIXME: just ref the font here... */
fmt2->font.font = evas_font_load(obj->layer->evas->evas, fmt2->font.fdesc,
fmt2->font.source, (int)(((double) fmt2->font.size) * obj->cur->scale), fmt2->font.bitmap_scalable);
fmt2->font.font = evas_font_load(obj->layer->evas->font_path,
obj->layer->evas->hinting,
fmt2->font.fdesc,
fmt2->font.source,
(int)(((double) fmt2->font.size) * obj->cur->scale),
fmt2->font.bitmap_scalable);
if (fmt->gfx_filter)
{
@ -3392,8 +3396,12 @@ _layout_format_push(Ctxt *c, Evas_Object_Textblock_Format *fmt,
fmt->font.fdesc->slant = _FMT_INFO(font_slant);
fmt->font.fdesc->width = _FMT_INFO(font_width);
fmt->font.fdesc->lang = _FMT_INFO(font_lang);
fmt->font.font = evas_font_load(evas_obj->layer->evas->evas, fmt->font.fdesc,
fmt->font.source, (int)(((double) _FMT_INFO(size)) * evas_obj->cur->scale), fmt->font.bitmap_scalable);
fmt->font.font = evas_font_load(evas_obj->layer->evas->font_path,
evas_obj->layer->evas->hinting,
fmt->font.fdesc,
fmt->font.source,
(int)(((double) _FMT_INFO(size)) * evas_obj->cur->scale),
fmt->font.bitmap_scalable);
}
if (_FMT_INFO(gfx_filter_name))
{
@ -4276,7 +4284,7 @@ _text_item_update_sizes(Ctxt *c, Evas_Object_Textblock_Text_Item *ti)
if (shx1 < minx) minx = shx1;
if (shx2 > maxx) maxx = shx2;
ti->x_adjustment = maxx - minx;
ti->parent.w = tw + ti->x_adjustment;
ti->parent.h = th;
ti->parent.adv = advw;
@ -4538,9 +4546,13 @@ _format_finalize(Evas_Object *eo_obj, Evas_Object_Textblock_Format *fmt)
of = fmt->font.font;
fmt->font.font = evas_font_load(obj->layer->evas->evas, fmt->font.fdesc,
fmt->font.source, (int)(((double) fmt->font.size) * obj->cur->scale), fmt->font.bitmap_scalable);
if (of) evas_font_free(obj->layer->evas->evas, of);
fmt->font.font = evas_font_load(obj->layer->evas->font_path,
obj->layer->evas->hinting,
fmt->font.fdesc,
fmt->font.source,
(int)(((double) fmt->font.size) * obj->cur->scale),
fmt->font.bitmap_scalable);
if (of) evas_font_free(of);
}
static Efl_Canvas_Text_Filter_Program *
@ -4666,11 +4678,11 @@ _layout_do_format(const Evas_Object *obj, Ctxt *c,
// item size=20x10 href=name
// item relsize=20x10 href=name
// item abssize=20x10 href=name
//
//
// optional arguments:
// vsize=full
// vsize=ascent
//
//
// size == item size (modifies line size) - can be multiplied by
// scale factor
// relsize == relative size (height is current font height, width
@ -5424,7 +5436,7 @@ _item_get_cutoff(Ctxt *c, Evas_Object_Textblock_Item *it, Evas_Coord x, Evas_Coo
* that don't intersect in whole) will be split, and the rest are set to be
* visually-deleted.
* Note that a special case for visible format items does not
* split them, but instead just visually-deletes them (because there are no
* split them, but instead just visually-deletes them (because there are no
* characters to split).
*/
static inline void
@ -7903,7 +7915,7 @@ _evas_object_textblock_text_markup_get(Eo *eo_obj, Efl_Canvas_Text_Data *o)
{
Eina_Unicode tmp_ch;
off += fnode->offset;
if (off > len) break;
/* No need to skip on the first run */
tmp_ch = text[off];
@ -14597,9 +14609,8 @@ _evas_object_textblock_rehint(Evas_Object *eo_obj)
Evas_Object_Textblock_Text_Item *ti = _ITEM_TEXT(it);
if (ti->parent.format->font.font)
{
evas_font_load_hinting_set(obj->layer->evas->evas,
ti->parent.format->font.font,
obj->layer->evas->hinting);
evas_font_load_hinting_set(ti->parent.format->font.font,
obj->layer->evas->hinting);
}
}
}

View File

@ -210,7 +210,7 @@ evas_object_textgrid_rows_clear(Evas_Object *eo_obj)
}
static void
evas_object_textgrid_free(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
evas_object_textgrid_free(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj EINA_UNUSED)
{
Evas_Object_Textgrid_Color *c;
Evas_Textgrid_Data *o = efl_data_scope_get(eo_obj, MY_CLASS);
@ -223,10 +223,10 @@ evas_object_textgrid_free(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
if (o->cur.font_description_normal)
evas_font_desc_unref(o->cur.font_description_normal);
if (o->font_normal) evas_font_free(obj->layer->evas->evas, o->font_normal);
if (o->font_bold) evas_font_free(obj->layer->evas->evas, o->font_bold);
if (o->font_italic) evas_font_free(obj->layer->evas->evas, o->font_italic);
if (o->font_bolditalic) evas_font_free(obj->layer->evas->evas, o->font_bolditalic);
if (o->font_normal) evas_font_free(o->font_normal);
if (o->font_bold) evas_font_free(o->font_bold);
if (o->font_italic) evas_font_free(o->font_italic);
if (o->font_bolditalic) evas_font_free(o->font_bolditalic);
if (o->cur.cells) free(o->cur.cells);
while ((c = eina_array_pop(&o->cur.palette_standard)))
@ -784,17 +784,17 @@ evas_object_textgrid_render_pre(Evas_Object *eo_obj,
if (r->ch1 >= 0)
{
Evas_Coord chx, chy, chw, chh;
chx = r->ch1 * o->cur.char_width;
chy = i * o->cur.char_height;
chw = (r->ch2 - r->ch1 + 1) * o->cur.char_width;
chh = o->cur.char_height;
chx -= o->cur.char_width;
chy -= o->cur.char_height;
chw += o->cur.char_width * 2;
chh += o->cur.char_height * 2;
chx += obj->cur->geometry.x;
chy += obj->cur->geometry.y;
RECTS_CLIP_TO_RECT(chx, chy, chw, chh,
@ -808,7 +808,7 @@ evas_object_textgrid_render_pre(Evas_Object *eo_obj,
}
}
}
done:
o->core_change = 0;
o->row_change = 0;
@ -1003,11 +1003,12 @@ _alternate_font_weight_slant(Evas_Object_Protected_Data *obj,
int ret = -1;
Evas_Font_Set *font;
font = evas_font_load(obj->layer->evas->evas,
font = evas_font_load(obj->layer->evas->font_path,
obj->layer->evas->hinting,
fdesc,
o->cur.font_source,
(int)(((double) o->cur.font_size) *
obj->cur->scale),
obj->cur->scale),
o->cur.bitmap_scalable);
if (font)
{
@ -1040,7 +1041,7 @@ _alternate_font_weight_slant(Evas_Object_Protected_Data *obj,
(o->cur.char_height != vadvance) ||
(o->ascent != ascent))
{
evas_font_free(obj->layer->evas->evas, font);
evas_font_free(font);
}
else
{
@ -1080,16 +1081,17 @@ _evas_textgrid_font_reload(Eo *eo_obj, Evas_Textgrid_Data *o)
if (o->font_normal)
{
evas_font_free(obj->layer->evas->evas, o->font_normal);
evas_font_free(o->font_normal);
o->font_normal = NULL;
}
o->font_normal = evas_font_load(obj->layer->evas->evas,
o->cur.font_description_normal,
o->cur.font_source,
(int)(((double) o->cur.font_size) *
obj->cur->scale),
o->cur.bitmap_scalable);
o->font_normal = evas_font_load(obj->layer->evas->font_path,
obj->layer->evas->hinting,
o->cur.font_description_normal,
o->cur.font_source,
(int)(((double) o->cur.font_size) *
obj->cur->scale),
o->cur.bitmap_scalable);
if (o->font_normal)
{
Eina_Unicode W[2] = { 'O', 0 };
@ -1133,7 +1135,7 @@ _evas_textgrid_font_reload(Eo *eo_obj, Evas_Textgrid_Data *o)
/* Bold */
if (o->font_bold)
{
evas_font_free(obj->layer->evas->evas, o->font_bold);
evas_font_free(o->font_bold);
o->font_bold = NULL;
}
if ((fdesc->weight == EVAS_FONT_WEIGHT_NORMAL) ||
@ -1153,7 +1155,7 @@ _evas_textgrid_font_reload(Eo *eo_obj, Evas_Textgrid_Data *o)
/* Italic */
if (o->font_italic)
{
evas_font_free(obj->layer->evas->evas, o->font_italic);
evas_font_free(o->font_italic);
o->font_italic = NULL;
}
if (fdesc->slant == EVAS_FONT_SLANT_NORMAL)
@ -1180,7 +1182,7 @@ _evas_textgrid_font_reload(Eo *eo_obj, Evas_Textgrid_Data *o)
/* BoldItalic */
if (o->font_bolditalic)
{
evas_font_free(obj->layer->evas->evas, o->font_bolditalic);
evas_font_free(o->font_bolditalic);
o->font_bolditalic = NULL;
}
if (fdesc->slant == EVAS_FONT_SLANT_NORMAL &&
@ -1384,7 +1386,7 @@ _evas_textgrid_palette_get(const Eo *eo_obj EINA_UNUSED, Evas_Textgrid_Data *o,
default:
return;
}
if (idx >= (int)eina_array_count(palette)) return;
color = eina_array_data_get(palette, idx);
if (!color) return;
@ -1437,16 +1439,16 @@ _evas_textgrid_update_add(Eo *eo_obj, Evas_Textgrid_Data *o, int x, int y, int w
{
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
int i, x2;
RECTS_CLIP_TO_RECT(x, y, w, h, 0, 0, o->cur.w, o->cur.h);
if ((w <= 0) || (h <= 0)) return;
evas_object_async_block(obj);
x2 = x + w - 1;
for (i = 0; i < h; i++)
{
Evas_Object_Textgrid_Row *r = &(o->cur.rows[y + i]);
if (r->ch1 < 0)
{
evas_object_textgrid_row_clear(o, r);

View File

@ -4001,7 +4001,7 @@ _evas_canvas_render_idle_flush(Eo *eo_e, Evas_Public_Data *evas)
evas_render_rendering_wait(evas);
evas_fonts_zero_pressure(eo_e);
evas_fonts_zero_pressure();
if (ENFN && ENFN->output_idle_flush)
{
@ -4125,7 +4125,7 @@ _evas_canvas_render_dump(Eo *eo_e, Evas_Public_Data *evas)
GC_ALL(evas_object_image_load_opts_cow);
GC_ALL(evas_object_image_state_cow);
evas_fonts_zero_pressure(eo_e);
evas_fonts_zero_pressure();
if (ENFN && ENFN->output_idle_flush)
{

View File

@ -433,7 +433,7 @@ _evas_render2_idle_flush(Eo *eo_e)
// wait for rendering to finish so we don't mess up shared resources
_evas_render2_wait(eo_e);
// clean fonts
evas_fonts_zero_pressure(eo_e);
evas_fonts_zero_pressure();
// call engine idle flush call
if ((e->engine.func) && (e->engine.func->output_idle_flush) &&
(e->engine.data.output))

View File

@ -1,9 +1,329 @@
#ifndef _EVAS_FONT_H
#define _EVAS_FONT_H
typedef unsigned char DATA8;
typedef unsigned long long DATA64;
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_GLYPH_H
#include FT_SIZES_H
#include FT_MODULE_H
#ifndef FT_HAS_COLOR
# define FT_HAS_COLOR(face) 0
#endif
#ifndef FT_LOAD_COLOR
# define FT_LOAD_COLOR FT_LOAD_DEFAULT
#endif
#ifdef EAPI
# undef EAPI
#endif
#ifdef _WIN32
# ifdef EFL_EVAS_BUILD
# ifdef DLL_EXPORT
# define EAPI __declspec(dllexport)
# else
# define EAPI
# endif /* ! DLL_EXPORT */
# else
# define EAPI __declspec(dllimport)
# endif /* ! EFL_EVAS_BUILD */
#else
# ifdef __GNUC__
# if __GNUC__ >= 4
# define EAPI __attribute__ ((visibility("default")))
# else
# define EAPI
# endif
# else
# define EAPI
# endif
#endif /* ! _WIN32 */
#include <Eina.h>
#define LK(x) Eina_Lock x
#define LKU(x) eina_lock_release(&(x))
#define LKL(x) eina_lock_take(&(x))
#define LKD(x) eina_lock_free(&(x))
#include "evas_text_utils.h"
enum _Evas_Font_Style
{
EVAS_FONT_STYLE_SLANT,
EVAS_FONT_STYLE_WEIGHT,
EVAS_FONT_STYLE_WIDTH
};
enum _Evas_Font_Slant
{
EVAS_FONT_SLANT_NORMAL,
EVAS_FONT_SLANT_OBLIQUE,
EVAS_FONT_SLANT_ITALIC
};
enum _Evas_Font_Weight
{
EVAS_FONT_WEIGHT_NORMAL,
EVAS_FONT_WEIGHT_THIN,
EVAS_FONT_WEIGHT_ULTRALIGHT,
EVAS_FONT_WEIGHT_EXTRALIGHT,
EVAS_FONT_WEIGHT_LIGHT,
EVAS_FONT_WEIGHT_BOOK,
EVAS_FONT_WEIGHT_MEDIUM,
EVAS_FONT_WEIGHT_SEMIBOLD,
EVAS_FONT_WEIGHT_BOLD,
EVAS_FONT_WEIGHT_ULTRABOLD,
EVAS_FONT_WEIGHT_EXTRABOLD,
EVAS_FONT_WEIGHT_BLACK,
EVAS_FONT_WEIGHT_EXTRABLACK
};
enum _Evas_Font_Width
{
EVAS_FONT_WIDTH_NORMAL,
EVAS_FONT_WIDTH_ULTRACONDENSED,
EVAS_FONT_WIDTH_EXTRACONDENSED,
EVAS_FONT_WIDTH_CONDENSED,
EVAS_FONT_WIDTH_SEMICONDENSED,
EVAS_FONT_WIDTH_SEMIEXPANDED,
EVAS_FONT_WIDTH_EXPANDED,
EVAS_FONT_WIDTH_EXTRAEXPANDED,
EVAS_FONT_WIDTH_ULTRAEXPANDED
};
enum _Evas_Font_Spacing
{
EVAS_FONT_SPACING_PROPORTIONAL,
EVAS_FONT_SPACING_DUAL,
EVAS_FONT_SPACING_MONO,
EVAS_FONT_SPACING_CHARCELL
};
typedef enum _Evas_Font_Style Evas_Font_Style;
typedef enum _Evas_Font_Slant Evas_Font_Slant;
typedef enum _Evas_Font_Weight Evas_Font_Weight;
typedef enum _Evas_Font_Width Evas_Font_Width;
typedef enum _Evas_Font_Spacing Evas_Font_Spacing;
typedef struct _Evas_Font_Dir Evas_Font_Dir;
typedef struct _Evas_Font Evas_Font;
typedef struct _Evas_Font_Alias Evas_Font_Alias;
typedef struct _Evas_Font_Description Evas_Font_Description;
typedef struct _RGBA_Font RGBA_Font;
typedef struct _RGBA_Font_Int RGBA_Font_Int;
typedef struct _RGBA_Font_Source RGBA_Font_Source;
typedef struct _RGBA_Font_Glyph RGBA_Font_Glyph;
typedef struct _RGBA_Font_Glyph_Out RGBA_Font_Glyph_Out;
typedef struct _Fash_Item_Index_Map Fash_Item_Index_Map;
typedef struct _Fash_Int_Map Fash_Int_Map;
typedef struct _Fash_Int_Map2 Fash_Int_Map2;
typedef struct _Fash_Int Fash_Int;
struct _Fash_Item_Index_Map
{
RGBA_Font_Int *fint;
int index;
};
struct _Fash_Int_Map
{
Fash_Item_Index_Map item[256];
};
struct _Fash_Int_Map2
{
Fash_Int_Map *bucket[256];
};
struct _Fash_Int
{
Fash_Int_Map2 *bucket[256];
void (*freeme) (Fash_Int *fash);
};
typedef struct _Fash_Glyph_Map Fash_Glyph_Map;
typedef struct _Fash_Glyph_Map2 Fash_Glyph_Map2;
typedef struct _Fash_Glyph Fash_Glyph;
struct _Fash_Glyph_Map
{
RGBA_Font_Glyph *item[256];
};
struct _Fash_Glyph_Map2
{
Fash_Glyph_Map *bucket[256];
};
struct _Fash_Glyph
{
Fash_Glyph_Map2 *bucket[256];
void (*freeme) (Fash_Glyph *fash);
};
typedef enum _Font_Hint_Flags
{
FONT_NO_HINT,
FONT_AUTO_HINT,
FONT_BYTECODE_HINT
} Font_Hint_Flags;
typedef enum _Font_Rend_Flags
{
FONT_REND_REGULAR = 0,
FONT_REND_SLANT = (1 << 0),
FONT_REND_WEIGHT = (1 << 1),
} Font_Rend_Flags;
struct _RGBA_Font
{
Eina_List *fonts;
Fash_Int *fash;
Font_Hint_Flags hinting;
int references;
LK(lock);
unsigned char sizeok : 1;
};
struct _Evas_Font_Dir
{
Eina_Hash *lookup;
Eina_List *fonts;
Eina_List *aliases;
DATA64 dir_mod_time;
DATA64 fonts_dir_mod_time;
DATA64 fonts_alias_mod_time;
};
struct _Evas_Font
{
struct {
const char *prop[14];
} x;
struct {
const char *name;
} simple;
const char *path;
char type;
};
struct _Evas_Font_Alias
{
const char *alias;
Evas_Font *fn;
};
struct _Evas_Font_Description
{
int ref;
Eina_Stringshare *name;
Eina_Stringshare *fallbacks;
Eina_Stringshare *lang;
Eina_Stringshare *style;
Evas_Font_Slant slant;
Evas_Font_Weight weight;
Evas_Font_Width width;
Evas_Font_Spacing spacing;
Eina_Bool is_new : 1;
};
struct _RGBA_Font_Int
{
EINA_INLIST;
RGBA_Font_Source *src;
Eina_Hash *kerning;
Fash_Glyph *fash;
unsigned int size;
float scale_factor;
int real_size;
int max_h;
int references;
int usage;
struct {
FT_Size size;
#ifdef USE_HARFBUZZ
void *hb_font;
#endif
} ft;
LK(ft_mutex);
Font_Hint_Flags hinting;
Font_Rend_Flags wanted_rend; /* The wanted rendering style */
Font_Rend_Flags runtime_rend; /* The rendering we need to do on runtime
in order to comply with the wanted_rend. */
Eina_List *task;
#ifdef EVAS_CSERVE2
void *cs2_handler;
#endif
int generation;
Efl_Text_Font_Bitmap_Scalable bitmap_scalable;
unsigned char sizeok : 1;
unsigned char inuse : 1;
};
struct _RGBA_Font_Source
{
const char *name;
const char *file;
void *data;
unsigned int current_size;
int data_size;
int references;
struct {
int orig_upem;
FT_Face face;
} ft;
};
/*
* laziness wins for now. The parts used from the freetpye struct are
* kept intact to avoid changing the code using it until we know exactly
* what needs to be changed
*/
struct _RGBA_Font_Glyph_Out
{
unsigned char *rle;
struct {
unsigned char *buffer;
unsigned short rows;
unsigned short width;
unsigned short pitch;
unsigned short rle_alloc : 1;
unsigned short no_free_glout : 1;
} bitmap;
int rle_size;
};
struct _RGBA_Font_Glyph
{
FT_UInt index;
Evas_Coord width;
Evas_Coord x_bear;
Evas_Coord y_bear;
FT_Glyph glyph;
RGBA_Font_Glyph_Out *glyph_out;
/* this is a problem - only 1 engine at a time can extend such a font... grrr */
void *ext_dat;
void (*ext_dat_free) (void *ext_dat);
RGBA_Font_Int *fi;
};
/* The tangent of the slant angle we do on runtime. */
#define _EVAS_FONT_SLANT_TAN 0.221694663
/* main */
EAPI void evas_common_font_init (void);
@ -23,20 +343,9 @@ EAPI int evas_common_font_instance_underline_thickness_get (R
EAPI int evas_common_font_get_line_advance (RGBA_Font *fn);
void *evas_common_font_freetype_face_get(RGBA_Font *font); /* XXX: Not EAPI on purpose. Not ment to be used in modules. */
/* draw */
typedef Eina_Bool (*Evas_Common_Font_Draw_Cb)(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, Evas_Glyph_Array *glyphs, RGBA_Gfx_Func func, int ext_x, int ext_y, int ext_w, int ext_h, int im_w, int im_h);
EAPI Eina_Bool evas_common_font_draw_cb (RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, Evas_Glyph_Array *glyphs, Evas_Common_Font_Draw_Cb cb);
EAPI void evas_common_font_draw (RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, Evas_Glyph_Array *glyphs);
EAPI Eina_Bool evas_common_font_rgba_draw (RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, Evas_Glyph_Array *glyphs, RGBA_Gfx_Func func, int ext_x, int ext_y, int ext_w, int ext_h, int im_w, int im_h);
EAPI int evas_common_font_glyph_search (RGBA_Font *fn, RGBA_Font_Int **fi_ret, Eina_Unicode gl);
EAPI RGBA_Font_Glyph *evas_common_font_int_cache_glyph_get (RGBA_Font_Int *fi, FT_UInt index);
EAPI Eina_Bool evas_common_font_int_cache_glyph_render(RGBA_Font_Glyph *fg);
EAPI FT_UInt evas_common_get_char_index (RGBA_Font_Int* fi, Eina_Unicode gl);
EAPI void evas_common_font_draw_init (void);
EAPI void evas_common_font_draw_prepare (Evas_Text_Props *text_props);
EAPI void evas_common_font_draw_do(const Cutout_Rects *reuse, const Eina_Rectangle *clip, RGBA_Gfx_Func func, RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, const Evas_Text_Props *text_props);
EAPI Eina_Bool evas_common_font_draw_prepare_cutout(Cutout_Rects **reuse, RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Gfx_Func *func);
/* load */
EAPI void evas_common_font_dpi_set (int dpi_h, int dpi_v);
@ -85,10 +394,31 @@ EAPI int evas_common_font_query_run_font_end_get(RGBA_Font *fn, RG
EAPI void evas_common_font_ascent_descent_get(RGBA_Font *fn, const Evas_Text_Props *text_props, int *ascent, int *descent);
EAPI void *evas_common_font_glyph_compress(void *data, int num_grays, int pixel_mode, int pitch_data, int w, int h, int *size_ret);
EAPI void evas_common_font_glyph_draw(RGBA_Font_Glyph *fg, RGBA_Draw_Context *dc, RGBA_Image *dst, int dst_pitch, int dx, int dy, int dw, int dh, int cx, int cy, int cw, int ch);
EAPI DATA8 *evas_common_font_glyph_uncompress(RGBA_Font_Glyph *fg, int *wret, int *hret);
EAPI int evas_common_font_glyph_search (RGBA_Font *fn, RGBA_Font_Int **fi_ret, Eina_Unicode gl);
void evas_common_font_load_init(void);
void evas_common_font_load_shutdown(void);
void evas_font_dir_cache_free(void);
const char *evas_font_dir_cache_find(char *dir, char *font);
Eina_List *evas_font_dir_available_list(const Eina_List *font_paths);
void evas_font_dir_available_list_free(Eina_List *available);
void evas_font_free(void *font);
void evas_fonts_zero_free();
void evas_fonts_zero_pressure();
void evas_font_name_parse(Evas_Font_Description *fdesc, const char *name);
int evas_font_style_find(const char *start, const char *end, Evas_Font_Style style);
Evas_Font_Description *evas_font_desc_new(void);
Evas_Font_Description *evas_font_desc_dup(const Evas_Font_Description *fdesc);
void evas_font_desc_unref(Evas_Font_Description *fdesc);
int evas_font_desc_cmp(const Evas_Font_Description *a, const Evas_Font_Description *b);
Evas_Font_Description *evas_font_desc_ref(Evas_Font_Description *fdesc);
const char *evas_font_lang_normalize(const char *lang);
void * evas_font_load(const Eina_List *font_paths, int hinting, Evas_Font_Description *fdesc, const char *source, Evas_Font_Size size, Efl_Text_Font_Bitmap_Scalable bitmap_scalable);
void evas_font_load_hinting_set(void *font, int hinting);
#undef EAPI
#define EAPI
#endif /* _EVAS_FONT_H */

View File

@ -1,23 +1,9 @@
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <assert.h>
#include "evas_common_private.h"
#include "evas_private.h"
#include "evas_font_private.h"
#include "evas_blend_private.h"
#include "draw.h"
#ifdef EVAS_CSERVE2
# include "../cserve2/evas_cs2_private.h"
#endif
#include FT_OUTLINE_H
#include FT_SYNTHESIS_H
// XXX:
// XXX: adapt cserve2 to this!
// XXX:
@ -128,7 +114,7 @@ alpha8to4(int a8)
// [char] second byte of RLE data
// ...
// [char] last byte of RLE data
//
//
static DATA8 *
compress_rle4(DATA8 *src, int pitch, int w, int h, int *size_ret)
{
@ -247,7 +233,7 @@ static void
decompress_full_row(DATA8 *src, int start, int end, DATA8 *dst)
{
DATA8 *p = src + start, *e = src + end, *d = dst, len, val;
while (p < e)
{
// length is upper 4 bits + 1
@ -377,7 +363,7 @@ decompress_bpp4(DATA8 *src, DATA8 *dst, int pitch, int w, int h)
{
int pitch2, x, y;
DATA8 *d, *s, val;
// deal with source pixel to round up for odd length rows
pitch2 = (w + 1) / 2;
// skip header int
@ -462,7 +448,7 @@ evas_common_font_glyph_uncompress(RGBA_Font_Glyph *fg, int *wret, int *hret)
RGBA_Font_Glyph_Out *fgo = fg->glyph_out;
DATA8 *buf = calloc(1, fgo->bitmap.width * fgo->bitmap.rows);
int *iptr;
if (!buf) return NULL;
if (wret) *wret = fgo->bitmap.width;
if (hret) *hret = fgo->bitmap.rows;
@ -475,154 +461,3 @@ evas_common_font_glyph_uncompress(RGBA_Font_Glyph *fg, int *wret, int *hret)
fgo->bitmap.width, fgo->bitmap.rows);
return buf;
}
// this draws a compressed font glyph and decompresses on the fly as it
// draws, saving memory bandwidth and providing speedups
EAPI void
evas_common_font_glyph_draw(RGBA_Font_Glyph *fg,
RGBA_Draw_Context *dc,
RGBA_Image *dst_image, int dst_pitch,
int dx, int dy, int dw, int dh, int cx, int cy, int cw, int ch)
{
RGBA_Font_Glyph_Out *fgo = fg->glyph_out;
int x, y, w, h, x1, x2, y1, y2, i, *iptr;
DATA32 *dst = dst_image->image.data;
DATA32 coltab[16], col;
DATA16 mtab[16], v;
// FIXME: Use dw, dh for scaling glyphs...
(void) dw;
(void) dh;
x = dx;
y = dy;
w = fgo->bitmap.width; h = fgo->bitmap.rows;
// skip if totally clipped out
if ((y >= (cy + ch)) || ((y + h) <= cy) ||
(x >= (cx + cw)) || ((x + w) <= cx)) return;
// figure y1/y2 limit range
y1 = 0; y2 = h;
if ((y + y1) < cy) y1 = cy - y;
if ((y + y2) > (cy + ch)) y2 = cy + ch - y;
// figure x1/x2 limit range
x1 = 0; x2 = w;
if ((x + x1) < cx) x1 = cx - x;
if ((x + x2) > (cx + cw)) x2 = cx + cw - x;
col = dc->col.col;
if (dst_image->cache_entry.space == EVAS_COLORSPACE_GRY8)
{
// FIXME: Font draw not optimized for Alpha targets! SLOW!
// This is not pretty :)
DATA8 *src8, *dst8;
Draw_Func_Alpha func;
int row;
if (EINA_UNLIKELY(x < 0))
{
x1 += (-x);
x = 0;
if ((x2 - x1) <= 0) return;
}
if (EINA_UNLIKELY(y < 0))
{
y1 += (-y);
y = 0;
if ((y2 - y1) <= 0) return;
}
dst8 = dst_image->image.data8 + x + (y * dst_pitch);
func = efl_draw_alpha_func_get(dc->render_op, EINA_FALSE);
src8 = evas_common_font_glyph_uncompress(fg, NULL, NULL);
if (!src8) return;
for (row = y1; row < y2; row++)
{
DATA8 *d = dst8 + ((row - y1) * dst_pitch);
DATA8 *s = src8 + (row * w) + x1;
func(d, s, x2 - x1);
}
free(src8);
}
else if (dc->clip.mask)
{
RGBA_Gfx_Func func;
DATA8 *src8, *mask;
DATA32 *buf, *ptr, *buf_ptr;
RGBA_Image *im = dc->clip.mask;
int row;
buf = alloca(sizeof(DATA32) * w * h);
// Adjust clipping info
if (EINA_UNLIKELY((x + x1) < dc->clip.mask_x))
x1 = dc->clip.mask_x - x;
if (EINA_UNLIKELY((y + y1) < dc->clip.mask_y))
y1 = dc->clip.mask_y - y;
if (EINA_UNLIKELY((x + x2) > (int)(x + x1 + im->cache_entry.w)))
x2 = x1 + im->cache_entry.w;
if (EINA_UNLIKELY((y + y2) > (int)(y + y1 + im->cache_entry.h)))
y2 = y1 + im->cache_entry.h;
// Step 1: alpha glyph drawing
src8 = evas_common_font_glyph_uncompress(fg, NULL, NULL);
if (!src8) return;
// Step 2: color blending to buffer
func = evas_common_gfx_func_composite_mask_color_span_get(col, dst_image->cache_entry.flags.alpha, 1, EVAS_RENDER_COPY);
for (row = y1; row < y2; row++)
{
buf_ptr = buf + (row * w) + x1;
DATA8 *s = src8 + (row * w) + x1;
func(NULL, s, col, buf_ptr, x2 - x1);
}
free(src8);
// Step 3: masking to destination
func = evas_common_gfx_func_composite_pixel_mask_span_get(im->cache_entry.flags.alpha, im->cache_entry.flags.alpha_sparse, dst_image->cache_entry.flags.alpha, dst_pitch, dc->render_op);
for (row = y1; row < y2; row++)
{
mask = im->image.data8
+ (y + row - dc->clip.mask_y) * im->cache_entry.w
+ (x + x1 - dc->clip.mask_x);
ptr = dst + (x + x1) + ((y + row) * dst_pitch);
buf_ptr = buf + (row * w) + x1;
func(buf_ptr, mask, 0, ptr, w);
}
}
else
{
// build fast multiply + mask color tables to avoid compute. this works
// because of our very limited 4bit range of alpha values
for (i = 0; i <= 0xf; i++)
{
v = (i << 4) | i;
coltab[i] = MUL_SYM(v, col);
mtab[i] = 256 - (coltab[i] >> 24);
}
#ifdef BUILD_MMX
if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
{
#define MMX 1
#include "evas_font_compress_draw.c"
#undef MMX
}
else
#endif
#ifdef BUILD_NEON
if (evas_common_cpu_has_feature(CPU_FEATURE_NEON))
{
#define NEON 1
#include "evas_font_compress_draw.c"
#undef NEON
}
else
#endif
// Plain C
{
#include "evas_font_compress_draw.c"
}
}
}

View File

@ -1,4 +1,4 @@
#include "evas_common_private.h"
#include "evas_font_draw.h"
#include "evas_private.h"
#include "evas_blend_private.h"
@ -6,6 +6,7 @@
#include "evas_font_private.h" /* for Frame-Queuing support */
#include "evas_font_ot.h"
#include "draw.h"
#ifdef EVAS_CSERVE2
#include "../cserve2/evas_cs2_private.h"
@ -507,3 +508,154 @@ evas_common_font_draw_prepare_cutout(Cutout_Rects **reuse, RGBA_Image *dst, RGBA
return EINA_TRUE;
}
// this draws a compressed font glyph and decompresses on the fly as it
// draws, saving memory bandwidth and providing speedups
EAPI void
evas_common_font_glyph_draw(RGBA_Font_Glyph *fg,
RGBA_Draw_Context *dc,
RGBA_Image *dst_image, int dst_pitch,
int dx, int dy, int dw, int dh, int cx, int cy, int cw, int ch)
{
RGBA_Font_Glyph_Out *fgo = fg->glyph_out;
int x, y, w, h, x1, x2, y1, y2, i, *iptr;
DATA32 *dst = dst_image->image.data;
DATA32 coltab[16], col;
DATA16 mtab[16], v;
// FIXME: Use dw, dh for scaling glyphs...
(void) dw;
(void) dh;
x = dx;
y = dy;
w = fgo->bitmap.width; h = fgo->bitmap.rows;
// skip if totally clipped out
if ((y >= (cy + ch)) || ((y + h) <= cy) ||
(x >= (cx + cw)) || ((x + w) <= cx)) return;
// figure y1/y2 limit range
y1 = 0; y2 = h;
if ((y + y1) < cy) y1 = cy - y;
if ((y + y2) > (cy + ch)) y2 = cy + ch - y;
// figure x1/x2 limit range
x1 = 0; x2 = w;
if ((x + x1) < cx) x1 = cx - x;
if ((x + x2) > (cx + cw)) x2 = cx + cw - x;
col = dc->col.col;
if (dst_image->cache_entry.space == EVAS_COLORSPACE_GRY8)
{
// FIXME: Font draw not optimized for Alpha targets! SLOW!
// This is not pretty :)
DATA8 *src8, *dst8;
Draw_Func_Alpha func;
int row;
if (EINA_UNLIKELY(x < 0))
{
x1 += (-x);
x = 0;
if ((x2 - x1) <= 0) return;
}
if (EINA_UNLIKELY(y < 0))
{
y1 += (-y);
y = 0;
if ((y2 - y1) <= 0) return;
}
dst8 = dst_image->image.data8 + x + (y * dst_pitch);
func = efl_draw_alpha_func_get(dc->render_op, EINA_FALSE);
src8 = evas_common_font_glyph_uncompress(fg, NULL, NULL);
if (!src8) return;
for (row = y1; row < y2; row++)
{
DATA8 *d = dst8 + ((row - y1) * dst_pitch);
DATA8 *s = src8 + (row * w) + x1;
func(d, s, x2 - x1);
}
free(src8);
}
else if (dc->clip.mask)
{
RGBA_Gfx_Func func;
DATA8 *src8, *mask;
DATA32 *buf, *ptr, *buf_ptr;
RGBA_Image *im = dc->clip.mask;
int row;
buf = alloca(sizeof(DATA32) * w * h);
// Adjust clipping info
if (EINA_UNLIKELY((x + x1) < dc->clip.mask_x))
x1 = dc->clip.mask_x - x;
if (EINA_UNLIKELY((y + y1) < dc->clip.mask_y))
y1 = dc->clip.mask_y - y;
if (EINA_UNLIKELY((x + x2) > (int)(x + x1 + im->cache_entry.w)))
x2 = x1 + im->cache_entry.w;
if (EINA_UNLIKELY((y + y2) > (int)(y + y1 + im->cache_entry.h)))
y2 = y1 + im->cache_entry.h;
// Step 1: alpha glyph drawing
src8 = evas_common_font_glyph_uncompress(fg, NULL, NULL);
if (!src8) return;
// Step 2: color blending to buffer
func = evas_common_gfx_func_composite_mask_color_span_get(col, dst_image->cache_entry.flags.alpha, 1, EVAS_RENDER_COPY);
for (row = y1; row < y2; row++)
{
buf_ptr = buf + (row * w) + x1;
DATA8 *s = src8 + (row * w) + x1;
func(NULL, s, col, buf_ptr, x2 - x1);
}
free(src8);
// Step 3: masking to destination
func = evas_common_gfx_func_composite_pixel_mask_span_get(im->cache_entry.flags.alpha, im->cache_entry.flags.alpha_sparse, dst_image->cache_entry.flags.alpha, dst_pitch, dc->render_op);
for (row = y1; row < y2; row++)
{
mask = im->image.data8
+ (y + row - dc->clip.mask_y) * im->cache_entry.w
+ (x + x1 - dc->clip.mask_x);
ptr = dst + (x + x1) + ((y + row) * dst_pitch);
buf_ptr = buf + (row * w) + x1;
func(buf_ptr, mask, 0, ptr, w);
}
}
else
{
// build fast multiply + mask color tables to avoid compute. this works
// because of our very limited 4bit range of alpha values
for (i = 0; i <= 0xf; i++)
{
v = (i << 4) | i;
coltab[i] = MUL_SYM(v, col);
mtab[i] = 256 - (coltab[i] >> 24);
}
#ifdef BUILD_MMX
if (evas_common_cpu_has_feature(CPU_FEATURE_MMX))
{
#define MMX 1
#include "evas_font_compress_draw.c"
#undef MMX
}
else
#endif
#ifdef BUILD_NEON
if (evas_common_cpu_has_feature(CPU_FEATURE_NEON))
{
#define NEON 1
#include "evas_font_compress_draw.c"
#undef NEON
}
else
#endif
// Plain C
{
#include "evas_font_compress_draw.c"
}
}
}

View File

@ -0,0 +1,18 @@
#ifndef _EVAS_FONT_DRAW_H
#define _EVAS_FONT_DRAW_
#include "evas_common_private.h"
/* draw */
typedef Eina_Bool (*Evas_Common_Font_Draw_Cb)(RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, Evas_Glyph_Array *glyphs, RGBA_Gfx_Func func, int ext_x, int ext_y, int ext_w, int ext_h, int im_w, int im_h);
EAPI Eina_Bool evas_common_font_draw_cb (RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, Evas_Glyph_Array *glyphs, Evas_Common_Font_Draw_Cb cb);
EAPI void evas_common_font_draw (RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, Evas_Glyph_Array *glyphs);
EAPI Eina_Bool evas_common_font_rgba_draw (RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, Evas_Glyph_Array *glyphs, RGBA_Gfx_Func func, int ext_x, int ext_y, int ext_w, int ext_h, int im_w, int im_h);
EAPI void evas_common_font_draw_init (void);
EAPI void evas_common_font_draw_prepare (Evas_Text_Props *text_props);
EAPI void evas_common_font_draw_do (const Cutout_Rects *reuse, const Eina_Rectangle *clip, RGBA_Gfx_Func func, RGBA_Image *dst, RGBA_Draw_Context *dc, int x, int y, const Evas_Text_Props *text_props);
EAPI Eina_Bool evas_common_font_draw_prepare_cutout (Cutout_Rects **reuse, RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Gfx_Func *func);
EAPI void evas_common_font_glyph_draw (RGBA_Font_Glyph *fg, RGBA_Draw_Context *dc, RGBA_Image *dst, int dst_pitch, int dx, int dy, int dw, int dh, int cx, int cy, int cw, int ch);
#endif /* _EVAS_FONT_DRAW_H */

View File

@ -3,9 +3,7 @@
#endif
#include <assert.h>
#include "evas_common_private.h"
#include "evas_private.h"
#include "evas_font_ot.h"
#ifdef USE_HARFBUZZ
# include <hb.h>
@ -13,7 +11,7 @@
#include "evas_font_private.h" /* for Frame-Queuing support */
#include <ft2build.h>
#include <ft2build.h>
#include FT_TRUETYPE_TABLES_H /* Freetype2 OS/2 font table. */
#ifdef EVAS_CSERVE2
@ -142,7 +140,7 @@ evas_common_font_dpi_set(int dpi_h, int dpi_v)
EAPI RGBA_Font_Source *
evas_common_font_source_memory_load(const char *name, const void *data, int data_size)
{
int error;
int error;
RGBA_Font_Source *fs;
assert(name != NULL);
@ -218,7 +216,7 @@ evas_common_font_source_reload(RGBA_Font_Source *fs)
if (fs->data)
{
int error;
FTLOCK();
error = FT_New_Memory_Face(evas_ft_lib, fs->data, fs->data_size, 0, &(fs->ft.face));
FTUNLOCK();
@ -316,8 +314,8 @@ _evas_common_font_double_int_cmp(const int *key1, EINA_UNUSED int key1_length,
static int
_evas_common_font_double_int_hash(const unsigned int key[2], int key_length)
{
return
eina_hash_int32(&key[0], key_length) ^
return
eina_hash_int32(&key[0], key_length) ^
eina_hash_int32(&key[1], key_length);
}
@ -336,19 +334,17 @@ EAPI RGBA_Font_Int *
evas_common_font_int_memory_load(const char *source, const char *name, int size, const void *data, int data_size, Font_Rend_Flags wanted_rend, Efl_Text_Font_Bitmap_Scalable bitmap_scalable)
{
RGBA_Font_Int *fi;
char *fake_name;
char fake_name[PATH_MAX];
fake_name = evas_file_path_join(source, name);
eina_file_path_join(fake_name, sizeof(fake_name), source, name);
fi = evas_common_font_int_find(fake_name, size, wanted_rend, bitmap_scalable);
if (fi)
{
free(fake_name);
return fi;
}
fi = calloc(1, sizeof(RGBA_Font_Int));
if (!fi)
{
free(fake_name);
return NULL;
}
fi->src = evas_common_font_source_find(fake_name);
@ -356,9 +352,8 @@ evas_common_font_int_memory_load(const char *source, const char *name, int size,
fi->src = evas_common_font_source_memory_load(fake_name, data, data_size);
if (!fi->src)
{
free(fi);
free(fake_name);
return NULL;
free(fi);
return NULL;
}
fi->size = size;
fi->bitmap_scalable = bitmap_scalable;
@ -380,10 +375,19 @@ evas_common_font_int_memory_load(const char *source, const char *name, int size,
}
}
#endif
free(fake_name);
return fi;
}
static int
_file_path_is_file_helper(const char *path)
{
struct stat st;
if (stat(path, &st) == -1) return 0;
if (S_ISREG(st.st_mode)) return 1;
return 0;
}
EAPI RGBA_Font_Int *
evas_common_font_int_load(const char *name, int size,
Font_Rend_Flags wanted_rend,
@ -396,7 +400,7 @@ evas_common_font_int_load(const char *name, int size,
fi = calloc(1, sizeof(RGBA_Font_Int));
if (!fi) return NULL;
fi->src = evas_common_font_source_find(name);
if (!fi->src && evas_file_path_is_file(name))
if (!fi->src && _file_path_is_file_helper(name))
fi->src = evas_common_font_source_load(name);
if (!fi->src)
@ -466,7 +470,7 @@ evas_common_font_int_load_complete(RGBA_Font_Int *fi)
for (i = 0; i < fi->src->ft.face->num_fixed_sizes; i++)
{
int s, cd;
s = fi->src->ft.face->available_sizes[i].size;
cd = chosen_size - fi->real_size;
if (cd < 0) cd = -cd;
@ -853,7 +857,7 @@ void
evas_common_font_int_promote(RGBA_Font_Int *fi EINA_UNUSED)
{
return;
/* unused - keep for reference
/* unused - keep for reference
if (fonts_use_lru == (Eina_Inlist *)fi) return;
if (!fi->inuse) return;
fonts_use_lru = eina_inlist_remove(fonts_use_lru, EINA_INLIST_GET(fi));
@ -871,7 +875,7 @@ void
evas_common_font_int_use_trim(void)
{
return;
/* unused - keep for reference
/* unused - keep for reference
Eina_Inlist *l;
if (fonts_use_usage <= (font_cache << 1)) return;
@ -894,7 +898,7 @@ void
evas_common_font_int_unload(RGBA_Font_Int *fi EINA_UNUSED)
{
return;
/* unused - keep for reference
/* unused - keep for reference
if (!fi->src->ft.face) return;
_evas_common_font_int_clear(fi);
FT_Done_Size(fi->ft.size);
@ -909,7 +913,7 @@ evas_common_font_int_reload(RGBA_Font_Int *fi)
if (fi->src->ft.face) return;
evas_common_font_source_load_complete(fi->src);
return;
/* unused - keep for reference
/* unused - keep for reference
evas_common_font_source_reload(fi->src);
evas_common_font_int_load_complete(fi);
*/
@ -947,7 +951,7 @@ evas_common_font_flush(void)
while (font_cache_usage > font_cache)
{
int pfont_cache_usage;
pfont_cache_usage = font_cache_usage;
evas_common_font_flush_last();
if (pfont_cache_usage == font_cache_usage) break;

View File

@ -1,12 +1,3 @@
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <assert.h>
#include "evas_common_private.h"
#include "evas_private.h"
#include "evas_font_private.h"
#ifdef EVAS_CSERVE2
@ -25,6 +16,8 @@ LK(lock_font_draw); // for freetype2 API calls
LK(lock_bidi); // for evas bidi internal usage.
LK(lock_ot); // for evas bidi internal usage.
int _evas_font_log_dom_global = -1;
EAPI void
evas_common_font_init(void)
{
@ -36,6 +29,12 @@ evas_common_font_init(void)
#else
35;
#endif
_evas_font_log_dom_global = eina_log_domain_register
("evas_font_main", EVAS_FONT_DEFAULT_LOG_COLOR);
if (_evas_font_log_dom_global < 0)
{
EINA_LOG_ERR("Can not create a module log domain.");
}
initialised++;
if (initialised != 1) return;
@ -77,6 +76,7 @@ evas_common_font_shutdown(void)
LKD(lock_font_draw);
LKD(lock_bidi);
LKD(lock_ot);
eina_log_domain_unregister(_evas_font_log_dom_global);
}
EAPI void
@ -681,7 +681,7 @@ evas_common_font_int_cache_glyph_render(RGBA_Font_Glyph *fg)
fg->glyph_out->bitmap.pitch = fbg->bitmap.pitch;
fg->glyph_out->bitmap.buffer = fbg->bitmap.buffer;
fg->glyph_out->bitmap.rle_alloc = EINA_TRUE;
/* This '+ 100' is just an estimation of how much memory freetype will use
* on it's size. This value is not really used anywhere in code - it's
* only for statistics. */
@ -709,7 +709,7 @@ evas_common_font_int_cache_glyph_render(RGBA_Font_Glyph *fg)
fg->glyph_out->rle = NULL;
fg->glyph_out->bitmap.rle_alloc = EINA_FALSE;
}
return EINA_TRUE;
}
@ -805,11 +805,11 @@ evas_common_get_char_index(RGBA_Font_Int* fi, Eina_Unicode gl)
// codepoints with a guess that bitmap font is playing the old
// game of putting line drawing chars in specific ranges
max = sizeof(mapfix) / (sizeof(mapfix[0]) * 2);
i = (min + max) / 2;
i = (min + max) / 2;
for (;;)
{
unsigned short v;
v = mapfix[i << 1];
if (gl == v)
{
@ -867,7 +867,7 @@ evas_common_font_glyph_search(RGBA_Font *fn, RGBA_Font_Int **fi_ret, Eina_Unicod
fi = l->data;
#if 0 /* FIXME: charmap user is disabled and use a deprecated data type. */
/*
/*
if (fi->src->charmap) // Charmap loaded, FI/FS blank
{
idx = evas_array_hash_search(fi->src->charmap, gl);

View File

@ -1,12 +1,10 @@
#include "evas_common_private.h"
#include "evas_font_private.h"
#ifdef USE_HARFBUZZ
# include <hb.h>
# include <hb-ft.h>
#endif
#include "evas_font_private.h"
#ifdef USE_HARFBUZZ
static const hb_script_t
_evas_script_to_harfbuzz[] =

View File

@ -1,6 +1,10 @@
#ifndef _EVAS_FONT_OT_H
# define _EVAS_FONT_OT_H
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
# ifdef HAVE_HARFBUZZ
# define OT_SUPPORT
# define USE_HARFBUZZ
@ -17,8 +21,8 @@ typedef void *Evas_Font_OT_Info;
struct _Evas_Font_OT_Info
{
size_t source_cluster;
Evas_Coord x_offset;
Evas_Coord y_offset;
int x_offset;
int y_offset;
};
# endif
@ -28,7 +32,8 @@ struct _Evas_Font_OT_Info
# define EVAS_FONT_OT_POS_GET(a) ((a).source_cluster)
# endif
# include "evas_text_utils.h"
#include "evas_font.h"
EAPI int
evas_common_font_ot_cluster_size_get(const Evas_Text_Props *props, size_t char_index);

View File

@ -1,10 +1,50 @@
#ifndef _EVAS_FONT_PRIVATE_H
# define _EVAS_FONT_PRIVATE_H
#include "evas_font_ot.h"
#define _EVAS_FONT_PRIVATE_H
#include "evas_font.h"
/* macros needed to log message through eina_log */
extern EAPI int _evas_font_log_dom_global;
#ifdef _EVAS_FONT_DEFAULT_LOG_DOM
# undef _EVAS_FONT_DEFAULT_LOG_DOM
#endif
#define _EVAS_FONT_DEFAULT_LOG_DOM _evas_font_log_dom_global
#ifdef EVAS_FONT_DEFAULT_LOG_COLOR
# undef EVAS_FONT_DEFAULT_LOG_COLOR
#endif
#define EVAS_FONT_DEFAULT_LOG_COLOR EINA_COLOR_BLUE
#ifdef ERR
# undef ERR
#endif
#define ERR(...) EINA_LOG_DOM_ERR(_EVAS_FONT_DEFAULT_LOG_DOM, __VA_ARGS__)
#ifdef DBG
# undef DBG
#endif
#define DBG(...) EINA_LOG_DOM_DBG(_EVAS_FONT_DEFAULT_LOG_DOM, __VA_ARGS__)
#ifdef INF
# undef INF
#endif
#define INF(...) EINA_LOG_DOM_INFO(_EVAS_FONT_DEFAULT_LOG_DOM, __VA_ARGS__)
#ifdef WRN
# undef WRN
#endif
#define WRN(...) EINA_LOG_DOM_WARN(_EVAS_FONT_DEFAULT_LOG_DOM, __VA_ARGS__)
#ifdef CRI
# undef CRI
#endif
#define CRI(...) EINA_LOG_DOM_CRIT(_EVAS_FONT_DEFAULT_LOG_DOM, __VA_ARGS__)
extern LK(lock_font_draw); // for freetype2 API calls
extern LK(lock_bidi); // for fribidi API calls
extern LK(lock_ot); // for harfbuzz calls
# define FTLOCK() LKL(lock_font_draw)
# define FTUNLOCK() LKU(lock_font_draw)

View File

@ -1,7 +1,4 @@
#include "evas_common_private.h"
#include "language/evas_bidi_utils.h" /*defines BIDI_SUPPORT if possible */
#include "evas_font_private.h" /* for Frame-Queuing support */
#include "evas_font_ot.h"
/* FIXME: Check coverage according to the font and not by actually loading */

View File

@ -1,8 +1,4 @@
#include "evas_common_private.h"
#include "evas_font_private.h"
#include "evas_text_utils.h"
#include "language/evas_bidi_utils.h"
#include "language/evas_language_utils.h"
#define PROPS_CHANGE(Props) Props->changed = EINA_TRUE;
@ -47,7 +43,7 @@ evas_common_text_props_content_ref(Evas_Text_Props *props)
return;
props->info->refcount++;
if (props->font_instance)
if (props->font_instance)
((RGBA_Font_Int *)props->font_instance)->references++;
}
@ -541,7 +537,7 @@ evas_common_text_props_content_create(void *_fi, const Eina_Unicode *text,
text_props->font_instance = fi;
fi->references++;
}
evas_common_font_int_reload(fi);
if (fi->src->current_size != fi->size)
{

View File

@ -17,7 +17,6 @@ typedef enum
} Evas_Text_Props_Mode;
# include "evas_font_ot.h"
# include "language/evas_bidi_utils.h"
# include "language/evas_language_utils.h"
/* Used for showing "malformed" or missing chars */
@ -126,7 +125,7 @@ struct _Evas_Font_Glyph_Info
// relative layout info... worry then.
Evas_Coord pen_after; // 4
short x_bear, y_bear, width; // 6
#else
#else
Evas_Coord x_bear; // 4
/* This one is rarely used, only in draw, in which we already get the glyph
* so it doesn't really save time. Leaving it here just so no one will
@ -134,7 +133,7 @@ struct _Evas_Font_Glyph_Info
Evas_Coord y_bear; // 4
Evas_Coord width; // 4
Evas_Coord pen_after; // 4
#endif
#endif
};
void

View File

@ -63,6 +63,8 @@
#include "Evas_Internal.h"
#include "../common/evas_font.h"
#ifdef EAPI
# undef EAPI
#endif
@ -224,20 +226,6 @@ extern EAPI int _evas_log_dom_global;
# define THI(x) int x
# define TH_MAX 8
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_GLYPH_H
#include FT_SIZES_H
#include FT_MODULE_H
#ifndef FT_HAS_COLOR
# define FT_HAS_COLOR(face) 0
#endif
#ifndef FT_LOAD_COLOR
# define FT_LOAD_COLOR FT_LOAD_DEFAULT
#endif
#ifdef __GNUC__
# if __GNUC__ >= 4
// BROKEN in gcc 4 on amd64
@ -430,11 +418,6 @@ typedef struct _RGBA_Draw_Context RGBA_Draw_Context;
typedef struct _RGBA_Polygon_Point RGBA_Polygon_Point;
typedef struct _RGBA_Map_Point RGBA_Map_Point;
typedef struct _RGBA_Map RGBA_Map;
typedef struct _RGBA_Font RGBA_Font;
typedef struct _RGBA_Font_Int RGBA_Font_Int;
typedef struct _RGBA_Font_Source RGBA_Font_Source;
typedef struct _RGBA_Font_Glyph RGBA_Font_Glyph;
typedef struct _RGBA_Font_Glyph_Out RGBA_Font_Glyph_Out;
typedef struct _RGBA_Gfx_Compositor RGBA_Gfx_Compositor;
typedef struct _RGBA_Image_Data_Map RGBA_Image_Data_Map;
@ -478,6 +461,8 @@ typedef void (*Evas_Engine_Thread_Task_Cb)(void *engine_data, Image_Entry *ie, v
#include "../cache2/evas_cache2.h"
#endif
#include "../common/evas_font_draw.h"
/*****************************************************************************/
typedef void (*Evas_Thread_Command_Cb)(void *data);
@ -536,20 +521,6 @@ typedef enum _CPU_Features
CPU_FEATURE_SSE3 = (1 << 7)
} CPU_Features;
typedef enum _Font_Hint_Flags
{
FONT_NO_HINT,
FONT_AUTO_HINT,
FONT_BYTECODE_HINT
} Font_Hint_Flags;
typedef enum _Font_Rend_Flags
{
FONT_REND_REGULAR = 0,
FONT_REND_SLANT = (1 << 0),
FONT_REND_WEIGHT = (1 << 1),
} Font_Rend_Flags;
/*****************************************************************************/
struct _Image_Entry_Flags
@ -792,7 +763,6 @@ struct _RGBA_Draw_Context
#ifdef BUILD_PIPE_RENDER
#include "../common/evas_map_image.h"
#include "../common/evas_text_utils.h"
struct _RGBA_Pipe_Op
{
@ -947,146 +917,6 @@ struct _RGBA_Map
RGBA_Map_Point pts[1];
};
// for fonts...
/////
typedef struct _Fash_Item_Index_Map Fash_Item_Index_Map;
typedef struct _Fash_Int_Map Fash_Int_Map;
typedef struct _Fash_Int_Map2 Fash_Int_Map2;
typedef struct _Fash_Int Fash_Int;
struct _Fash_Item_Index_Map
{
RGBA_Font_Int *fint;
int index;
};
struct _Fash_Int_Map
{
Fash_Item_Index_Map item[256];
};
struct _Fash_Int_Map2
{
Fash_Int_Map *bucket[256];
};
struct _Fash_Int
{
Fash_Int_Map2 *bucket[256];
void (*freeme) (Fash_Int *fash);
};
/////
typedef struct _Fash_Glyph_Map Fash_Glyph_Map;
typedef struct _Fash_Glyph_Map2 Fash_Glyph_Map2;
typedef struct _Fash_Glyph Fash_Glyph;
struct _Fash_Glyph_Map
{
RGBA_Font_Glyph *item[256];
};
struct _Fash_Glyph_Map2
{
Fash_Glyph_Map *bucket[256];
};
struct _Fash_Glyph
{
Fash_Glyph_Map2 *bucket[256];
void (*freeme) (Fash_Glyph *fash);
};
/////
struct _RGBA_Font
{
Eina_List *fonts;
Fash_Int *fash;
Font_Hint_Flags hinting;
int references;
LK(lock);
unsigned char sizeok : 1;
};
#include "../common/evas_font_ot.h"
struct _RGBA_Font_Int
{
EINA_INLIST;
RGBA_Font_Source *src;
Eina_Hash *kerning;
Fash_Glyph *fash;
unsigned int size;
float scale_factor;
int real_size;
int max_h;
int references;
int usage;
struct {
FT_Size size;
#ifdef USE_HARFBUZZ
void *hb_font;
#endif
} ft;
LK(ft_mutex);
Font_Hint_Flags hinting;
Font_Rend_Flags wanted_rend; /* The wanted rendering style */
Font_Rend_Flags runtime_rend; /* The rendering we need to do on runtime
in order to comply with the wanted_rend. */
Eina_List *task;
#ifdef EVAS_CSERVE2
void *cs2_handler;
#endif
int generation;
Efl_Text_Font_Bitmap_Scalable bitmap_scalable;
unsigned char sizeok : 1;
unsigned char inuse : 1;
};
struct _RGBA_Font_Source
{
const char *name;
const char *file;
void *data;
unsigned int current_size;
int data_size;
int references;
struct {
int orig_upem;
FT_Face face;
} ft;
};
/*
* laziness wins for now. The parts used from the freetpye struct are
* kept intact to avoid changing the code using it until we know exactly
* what needs to be changed
*/
struct _RGBA_Font_Glyph_Out
{
unsigned char *rle;
struct {
unsigned char *buffer;
unsigned short rows;
unsigned short width;
unsigned short pitch;
unsigned short rle_alloc : 1;
unsigned short no_free_glout : 1;
} bitmap;
int rle_size;
};
struct _RGBA_Font_Glyph
{
FT_UInt index;
Evas_Coord width;
Evas_Coord x_bear;
Evas_Coord y_bear;
FT_Glyph glyph;
RGBA_Font_Glyph_Out *glyph_out;
/* this is a problem - only 1 engine at a time can extend such a font... grrr */
void *ext_dat;
void (*ext_dat_free) (void *ext_dat);
RGBA_Font_Int *fi;
};
struct _RGBA_Gfx_Compositor
{
const char *name;
@ -1287,7 +1117,6 @@ EAPI void evas_common_blit_init (void);
EAPI void evas_common_blit_rectangle (const RGBA_Image *src, RGBA_Image *dst, int src_x, int src_y, int w, int h, int dst_x, int dst_y);
/****/
#include "../common/evas_font.h"
/****/
EAPI void evas_common_tilebuf_init (void);
@ -1321,8 +1150,6 @@ Tilebuf_Rect *evas_common_regionbuf_rects_get (Regionbuf *rb);
/****/
#include "../common/evas_pipe.h"
void evas_font_dir_cache_free(void);
EAPI void evas_thread_queue_wait(void);
EAPI int evas_async_events_process_blocking(void);

View File

@ -14,12 +14,10 @@
#include "../file/evas_module.h"
#include "../file/evas_path.h"
#include "../common/evas_text_utils.h"
#include "../common/language/evas_bidi_utils.h"
#include "../common/language/evas_language_utils.h"
#include "evas_3d_utils.h"
#ifdef EAPI
# undef EAPI
#endif
@ -66,10 +64,6 @@ typedef struct _Evas_Aspect Evas_Aspect;
typedef struct _Evas_Border Evas_Border;
typedef struct _Evas_Double_Pair Evas_Double_Pair;
typedef struct _Evas_Size_Hints Evas_Size_Hints;
typedef struct _Evas_Font_Dir Evas_Font_Dir;
typedef struct _Evas_Font Evas_Font;
typedef struct _Evas_Font_Alias Evas_Font_Alias;
typedef struct _Evas_Font_Description Evas_Font_Description;
typedef struct _Evas_Data_Node Evas_Data_Node;
typedef struct _Evas_Func Evas_Func;
typedef struct _Evas_Image_Save_Func Evas_Image_Save_Func;
@ -505,64 +499,6 @@ struct _Evas_Canvas3D_Pick_Data
Evas_Real s, t;
};
enum _Evas_Font_Style
{
EVAS_FONT_STYLE_SLANT,
EVAS_FONT_STYLE_WEIGHT,
EVAS_FONT_STYLE_WIDTH
};
enum _Evas_Font_Slant
{
EVAS_FONT_SLANT_NORMAL,
EVAS_FONT_SLANT_OBLIQUE,
EVAS_FONT_SLANT_ITALIC
};
enum _Evas_Font_Weight
{
EVAS_FONT_WEIGHT_NORMAL,
EVAS_FONT_WEIGHT_THIN,
EVAS_FONT_WEIGHT_ULTRALIGHT,
EVAS_FONT_WEIGHT_EXTRALIGHT,
EVAS_FONT_WEIGHT_LIGHT,
EVAS_FONT_WEIGHT_BOOK,
EVAS_FONT_WEIGHT_MEDIUM,
EVAS_FONT_WEIGHT_SEMIBOLD,
EVAS_FONT_WEIGHT_BOLD,
EVAS_FONT_WEIGHT_ULTRABOLD,
EVAS_FONT_WEIGHT_EXTRABOLD,
EVAS_FONT_WEIGHT_BLACK,
EVAS_FONT_WEIGHT_EXTRABLACK
};
enum _Evas_Font_Width
{
EVAS_FONT_WIDTH_NORMAL,
EVAS_FONT_WIDTH_ULTRACONDENSED,
EVAS_FONT_WIDTH_EXTRACONDENSED,
EVAS_FONT_WIDTH_CONDENSED,
EVAS_FONT_WIDTH_SEMICONDENSED,
EVAS_FONT_WIDTH_SEMIEXPANDED,
EVAS_FONT_WIDTH_EXPANDED,
EVAS_FONT_WIDTH_EXTRAEXPANDED,
EVAS_FONT_WIDTH_ULTRAEXPANDED
};
enum _Evas_Font_Spacing
{
EVAS_FONT_SPACING_PROPORTIONAL,
EVAS_FONT_SPACING_DUAL,
EVAS_FONT_SPACING_MONO,
EVAS_FONT_SPACING_CHARCELL
};
typedef enum _Evas_Font_Style Evas_Font_Style;
typedef enum _Evas_Font_Slant Evas_Font_Slant;
typedef enum _Evas_Font_Weight Evas_Font_Weight;
typedef enum _Evas_Font_Width Evas_Font_Width;
typedef enum _Evas_Font_Spacing Evas_Font_Spacing;
/* General types - used for script type chceking */
#define OPAQUE_TYPE(type) struct __##type { int a; }; \
typedef struct __##type type
@ -1281,50 +1217,6 @@ struct _Evas_Data_Node
void *data;
};
struct _Evas_Font_Dir
{
Eina_Hash *lookup;
Eina_List *fonts;
Eina_List *aliases;
DATA64 dir_mod_time;
DATA64 fonts_dir_mod_time;
DATA64 fonts_alias_mod_time;
};
struct _Evas_Font
{
struct {
const char *prop[14];
} x;
struct {
const char *name;
} simple;
const char *path;
char type;
};
struct _Evas_Font_Alias
{
const char *alias;
Evas_Font *fn;
};
struct _Evas_Font_Description
{
int ref;
Eina_Stringshare *name;
Eina_Stringshare *fallbacks;
Eina_Stringshare *lang;
Eina_Stringshare *style;
Evas_Font_Slant slant;
Evas_Font_Weight weight;
Evas_Font_Width width;
Evas_Font_Spacing spacing;
Eina_Bool is_new : 1;
};
struct _Efl_Canvas_Output
{
Eo *canvas;
@ -1703,7 +1595,7 @@ void evas_debug_generic(const char *str);
const char *evas_debug_magic_string_get(DATA32 magic);
void evas_render_update_del(Evas_Public_Data *e, int x, int y, int w, int h);
void evas_render_object_render_cache_free(Evas_Object *eo_obj, void *data);
void evas_object_smart_use(Evas_Smart *s);
void evas_object_smart_unuse(Evas_Smart *s);
void evas_smart_cb_descriptions_fix(Evas_Smart_Cb_Description_Array *a) EINA_ARG_NONNULL(1);
@ -1764,23 +1656,6 @@ void evas_object_inform_call_image_resize(Evas_Object *obj);
void evas_object_intercept_cleanup(Evas_Object *obj);
void evas_object_grabs_cleanup(Evas_Object *obj, Evas_Object_Protected_Data *pd);
void evas_key_grab_free(Evas_Object *obj, Evas_Object_Protected_Data *pd, const char *keyname, Evas_Modifier_Mask modifiers, Evas_Modifier_Mask not_modifiers);
void evas_font_dir_cache_free(void);
const char *evas_font_dir_cache_find(char *dir, char *font);
Eina_List *evas_font_dir_available_list(const Evas* evas);
void evas_font_dir_available_list_free(Eina_List *available);
void evas_font_free(Evas *evas, void *font);
void evas_fonts_zero_free(Evas *evas);
void evas_fonts_zero_pressure(Evas *evas);
void evas_font_name_parse(Evas_Font_Description *fdesc, const char *name);
int evas_font_style_find(const char *start, const char *end, Evas_Font_Style style);
Evas_Font_Description *evas_font_desc_new(void);
Evas_Font_Description *evas_font_desc_dup(const Evas_Font_Description *fdesc);
void evas_font_desc_unref(Evas_Font_Description *fdesc);
int evas_font_desc_cmp(const Evas_Font_Description *a, const Evas_Font_Description *b);
Evas_Font_Description *evas_font_desc_ref(Evas_Font_Description *fdesc);
const char *evas_font_lang_normalize(const char *lang);
void * evas_font_load(Evas *evas, Evas_Font_Description *fdesc, const char *source, Evas_Font_Size size, Efl_Text_Font_Bitmap_Scalable bitmap_scalable);
void evas_font_load_hinting_set(Evas *evas, void *font, int hinting);
void evas_object_smart_member_cache_invalidate(Evas_Object *obj, Eina_Bool pass_events, Eina_Bool freeze_events, Eina_Bool sourve_invisible);
void evas_text_style_pad_get(Evas_Text_Style_Type style, int *l, int *r, int *t, int *b);
void _evas_object_text_rehint(Evas_Object *obj);