changeset 32804:b0df43398401

Allow equals sign to be defined in the font description file.
author ib
date Fri, 11 Feb 2011 16:30:35 +0000
parents fff5aa81d90e
children 5b8cac96cec9
files gui/skin/font.c
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/gui/skin/font.c	Fri Feb 11 14:43:28 2011 +0000
+++ b/gui/skin/font.c	Fri Feb 11 16:30:35 2011 +0000
@@ -68,7 +68,7 @@
  unsigned char * ptmp;
  unsigned char   command[32];
  unsigned char   param[256];
- int             id = fntAddNewFont( fname );
+ int             id = fntAddNewFont( fname ), n;
 
  if ( id < 0 ) return id;
 
@@ -92,13 +92,15 @@
      if (ptmp != tmp + 1 || tmp[0] != '"' || tmp[2] != '"') *ptmp = '\0';
    }
    if (!*tmp) continue;
-   cutItem( tmp,command,'=',0 ); cutItem( tmp,param,'=',1 );
+   n = (strncmp(tmp, "\"=", 2) == 0 ? 1 : 0);
+   cutItem( tmp,command,'=',n ); cutItem( tmp,param,'=',n+1 );
    if ( command[0] == '"' )
     {
      int i;
-     cutItem( command,command,'"',1 );
-     if ( !command[0] ) i='"';
-     else if ( command[0] & 0x80 )
+     if (!command[1]) command[0] = '=';
+     else if (command[1] == '"') command[1] = '\0';
+     else cutItem(command, command, '"', 1);
+     if ( command[0] & 0x80 )
       {
        for ( i = 0; i < EXTRA_CHRS; i++ )
         {