summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 032d03e)
raw | patch | inline | side by side (parent: 032d03e)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Sun, 18 May 2008 22:11:56 +0000 (22:11 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Sun, 18 May 2008 22:11:56 +0000 (22:11 +0000) |
* fix \t -> tab expansion
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk@1371 a5681a0c-68f1-0310-ab6d-d61299d08faa
git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk@1371 a5681a0c-68f1-0310-ab6d-d61299d08faa
program/src/rrd_gfx.c | patch | blob | history | |
program/src/rrd_graph.c | patch | blob | history | |
program/src/rrd_tool.c | patch | blob | history |
diff --git a/program/src/rrd_gfx.c b/program/src/rrd_gfx.c
index 7ba93ca79400a4211e7c97aee9c843dfe47ee57f..5e5072d2e366128423636d729f19ba2e1e38145b 100644 (file)
--- a/program/src/rrd_gfx.c
+++ b/program/src/rrd_gfx.c
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));
index a0e3ddc3501ee4510f750bc21c90d2332ecd8c26..eae4c3db1618923b866f591e97fd81ff758d6c74 100644 (file)
--- a/program/src/rrd_graph.c
+++ b/program/src/rrd_graph.c
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'",
diff --git a/program/src/rrd_tool.c b/program/src/rrd_tool.c
index b594a5f491d6b52c5745fe3c2b60d28fb74e8e31..169631c110606c0ae33274b46ae9da4e4f0281f4 100644 (file)
--- a/program/src/rrd_tool.c
+++ b/program/src/rrd_tool.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"