Italic style support

openid
Marcin Kulik 13 years ago
parent bf115d99be
commit ee6298d515

@ -5,7 +5,7 @@ class AsciiIo.Brush
@cache = {}
@hash: (brush) ->
"#{brush.fg}_#{brush.bg}_#{brush.bright}_#{brush.underline}"
"#{brush.fg}_#{brush.bg}_#{brush.bright}_#{brush.underline}_#{brush.italic}"
@create: (options) ->
options ||= {}
@ -24,3 +24,4 @@ class AsciiIo.Brush
@bg = options.bg
@bright = options.bright
@underline = options.underline
@italic = options.italic

@ -86,6 +86,9 @@ class AsciiIo.TerminalView extends Backbone.View
if brush.underline
span += " underline"
if brush.italic
span += " italic"
span += " bg" + brush.bg if brush.bg isnt undefined
span += " cursor visible" if hasCursor
span += "\">"

@ -264,8 +264,12 @@ class AsciiIo.VT
@underline = false
else if n is 1
@bright = true
else if n is 3
@italic = true
else if n is 4
@underline = true
else if n is 23
@italic = false
else if n is 24
@underline = false
else if n >= 30 and n <= 37
@ -290,6 +294,7 @@ class AsciiIo.VT
props.bg = @bg if @bg
props.bright = true if @bright
props.underline = true if @underline
props.italic = true if @italic
@setBrush AsciiIo.Brush.create(props)
@ -641,6 +646,7 @@ class AsciiIo.VT
@fg = @bg = undefined
@bright = false
@underline = false
@italic = false
@updateScreen()

@ -63,6 +63,7 @@
.bright { font-weight: bold }
.underline { text-decoration: underline }
.italic { font-style: italic }
/* Foregrounds: */

Loading…
Cancel
Save