summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2629cca)
raw | patch | inline | side by side (parent: 2629cca)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Thu, 11 Sep 2008 20:27:47 +0000 (20:27 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Thu, 11 Sep 2008 20:27:47 +0000 (20:27 +0000) |
program/src/rrd_graph.c | patch | blob | history |
index 08d0815d0bd5235bb9684f954f924078a87c64ea..cb0627cc5febc5bf8bab5a7250c9524d48c2b773 100644 (file)
--- a/program/src/rrd_graph.c
+++ b/program/src/rrd_graph.c
static void
rrd_set_font_desc (
image_desc_t *im,int prop,char *font, double size ){
- strncpy(im->text_prop[prop].font, font, sizeof(text_prop[prop].font) - 1);
- im->text_prop[prop].font[sizeof(text_prop[prop].font) - 1] = '\0';
- im->text_prop[prop].size = size;
- im->text_prop[prop].font_desc = pango_font_description_from_string( font );
- pango_font_description_set_size(im->text_prop[prop].font_desc, size * PANGO_SCALE);
+ if (font){
+ strncpy(im->text_prop[prop].font, font, sizeof(text_prop[prop].font) - 1);
+ im->text_prop[prop].font[sizeof(text_prop[prop].font) - 1] = '\0';
+ im->text_prop[prop].font_desc = pango_font_description_from_string( font );
+ };
+ if (size > 0){
+ im->text_prop[prop].size = size;
+ };
+ if (im->text_prop[prop].font_desc && im->text_prop[prop].size ){
+ pango_font_description_set_size(im->text_prop[prop].font_desc, im->text_prop[prop].size * PANGO_SCALE);
+ };
}
void rrd_graph_init(