[MPlayer-cvslog] r32896 - trunk/gui/skin/font.c

ib subversion at mplayerhq.hu
Sat Feb 12 23:15:18 CET 2011


Author: ib
Date: Sat Feb 12 23:15:18 2011
New Revision: 32896

Log:
Allow font characters varying in height.

Modified:
   trunk/gui/skin/font.c

Modified: trunk/gui/skin/font.c
==============================================================================
--- trunk/gui/skin/font.c	Sat Feb 12 17:52:23 2011	(r32895)
+++ trunk/gui/skin/font.c	Sat Feb 12 23:15:18 2011	(r32896)
@@ -237,7 +237,7 @@ int fntTextHeight( int id,char * str )
 txSample * fntRender( wItem * item,int px,char * txt )
 {
  unsigned char * u;
- int 	         c, i, dx = 0, tw, fbw, iw, id, ofs;
+ int 	         c, i, dx = 0, tw, th, fbw, iw, id, ofs;
  int 		 x,y,fh,fw,fyc,yc;
  uint32_t      * ibuf;
  uint32_t      * obuf;
@@ -250,10 +250,17 @@ txSample * fntRender( wItem * item,int p
 
  iw=item->width;
  fbw=Fonts[id]->Bitmap.Width;
+ th=fntTextHeight(id, txt);
+
+ if (item->Bitmap.Image && (item->height != th))
+ {
+   free(item->Bitmap.Image);
+   item->Bitmap.Image = NULL;
+ }
 
  if ( item->Bitmap.Image == NULL )
   {
-   item->Bitmap.Height=item->height=fntTextHeight( id,txt );
+   item->Bitmap.Height=item->height=th;
    item->Bitmap.Width=item->width=iw;
    item->Bitmap.ImageSize=item->height * iw * 4;
    if ( !item->Bitmap.ImageSize ) return NULL;


More information about the MPlayer-cvslog mailing list