summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/cmds.c1
-rw-r--r--src/color.c5
-rw-r--r--src/color.h1
-rwxr-xr-xsrc/doc3
-rw-r--r--src/file.c1
-rw-r--r--src/tui.c1
-rw-r--r--src/xlsx.c4
7 files changed, 14 insertions, 2 deletions
diff --git a/src/cmds.c b/src/cmds.c
index 0961f4e..de6636c 100644
--- a/src/cmds.c
+++ b/src/cmds.c
@@ -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;
diff --git a/src/doc b/src/doc
index 3dcd97b..fd9db78 100755
--- a/src/doc
+++ b/src/doc
@@ -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:
diff --git a/src/file.c b/src/file.c
index 7c0060a..fb93cb0 100644
--- a/src/file.c
+++ b/src/file.c
@@ -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");
diff --git a/src/tui.c b/src/tui.c
index 6b40f81..d6fe467 100644
--- a/src/tui.c
+++ b/src/tui.c
@@ -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;
diff --git a/src/xlsx.c b/src/xlsx.c
index a8d7d18..6fe9bf6 100644
--- a/src/xlsx.c
+++ b/src/xlsx.c
@@ -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);