diff options
-rw-r--r-- | src/cmds.c | 1 | ||||
-rw-r--r-- | src/color.c | 5 | ||||
-rw-r--r-- | src/color.h | 1 | ||||
-rwxr-xr-x | src/doc | 3 | ||||
-rw-r--r-- | src/file.c | 1 | ||||
-rw-r--r-- | src/tui.c | 1 | ||||
-rw-r--r-- | src/xlsx.c | 4 |
7 files changed, 14 insertions, 2 deletions
@@ -400,6 +400,7 @@ void copyent(register struct ent * n, register struct ent * p, int dr, int dc, i n->ucolor->fg = p->ucolor->fg; n->ucolor->bg = p->ucolor->bg; n->ucolor->bold = p->ucolor->bold; + n->ucolor->italic = p->ucolor->italic; n->ucolor->dim = p->ucolor->dim; n->ucolor->reverse = p->ucolor->reverse; n->ucolor->standout = p->ucolor->standout; diff --git a/src/color.c b/src/color.c index 91632d2..cbbd0e6 100644 --- a/src/color.c +++ b/src/color.c @@ -86,6 +86,7 @@ void start_default_ucolors() { int i; for (i=0; i < N_INIT_PAIRS; i++) { ucolors[ i ].bold = 0; + ucolors[ i ].italic = 0; ucolors[ i ].dim = 0; ucolors[ i ].reverse = 0; ucolors[ i ].standout = 0; @@ -291,6 +292,7 @@ void chg_color(char * str) { ucolors[ type ].fg = atoi(get(d_colors_param, get(d, "fg"))); ucolors[ type ].bg = atoi(get(d_colors_param, get(d, "bg"))); if (((cl = get(d, "bold")) != NULL) && cl[0] != '\0') ucolors[ type ].bold = atoi(get(d, "bold")); + if (((cl = get(d, "italic")) != NULL) && cl[0] != '\0') ucolors[ type ].italic = atoi(get(d, "italic")); if (((cl = get(d, "dim")) != NULL) && cl[0] != '\0') ucolors[ type ].dim = atoi(get(d, "dim")); if (((cl = get(d, "reverse")) != NULL) && cl[0] != '\0') ucolors[ type ].reverse = atoi(get(d, "reverse")); if (((cl = get(d, "standout")) != NULL) && cl[0] != '\0') ucolors[ type ].standout = atoi(get(d, "standout")); @@ -372,6 +374,7 @@ void color_cell(int r, int c, int rf, int cf, char * str) { n->ucolor->fg = NONE_COLOR; n->ucolor->bg = NONE_COLOR; n->ucolor->bold = 0; + n->ucolor->italic = 0; n->ucolor->dim = 0; n->ucolor->reverse = 0; n->ucolor->standout = 0; @@ -386,6 +389,7 @@ void color_cell(int r, int c, int rf, int cf, char * str) { n->ucolor->fg = atoi(get(d_colors_param, get(d, "fg"))); if ((cl = get(d, "bold")) != NULL && cl[0] != '\0') n->ucolor->bold = atoi(get(d, "bold")); + if ((cl = get(d, "italic")) != NULL && cl[0] != '\0') n->ucolor->italic = atoi(get(d, "italic")); if ((cl = get(d, "dim") ) != NULL && cl[0] != '\0') n->ucolor->dim = atoi(get(d, "dim")); if ((cl = get(d, "reverse")) != NULL && cl[0] != '\0') n->ucolor->reverse = atoi(get(d, "reverse")); if ((cl = get(d, "standout")) != NULL && cl[0] != '\0') n->ucolor->standout = atoi(get(d, "standout")); @@ -486,6 +490,7 @@ int same_ucolor(struct ucolor * u, struct ucolor * v) { if (u->fg != v->fg) return 0; if (u->bg != v->bg) return 0; if (u->bold != v->bold) return 0; + if (u->italic != v->italic) return 0; if (u->dim != v->dim) return 0; if (u->reverse != v->reverse) return 0; if (u->standout != v->standout) return 0; diff --git a/src/color.h b/src/color.h index 151a9ce..4dc5b82 100644 --- a/src/color.h +++ b/src/color.h @@ -50,6 +50,7 @@ struct ucolor { int fg; int bg; int bold; + int italic; int dim; int reverse; int standout; @@ -728,7 +728,8 @@ Commands for handling cell content: Change a color definition. {key} is one of the following: - type, fg, bg, bold, dim, reverse, standout, underline, blink + type, fg, bg, bold, italic, dim, reverse, standout, underline, + blink Note: The type, fg, and bg keys are mandatory. The value of type shall be one of the following: @@ -411,6 +411,7 @@ void write_fd(register FILE *f, int r0, int c0, int rn, int cn) { } if ((*pp)->ucolor->bold) sprintf(strcolor + strlen(strcolor), " bold=1"); + if ((*pp)->ucolor->italic) sprintf(strcolor + strlen(strcolor), " italic=1"); if ((*pp)->ucolor->dim) sprintf(strcolor + strlen(strcolor), " dim=1"); if ((*pp)->ucolor->reverse) sprintf(strcolor + strlen(strcolor), " reverse=1"); if ((*pp)->ucolor->standout) sprintf(strcolor + strlen(strcolor), " standout=1"); @@ -1331,6 +1331,7 @@ void ui_set_ucolor(WINDOW * w, struct ucolor * uc) { short color; long attr = A_NORMAL; if (uc->bold) attr |= A_BOLD; + if (uc->italic) attr |= A_ITALIC; if (uc->dim) attr |= A_DIM; if (uc->reverse) attr |= A_REVERSE; if (uc->standout) attr |= A_STANDOUT; @@ -573,9 +573,11 @@ int export_xlsx(char * filename, int r0, int c0, int rn, int cn) { else if ((*pp)->label) // right align format_set_align(format, LXW_ALIGN_RIGHT); - // handle bold and underline + // handle bold, italic and underline if ((*pp)->ucolor != NULL && (*pp)->ucolor->bold) format_set_bold(format); + else if ((*pp)->ucolor != NULL && (*pp)->ucolor->italic) + format_set_italic(format); else if ((*pp)->ucolor != NULL && (*pp)->ucolor->underline) format_set_underline(format, LXW_UNDERLINE_SINGLE); |