Zoom the graphics by the given amount. The factor must be E<gt> 0
-[B<-n>|B<--font> I<FONTTAG>B<:>I<size>B<:>I<font>]
+[B<-n>|B<--font> I<FONTTAG>B<:>I<size>B<:>[I<font>]]
This lets you customize which font to use for the various text
elements on the RRD graphs. C<DEFAULT> sets the default value for all
Use Times for the title: C<--font TITLE:13:/usr/lib/fonts/times.ttf>
+If you do not give a font string you can modify just the sice of the default font:
+C<--font TITLE:13:>.
+
+If you specify the size 0 then you can modify just the font without touching
+the size. This is especially usefull for altering the default font without
+resetting the default fontsizes: C<--font DEFAULT:0:/usr/lib/fonts/times.ttf>.
+
RRDtool comes with a preset default font. You can set the environment
variable C<RRD_DEFAULT_FONT> if you want to change this.
if(sscanf(optarg,
"%10[A-Z]:%lf:%1000s",
prop,&size,font) == 3){
- int sindex;
+ int sindex,propidx;
if((sindex=text_prop_conv(prop)) != -1){
- im->text_prop[sindex].size=size;
- strcpy(im->text_prop[sindex].font,font);
- if (sindex==0) { /* the default */
- im->text_prop[TEXT_PROP_TITLE].size=size;
- strcpy(im->text_prop[TEXT_PROP_TITLE].font,font);
- im->text_prop[TEXT_PROP_AXIS].size=size;
- strcpy(im->text_prop[TEXT_PROP_AXIS].font,font);
- im->text_prop[TEXT_PROP_UNIT].size=size;
- strcpy(im->text_prop[TEXT_PROP_UNIT].font,font);
- im->text_prop[TEXT_PROP_LEGEND].size=size;
- strcpy(im->text_prop[TEXT_PROP_LEGEND].font,font);
- }
+ for (propidx=sindex;propidx<TEXT_PROP_LAST;propidx++){
+ if (size > 0){
+ im->text_prop[propidx].size=size;
+ }
+ if (strlen(font) > 0){
+ strcpy(im->text_prop[propidx].font,font);
+ }
+ if (propidx==sindex && sindex != 0) break;
+ }
} else {
rrd_set_error("invalid fonttag '%s'",prop);
return;