long i;
long tab_count = strlen(text);
long tab_shift = fmod(x, tabwidth);
+ int border = im->text_prop[TEXT_PROP_LEGEND].size * 2.0;
PangoTabArray *tab_array;
PangoContext *pango_context;
tab_array = pango_tab_array_new(tab_count, (gboolean) (1));
for (i = 1; i <= tab_count; i++) {
pango_tab_array_set_tab(tab_array,
- i, PANGO_TAB_LEFT, tabwidth * i - tab_shift);
+ i, PANGO_TAB_LEFT, tabwidth * i - tab_shift+border);
}
cairo_new_path(cr);
cairo_set_source_rgba(cr, color.red, color.green, color.blue,
PangoLayout *layout;
PangoRectangle log_rect;
gfx_color_t color = { 0, 0, 0, 0 };
- char *tab;
-
- /* turn \\t into tab */
- while ((tab = strstr(text, "\\t"))) {
- memmove(tab + 1, tab + 2, strlen(tab + 2));
- tab[0] = (char) 9;
- }
layout = gfx_prep_text(im, start, color, font, size, tabwidth, text);
pango_layout_get_pixel_extents(layout, NULL, &log_rect);
pango_tab_array_free(pango_layout_get_tabs(layout));
char prt_fctn; /*special printfunctions */
char default_txtalign = TXA_JUSTIFIED; /*default line orientation */
int *legspace;
+ char *tab;
if (!(im->extra_flags & NOLEGEND) & !(im->extra_flags & ONLY_GRAPH)) {
if ((legspace = malloc(im->gdes_c * sizeof(int))) == NULL) {
im->gdes[i].legend[0] = '\0';
}
+ /* turn \\t into tab */
+ while ((tab = strstr(im->gdes[i].legend, "\\t"))) {
+ memmove(tab, tab + 1, strlen(tab));
+ tab[0] = (char) 9;
+ }
leg_cc = strlen(im->gdes[i].legend);
/* is there a controle code ant the end of the legend string ? */
- /* and it is not a tab \\t */
if (leg_cc >= 2
&& im->gdes[i].legend[leg_cc -
- 2] == '\\'
- && im->gdes[i].legend[leg_cc - 1] != 't') {
+ 2] == '\\' ) {
prt_fctn = im->gdes[i].legend[leg_cc - 1];
leg_cc -= 2;
im->gdes[i].legend[leg_cc] = '\0';
prt_fctn != 'j' &&
prt_fctn != 'c' &&
prt_fctn != 's' &&
- prt_fctn != 't' && prt_fctn != '\0' && prt_fctn != 'g') {
+ prt_fctn != '\0' && prt_fctn != 'g') {
free(legspace);
rrd_set_error
("Unknown control code at the end of '%s\\%c'",
"\t\t[-M|--alt-autoscale-max]\n"
"\t\t[-R|--font-render-mode {normal,light,mono}]\n"
"\t\t[-B|--font-smoothing-threshold size]\n"
+ "\t\t[-T|--tabwidth width]\n"
"\t\t[-E|--slope-mode]\n"
"\t\t[-N|--no-gridfit]\n"
"\t\t[-X|--units-exponent value]\n"