From 422d9358bf1a0be3860d12aa65b3de29e1f5f1fb Mon Sep 17 00:00:00 2001 From: Tom Hacohen Date: Sun, 29 May 2011 11:09:47 +0000 Subject: [PATCH] Evas font-engine: Conform to the API changes in Harfbuzz 0.6.0. SVN revision: 59779 --- legacy/evas/ChangeLog | 4 ++++ legacy/evas/configure.ac | 2 +- .../src/lib/engines/common/evas_font_ot.c | 23 ++++++++----------- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/legacy/evas/ChangeLog b/legacy/evas/ChangeLog index 99cf108f18..a30666678a 100644 --- a/legacy/evas/ChangeLog +++ b/legacy/evas/ChangeLog @@ -376,3 +376,7 @@ * Font-engine: Fixed a bug in glyph search causing inconsistent return values. The found fi should always be NULL if there was no fi found. +2011-05-29 Tom Hacohen (TAsn) + + * Font-engine: Conform to the API changes in Harfbuzz 0.6.0 + diff --git a/legacy/evas/configure.ac b/legacy/evas/configure.ac index ce90b98ed8..720e87454c 100644 --- a/legacy/evas/configure.ac +++ b/legacy/evas/configure.ac @@ -351,7 +351,7 @@ AC_ARG_ENABLE([harfbuzz], if test "x${want_harfbuzz}" = "xyes" -o "x${want_harfbuzz}" = "xauto" ; then PKG_CHECK_MODULES([HARFBUZZ], - [harfbuzz >= 0.5.0], + [harfbuzz >= 0.6.0], [ have_harfbuzz="yes" requirement_evas="harfbuzz ${requirement_evas}" diff --git a/legacy/evas/src/lib/engines/common/evas_font_ot.c b/legacy/evas/src/lib/engines/common/evas_font_ot.c index fe704a36fd..7fb9d081d8 100644 --- a/legacy/evas/src/lib/engines/common/evas_font_ot.c +++ b/legacy/evas/src/lib/engines/common/evas_font_ot.c @@ -180,10 +180,9 @@ evas_common_font_ot_cluster_size_get(const Evas_Text_Props *props, size_t char_i /* Harfbuzz font functions */ -static void +static hb_position_t _evas_common_font_ot_hb_get_glyph_advance(hb_font_t *font, void *font_data, hb_codepoint_t glyph, - hb_position_t *x_advance, hb_position_t *y_advance, void *user_data) { /* Use our cache*/ @@ -194,25 +193,23 @@ _evas_common_font_ot_hb_get_glyph_advance(hb_font_t *font, fg = evas_common_font_int_cache_glyph_get(fi, glyph); if (fg) { - *x_advance = fg->glyph->advance.x >> 10; - *y_advance = fg->glyph->advance.y >> 10; + return fg->glyph->advance.x >> 10; } + return 0; } -static void +static hb_position_t _evas_common_font_ot_hb_get_kerning(hb_font_t *font, void *font_data, - hb_codepoint_t first_glyph, hb_codepoint_t second_glyph, - hb_position_t *x_kern, hb_position_t *y_kern, void *user_data) + hb_codepoint_t first_glyph, hb_codepoint_t second_glyph, void *user_data) { RGBA_Font_Int *fi = (RGBA_Font_Int *) font_data; int kern; (void) font; (void) user_data; if (evas_common_font_query_kerning(fi, first_glyph, second_glyph, &kern)) - *x_kern = kern; - else - return; - *y_kern = 0; + return kern; + + return 0; } /* End of harfbuzz font funcs */ @@ -224,9 +221,9 @@ _evas_common_font_ot_font_funcs_get(void) if (!font_funcs) { font_funcs = hb_font_funcs_create(); - hb_font_funcs_set_glyph_advance_func(font_funcs, + hb_font_funcs_set_glyph_h_advance_func(font_funcs, _evas_common_font_ot_hb_get_glyph_advance, NULL, NULL); - hb_font_funcs_set_kerning_func(font_funcs, + hb_font_funcs_set_glyph_h_kerning_func(font_funcs, _evas_common_font_ot_hb_get_kerning, NULL, NULL); }