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

ib subversion at mplayerhq.hu
Thu Feb 10 14:50:29 CET 2011


Author: ib
Date: Thu Feb 10 14:50:28 2011
New Revision: 32879

Log:
Only replace non-existing font character by space if space itself exists.

Modified:
   trunk/gui/skin/font.c

Modified: trunk/gui/skin/font.c
==============================================================================
--- trunk/gui/skin/font.c	Thu Feb 10 14:26:18 2011	(r32878)
+++ trunk/gui/skin/font.c	Thu Feb 10 14:50:28 2011	(r32879)
@@ -196,7 +196,7 @@ int fntTextWidth( int id,char * str )
   {
    int c = fntGetCharIndex( id, &p, utf8, 1 );
    if ( c == -1 || Fonts[id]->Fnt[c].sx == -1 ) c = ' ';
-   size+= Fonts[id]->Fnt[ c ].sx;
+   if ( Fonts[id]->Fnt[c].sx != -1 ) size += Fonts[id]->Fnt[c].sx;
   }
  return size;
 }
@@ -278,6 +278,8 @@ txSample * fntRender( wItem * item,int p
 
    if ( c == -1 || fw == -1 ) { c=' '; fw=Fonts[id]->Fnt[c].sx; }
 
+   if ( fw == -1 ) continue;
+
    fh=Fonts[id]->Fnt[c].sy;
    fyc=Fonts[id]->Fnt[c].y * fbw + Fonts[id]->Fnt[c].x;
    yc=dx;
@@ -306,6 +308,8 @@ txSample * fntRender( wItem * item,int p
 
      if ( c == -1 || fw == -1 ) { c=' '; fw=Fonts[id]->Fnt[c].sx; }
 
+     if ( fw == -1 ) continue;
+
      fh=Fonts[id]->Fnt[c].sy;
      fyc=Fonts[id]->Fnt[c].y * fbw + Fonts[id]->Fnt[c].x;
 


More information about the MPlayer-cvslog mailing list