changeset 32792:31ce0bd110d5

Only replace non-existing font character by space if space itself exists.
author ib
date Thu, 10 Feb 2011 13:50:28 +0000
parents ece4313fbf15
children 0adeebe4e561
files gui/skin/font.c
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/gui/skin/font.c	Thu Feb 10 13:26:18 2011 +0000
+++ b/gui/skin/font.c	Thu Feb 10 13:50:28 2011 +0000
@@ -196,7 +196,7 @@
   {
    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 @@
 
    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 @@
 
      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;