[ncurses6] Support italics
This commit is contained in:
parent
af31088481
commit
182a6d99fd
12
src/ansi.go
12
src/ansi.go
@ -143,15 +143,17 @@ func interpretCode(ansiCode string, prevState *ansiState) *ansiState {
|
|||||||
case 49:
|
case 49:
|
||||||
state.bg = -1
|
state.bg = -1
|
||||||
case 1:
|
case 1:
|
||||||
state.attr = tui.Bold
|
state.attr = state.attr | tui.Bold
|
||||||
case 2:
|
case 2:
|
||||||
state.attr = tui.Dim
|
state.attr = state.attr | tui.Dim
|
||||||
|
case 3:
|
||||||
|
state.attr = state.attr | tui.Italic
|
||||||
case 4:
|
case 4:
|
||||||
state.attr = tui.Underline
|
state.attr = state.attr | tui.Underline
|
||||||
case 5:
|
case 5:
|
||||||
state.attr = tui.Blink
|
state.attr = state.attr | tui.Blink
|
||||||
case 7:
|
case 7:
|
||||||
state.attr = tui.Reverse
|
state.attr = state.attr | tui.Reverse
|
||||||
case 0:
|
case 0:
|
||||||
init()
|
init()
|
||||||
default:
|
default:
|
||||||
|
@ -30,7 +30,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type ColorPair int16
|
type ColorPair int16
|
||||||
type Attr C.int
|
type Attr C.uint
|
||||||
type WindowImpl C.WINDOW
|
type WindowImpl C.WINDOW
|
||||||
|
|
||||||
const (
|
const (
|
||||||
@ -39,6 +39,7 @@ const (
|
|||||||
Blink = C.A_BLINK
|
Blink = C.A_BLINK
|
||||||
Reverse = C.A_REVERSE
|
Reverse = C.A_REVERSE
|
||||||
Underline = C.A_UNDERLINE
|
Underline = C.A_UNDERLINE
|
||||||
|
Italic = C.A_VERTICAL << 1 // FIXME
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -48,6 +48,7 @@ const (
|
|||||||
Blink = Attr(tcell.AttrBlink)
|
Blink = Attr(tcell.AttrBlink)
|
||||||
Reverse = Attr(tcell.AttrReverse)
|
Reverse = Attr(tcell.AttrReverse)
|
||||||
Underline = Attr(tcell.AttrUnderline)
|
Underline = Attr(tcell.AttrUnderline)
|
||||||
|
Italic = Attr(tcell.AttrNone) // Not supported
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
Loading…
x
Reference in New Issue
Block a user