forked from enlightenment/efl
missed a size_use() call that would have screwed up some font queries... and
i've disabled font face (font source) instance sharing - it will load one per size again due to performance reasons. i need to tackle this with the ft2 guys and see if theres an acceptible solution. i COULD shadow all the glyph and font metric data i use myself per size - thats fine... EXCEPT for kerning - thats the thing i can't sanely (figure out how to) shadow myself... if someone figures that out for me! be my guest! :) let me know! SVN revision: 8634
This commit is contained in:
parent
329fcd6494
commit
9f24ecb043
|
@ -2046,10 +2046,10 @@ setup(void)
|
||||||
int iw, ih;
|
int iw, ih;
|
||||||
|
|
||||||
evas_font_path_prepend(evas, FN);
|
evas_font_path_prepend(evas, FN);
|
||||||
// evas_image_cache_set(evas, 1024 * 1024);
|
evas_image_cache_set(evas, 2048 * 1024);
|
||||||
// evas_font_cache_set(evas, 256 * 1024);
|
evas_font_cache_set(evas, 1024 * 1024);
|
||||||
evas_image_cache_set(evas, 0);
|
// evas_image_cache_set(evas, 0);
|
||||||
evas_font_cache_set(evas, 0);
|
// evas_font_cache_set(evas, 0);
|
||||||
|
|
||||||
ob = evas_object_image_add(evas);
|
ob = evas_object_image_add(evas);
|
||||||
evas_object_image_file_set(ob, IM "backdrop.png", NULL);
|
evas_object_image_file_set(ob, IM "backdrop.png", NULL);
|
||||||
|
|
|
@ -104,6 +104,9 @@ evas_common_font_draw(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Font *fn, int
|
||||||
gl = evas_common_font_utf8_get_next((unsigned char *)text, &chr);
|
gl = evas_common_font_utf8_get_next((unsigned char *)text, &chr);
|
||||||
if (gl == 0) break;
|
if (gl == 0) break;
|
||||||
index = FT_Get_Char_Index(fn->src->ft.face, gl);
|
index = FT_Get_Char_Index(fn->src->ft.face, gl);
|
||||||
|
/* hmmm kerning means i can't sanely do my own cached metric tables! */
|
||||||
|
/* grrr - this means font face sharing is kinda... not an option if */
|
||||||
|
/* you want performance */
|
||||||
if ((use_kerning) && (prev_index) && (index))
|
if ((use_kerning) && (prev_index) && (index))
|
||||||
{
|
{
|
||||||
FT_Vector delta;
|
FT_Vector delta;
|
||||||
|
|
|
@ -77,7 +77,14 @@ RGBA_Font_Source *
|
||||||
evas_common_font_source_find(const char *name)
|
evas_common_font_source_find(const char *name)
|
||||||
{
|
{
|
||||||
Evas_Object_List *l;
|
Evas_Object_List *l;
|
||||||
|
|
||||||
|
#if 1
|
||||||
|
/* this effectively disables sharing out loaded outlines between */
|
||||||
|
/* multiple sizes of the same font. because FT_Set_Char_Size() needs */
|
||||||
|
/* to be called to update the fonts size output and caluclations */
|
||||||
|
/* for a different face size, but this can be SLOOOW */
|
||||||
|
return NULL;
|
||||||
|
#endif
|
||||||
if (!name) return NULL;
|
if (!name) return NULL;
|
||||||
for (l = fonts_src; l; l = l->next)
|
for (l = fonts_src; l; l = l->next)
|
||||||
{
|
{
|
||||||
|
@ -113,6 +120,7 @@ void
|
||||||
evas_common_font_size_use(RGBA_Font *fn)
|
evas_common_font_size_use(RGBA_Font *fn)
|
||||||
{
|
{
|
||||||
if (fn->src->current_size == fn->real_size) return;
|
if (fn->src->current_size == fn->real_size) return;
|
||||||
|
/* This call is evil and SLOW! */
|
||||||
FT_Set_Char_Size(fn->src->ft.face, 0, fn->real_size, 96, 96);
|
FT_Set_Char_Size(fn->src->ft.face, 0, fn->real_size, 96, 96);
|
||||||
fn->src->current_size = fn->real_size;
|
fn->src->current_size = fn->real_size;
|
||||||
}
|
}
|
||||||
|
@ -173,11 +181,11 @@ evas_common_font_load_init(RGBA_Font *fn)
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
fn->real_size = fn->size * 64;
|
fn->real_size = fn->size * 64;
|
||||||
error = FT_Set_Char_Size(fn->src->ft.face, 0, (fn->size * 64), 96, 96);
|
error = FT_Set_Char_Size(fn->src->ft.face, 0, fn->real_size, 96, 96);
|
||||||
if (error)
|
if (error)
|
||||||
{
|
{
|
||||||
error = FT_Set_Pixel_Sizes(fn->src->ft.face, 0, fn->size);
|
|
||||||
fn->real_size = fn->size;
|
fn->real_size = fn->size;
|
||||||
|
error = FT_Set_Pixel_Sizes(fn->src->ft.face, 0, fn->real_size);
|
||||||
}
|
}
|
||||||
if (error)
|
if (error)
|
||||||
{
|
{
|
||||||
|
@ -202,12 +210,12 @@ evas_common_font_load_init(RGBA_Font *fn)
|
||||||
}
|
}
|
||||||
if (d == 0) break;
|
if (d == 0) break;
|
||||||
}
|
}
|
||||||
error = FT_Set_Pixel_Sizes(fn->src->ft.face, chosen_width, chosen_size);
|
fn->real_size = chosen_size;
|
||||||
|
error = FT_Set_Pixel_Sizes(fn->src->ft.face, chosen_width, fn->real_size);
|
||||||
if (error)
|
if (error)
|
||||||
{
|
{
|
||||||
/* couldn't choose the size anyway... what now? */
|
/* couldn't choose the size anyway... what now? */
|
||||||
}
|
}
|
||||||
fn->real_size = chosen_size;
|
|
||||||
}
|
}
|
||||||
fn->src->current_size = fn->real_size;
|
fn->src->current_size = fn->real_size;
|
||||||
|
|
||||||
|
|
|
@ -34,6 +34,7 @@ evas_common_font_ascent_get(RGBA_Font *fn)
|
||||||
int val;
|
int val;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
evas_common_font_size_use(fn);
|
||||||
val = (int)fn->src->ft.face->ascender;
|
val = (int)fn->src->ft.face->ascender;
|
||||||
fn->src->ft.face->units_per_EM = 2048; /* nasy hack - need to have correct val */
|
fn->src->ft.face->units_per_EM = 2048; /* nasy hack - need to have correct val */
|
||||||
ret = (val * fn->src->ft.face->size->metrics.y_scale) / (fn->src->ft.face->units_per_EM * fn->src->ft.face->units_per_EM);
|
ret = (val * fn->src->ft.face->size->metrics.y_scale) / (fn->src->ft.face->units_per_EM * fn->src->ft.face->units_per_EM);
|
||||||
|
|
Loading…
Reference in New Issue