From 46d91559a96d72d38741473294fee04f68d36cd8 Mon Sep 17 00:00:00 2001 From: Stefan Holst Date: Wed, 27 Jul 2005 23:46:34 +0000 Subject: ft2 patch by Andrei Lahun: fix spacing and hinting CVS patchset: 7691 CVS date: 2005/07/27 23:46:34 --- src/xine-engine/osd.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/xine-engine/osd.c b/src/xine-engine/osd.c index f5169a966..745069570 100644 --- a/src/xine-engine/osd.c +++ b/src/xine-engine/osd.c @@ -1066,7 +1066,7 @@ static int osd_render_text (osd_object_t *osd, int x1, int y1, } previous = i; - if (FT_Load_Glyph(osd->ft2->face, i, FT_LOAD_DEFAULT)) { + if (FT_Load_Glyph(osd->ft2->face, i, FT_LOAD_DEFAULT | FT_LOAD_NO_HINTING)) { xprintf(this->stream->xine, XINE_VERBOSITY_LOG, _("osd: error loading glyph\n")); continue; } @@ -1232,7 +1232,7 @@ static int osd_get_text_size(osd_object_t *osd, const char *text, int *width, in } previous = i; - if (FT_Load_Glyph(osd->ft2->face, i, FT_LOAD_DEFAULT)) { + if (FT_Load_Glyph(osd->ft2->face, i, FT_LOAD_DEFAULT | FT_LOAD_NO_HINTING)) { xprintf(this->stream->xine, XINE_VERBOSITY_LOG, _("osd: error loading glyph %i\n"), i); text++; continue; @@ -1273,7 +1273,8 @@ static int osd_get_text_size(osd_object_t *osd, const char *text, int *width, in * to also add the left bearing because the letter might be shifted left or * right and then the right edge is also shifted */ - *width -= osd->ft2->face->glyph->advance.x / 64; + if (osd->ft2->face->glyph->bitmap.width) + *width -= osd->ft2->face->glyph->advance.x / 64; *width += osd->ft2->face->glyph->bitmap.width; *width += osd->ft2->face->glyph->bitmap_left; *height = osd->ft2->face->size->metrics.height / 64; -- cgit v1.2.3