diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2015-09-27 14:24:42 +0100 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2015-09-27 14:24:42 +0100 |
| commit | 9fdb822c27e6eee7c3034161d3c893eefc1dc491 (patch) | |
| tree | 525c67b4b33a49b98c7a03dc7b596f7ade35fb59 /src | |
| parent | e2720f1fbe09649e6da282cd33b9794867d3d0fb (diff) | |
Add support for italic text attribute
Diffstat (limited to 'src')
| -rw-r--r-- | src/face.hh | 3 | ||||
| -rw-r--r-- | src/face_registry.cc | 1 | ||||
| -rw-r--r-- | src/ncurses_ui.cc | 3 |
3 files changed, 6 insertions, 1 deletions
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; |
