From 960785eafb7934d77371d6e41e182e6285613921 Mon Sep 17 00:00:00 2001 From: Miguel Freitas Date: Mon, 18 Apr 2005 14:06:29 +0000 Subject: try to be friendly to older ft2 releases CVS patchset: 7461 CVS date: 2005/04/18 14:06:29 --- src/xine-engine/osd.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/xine-engine/osd.c b/src/xine-engine/osd.c index aec55cd14..f5169a966 100644 --- a/src/xine-engine/osd.c +++ b/src/xine-engine/osd.c @@ -89,6 +89,15 @@ #endif #define MIN(a,b) ( (a) < (b) ) ? (a) : (b) + +#if (FREETYPE_MAJOR > 2) || \ + (FREETYPE_MAJOR == 2 && FREETYPE_MINOR > 1) || \ + (FREETYPE_MAJOR == 2 && FREETYPE_MINOR == 1 && FREETYPE_PATCH >= 3) +# define KERNING_DEFAULT FT_KERNING_DEFAULT +#else +# define KERNING_DEFAULT ft_kerning_default +#endif + typedef struct osd_fontchar_s { uint16_t code; uint16_t width; @@ -1052,7 +1061,7 @@ static int osd_render_text (osd_object_t *osd, int x1, int y1, /* add kerning relative to the previous letter */ if (use_kerning && previous && i) { FT_Vector delta; - FT_Get_Kerning(osd->ft2->face, previous, i, FT_KERNING_DEFAULT, &delta); + FT_Get_Kerning(osd->ft2->face, previous, i, KERNING_DEFAULT, &delta); x1 += delta.x / 64; } previous = i; @@ -1218,7 +1227,7 @@ static int osd_get_text_size(osd_object_t *osd, const char *text, int *width, in /* kerning add the relative to the previous letter */ if (use_kerning && previous && i) { FT_Vector delta; - FT_Get_Kerning(osd->ft2->face, previous, i, FT_KERNING_DEFAULT, &delta); + FT_Get_Kerning(osd->ft2->face, previous, i, KERNING_DEFAULT, &delta); *width += delta.x / 64; } previous = i; -- cgit v1.2.3