--font-render-mode is back, and there is also
[rrdtool.git] / src / rrd_graph_helper.c
index 0c1c7d8..708c223 100644 (file)
@@ -266,7 +266,7 @@ int rrd_parse_color(
     default:
         return 1;       /* wrong number of digits */
     }
-    gdp->col = r << 24 | g << 16 | b << 8 | a;
+    gdp->col = gfx_hex_to_col(r << 24 | g << 16 | b << 8 | a);
     return 0;
 }
 
@@ -497,23 +497,22 @@ int rrd_parse_PVHLAST(
     static int spacecnt = 0;
 
     if (spacecnt == 0) {
-        float     one_space = gfx_get_text_width(im->canvas, 0,
+        float     one_space = gfx_get_text_width(im, 0,
                                                  im->
                                                  text_prop[TEXT_PROP_LEGEND].
                                                  font,
                                                  im->
                                                  text_prop[TEXT_PROP_LEGEND].
                                                  size,
-                                                 im->tabwidth, "    ",
-                                                 0) / 4.0;
-        float     target_space = gfx_get_text_width(im->canvas, 0,
+                                                 im->tabwidth, "    ") / 4.0;
+        float     target_space = gfx_get_text_width(im, 0,
                                                     im->
                                                     text_prop
                                                     [TEXT_PROP_LEGEND].font,
                                                     im->
                                                     text_prop
                                                     [TEXT_PROP_LEGEND].size,
-                                                    im->tabwidth, "oo", 0);
+                                                    im->tabwidth, "oo");
 
         spacecnt = target_space / one_space;
         dprintf("- spacecnt: %i onespace: %f targspace: %f\n", spacecnt,
@@ -607,7 +606,8 @@ int rrd_parse_PVHLAST(
             rrd_set_error("Could not parse color in '%s'", &tmpstr[j]);
             return 1;
         }
-        dprintf("- parsed color 0x%08x\n", (unsigned int) gdp->col);
+        dprintf("- parsed color %0.0f,%0.0f,%0.0f,%0.0f\n", gdp->col.red,
+                gdp->col.green, gdp->col.blue, gdp->col.alpha);
         colorfound = 1;
     } else {
         dprintf("- no color present in '%s'\n", tmpstr);
@@ -1029,7 +1029,7 @@ void rrd_graph_script(
             break;
         }
         if (gdp->debug) {
-            dprintf("used %i out of %i chars\n", eaten, strlen(argv[i]));
+            dprintf("used %i out of %zi chars\n", eaten, strlen(argv[i]));
             dprintf("parsed line: '%s'\n", argv[i]);
             dprintf("remaining: '%s'\n", &argv[i][eaten]);
             if (eaten >= strlen(argv[i]))