[GRASS-SVN] r36389 - grass/trunk/lib/driver

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Mar 16 04:04:41 EDT 2009


Author: hcho
Date: 2009-03-16 04:04:41 -0400 (Mon, 16 Mar 2009)
New Revision: 36389

Modified:
   grass/trunk/lib/driver/Font.c
   grass/trunk/lib/driver/parse_ftcap.c
Log:
Fixed fontcap entry parsing: allows an empty path for GFONT_DRIVER type fonts.
Fixed the bug where R_font was not able to set GFONT_DRIVER fonts.


Modified: grass/trunk/lib/driver/Font.c
===================================================================
--- grass/trunk/lib/driver/Font.c	2009-03-16 04:53:09 UTC (rev 36388)
+++ grass/trunk/lib/driver/Font.c	2009-03-16 08:04:41 UTC (rev 36389)
@@ -109,11 +109,11 @@
     }
 
 
-    if (driver->Font_list && driver->Set_font) {
+    if (driver->Font_info && driver->Set_font) {
 	char **list = NULL;
 	int count = 0;
 
-	(*driver->Font_list)(&list, &count);
+	(*driver->Font_info)(&list, &count);
 
 	for (i = 0; i < count; i++) {
 	    struct GFONT_CAP cap;

Modified: grass/trunk/lib/driver/parse_ftcap.c
===================================================================
--- grass/trunk/lib/driver/parse_ftcap.c	2009-03-16 04:53:09 UTC (rev 36388)
+++ grass/trunk/lib/driver/parse_ftcap.c	2009-03-16 08:04:41 UTC (rev 36389)
@@ -18,12 +18,17 @@
     int type, index;
 
     if (sscanf(str, "%[^|]|%[^|]|%d|%[^|]|%d|%[^|]|",
-	       name, longname, &type, path, &index, encoding) != 6)
+	       name, longname, &type, path, &index, encoding) == 6) {
+        if (!font_exists(path))
+	    return 0;
+    }
+    /* GFONT_DRIVER type fonts do not have path. */
+    else if (sscanf(str, "%[^|]|%[^|]|%d||%d|%[^|]|",
+	       name, longname, &type, &index, encoding) == 5)
+	path[0] = '\0';
+    else
 	return 0;
 
-    if (!font_exists(path))
-	return 0;
-
     e->name = G_store(name);
     e->longname = G_store(longname);
     e->type = type;



More information about the grass-commit mailing list