summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerome <jlacvdr@jlac.dyndns.org>2009-05-16 12:40:36 +0200
committerThomas Günther <tom@toms-cafe.de>2009-05-16 12:40:36 +0200
commit994378e31383f1d91f63f5af8ac31b9a0aef8b9f (patch)
treeffff1cc352a8a1f1135646a9ef508d78a97cf2ad
parent371d910a0f31585797c1c7521a50f1945fe1d8d9 (diff)
downloadvdr-plugin-text2skin-994378e31383f1d91f63f5af8ac31b9a0aef8b9f.tar.gz
vdr-plugin-text2skin-994378e31383f1d91f63f5af8ac31b9a0aef8b9f.tar.bz2
Fix font problems with libfreetype6 >= 2.2.1
(patch by Jerome <jlacvdr@jlac.dyndns.org>)
-rw-r--r--graphtft/font.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/graphtft/font.c b/graphtft/font.c
index 4eb666c..d61a4b3 100644
--- a/graphtft/font.c
+++ b/graphtft/font.c
@@ -139,21 +139,22 @@ bool cGraphtftFont::Load(string Filename, string CacheName, int Size, int Langua
//Load the char
error = FT_Load_Glyph( _face, glyph_index, FT_LOAD_DEFAULT );
if ( error ) continue; /* ignore errors */
-
- // convert to a mono bitmap
- error = FT_Render_Glyph( _face->glyph, ft_render_mode_mono );
- if ( error ) continue;
-
+
// now, convert to vdr font data
int width = (_slot->metrics.horiAdvance / 64) + 1;
int bearingX = (_slot->metrics.horiBearingX / 64) +1;
width = (width > (int)sizeof(cFont::tPixelData) * 8) ? (((int)sizeof(cFont::tPixelData) * 8)-2) :width ;
- int top = _slot->bitmap_top;
- int y_off = Size - top;
font_data[(num_char_array*num_rows)+0]=width;
font_data[(num_char_array*num_rows)+1]=num_rows_global;
+ // convert to a mono bitmap
+ error = FT_Render_Glyph( _face->glyph, ft_render_mode_mono );
+ if ( error ) continue;
+
+ int top = _slot->bitmap_top;
+ int y_off = Size - top;
+
unsigned char *bmp = _slot->bitmap.buffer;
for (int y = 0; y < _slot->bitmap.rows; ++y , y_off++) {