summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.asciidoc3
-rw-r--r--src/face.hh3
-rw-r--r--src/face_registry.cc1
-rw-r--r--src/ncurses_ui.cc3
4 files changed, 9 insertions, 1 deletions
diff --git a/README.asciidoc b/README.asciidoc
index 02c8c4d2..cf4708ee 100644
--- a/README.asciidoc
+++ b/README.asciidoc
@@ -781,6 +781,9 @@ attributes is a string of letters each defining an attributes:
* `u`: Underline
* `r`: Reverse
* `b`: Bold
+ * `B`: Blink
+ * `d`: Dim
+ * `i`: Italic
Using named faces instead of facespec permits to change the effective faces
afterwards.
diff --git a/src/face.hh b/src/face.hh
index e650cd81..2540705e 100644
--- a/src/face.hh
+++ b/src/face.hh
@@ -14,7 +14,8 @@ enum class Attribute : int
Reverse = 1 << 2,
Blink = 1 << 3,
Bold = 1 << 4,
- Dim = 1 << 5
+ Dim = 1 << 5,
+ Italic = 1 << 6,
};
template<> struct WithBitOps<Attribute> : std::true_type {};
diff --git a/src/face_registry.cc b/src/face_registry.cc
index 5e42452d..96ae696f 100644
--- a/src/face_registry.cc
+++ b/src/face_registry.cc
@@ -28,6 +28,7 @@ static Face parse_face(StringView facedesc)
case 'b': res.attributes |= Attribute::Bold; break;
case 'B': res.attributes |= Attribute::Blink; break;
case 'd': res.attributes |= Attribute::Dim; break;
+ case 'i': res.attributes |= Attribute::Italic; break;
default: throw runtime_error(format("unknown face attribute '{}'", StringView{*attr_it}));
}
}
diff --git a/src/ncurses_ui.cc b/src/ncurses_ui.cc
index 9dfca1ad..0c9cc71a 100644
--- a/src/ncurses_ui.cc
+++ b/src/ncurses_ui.cc
@@ -241,6 +241,9 @@ void set_face(WINDOW* window, Face face, const Face& default_face)
set_attribute(window, A_BLINK, face.attributes & Attribute::Blink);
set_attribute(window, A_BOLD, face.attributes & Attribute::Bold);
set_attribute(window, A_DIM, face.attributes & Attribute::Dim);
+ #if defined(A_ITALIC)
+ set_attribute(window, A_ITALIC, face.attributes & Attribute::Italic);
+ #endif
}
static sig_atomic_t resize_pending = 0;