Evas font-engine: Fix font size updating.

This commit fixes two types of misupdate of the font size.
1. Not updating all the fonts when not using Harfbuzz.
2. In rare cases update the wrong font when using Harfbuzz.

SVN revision: 58114
This commit is contained in:
Tom Hacohen 2011-03-27 12:22:13 +00:00
parent 9093a47081
commit 6c29ea29fb
1 changed files with 33 additions and 9 deletions

View File

@ -500,15 +500,6 @@ evas_common_font_draw_internal(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Font
(void) use_kerning;
#endif
if (fi->src->current_size != fi->size)
{
FTLOCK();
FT_Activate_Size(fi->ft.size);
FTUNLOCK();
fi->src->current_size = fi->size;
}
im = dst->image.data;
/* Load the glyph according to the first letter of the script, preety
* bad, but will have to do */
@ -524,6 +515,15 @@ evas_common_font_draw_internal(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Font
if (!*tmp && (tmp > text)) tmp--;
evas_common_font_glyph_search(fn, &fi, *tmp);
}
if (fi->src->current_size != fi->size)
{
FTLOCK();
FT_Activate_Size(fi->ft.size);
FTUNLOCK();
fi->src->current_size = fi->size;
}
EVAS_FONT_WALK_TEXT_VISUAL_START()
{
FT_UInt index;
@ -538,6 +538,14 @@ evas_common_font_draw_internal(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Font
* the use of harfbuzz */
index =
evas_common_font_glyph_search(fn, &fi, text[EVAS_FONT_WALK_POS]);
if (fi->src->current_size != fi->size)
{
FTLOCK();
FT_Activate_Size(fi->ft.size);
FTUNLOCK();
fi->src->current_size = fi->size;
}
#endif
LKL(fi->ft_mutex);
fg = evas_common_font_int_cache_glyph_get(fi, index);
@ -828,6 +836,14 @@ evas_font_word_prerender(RGBA_Draw_Context *dc, const Eina_Unicode *in_text, con
evas_common_font_glyph_search(fn, &fi, *tmp);
}
if (fi->src->current_size != fi->size)
{
FTLOCK();
FT_Activate_Size(fi->ft.size);
FTUNLOCK();
fi->src->current_size = fi->size;
}
/* First pass: Work out how big and populate */
/* It's a bit hackish to use index and fg here as they are internal,
* but that'll have to be good enough ATM */
@ -845,6 +861,14 @@ evas_font_word_prerender(RGBA_Draw_Context *dc, const Eina_Unicode *in_text, con
* the use of harfbuzz */
index =
evas_common_font_glyph_search(fn, &fi, text[EVAS_FONT_WALK_POS]);
if (fi->src->current_size != fi->size)
{
FTLOCK();
FT_Activate_Size(fi->ft.size);
FTUNLOCK();
fi->src->current_size = fi->size;
}
#endif
LKL(fi->ft_mutex);
fg = evas_common_font_int_cache_glyph_get(fi, index);