Skip to content

Commit

Permalink
Ticket #3065: support of italic text.
Browse files Browse the repository at this point in the history
Italic text is supported by S-Lang since pre2.3.0-107 and NCurses since 5.9.20130831.

Signed-off-by: Andrew Borodin <[email protected]>
  • Loading branch information
egmontkob authored and aborodin committed Feb 17, 2015
1 parent 45d135d commit 89d2db5
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 21 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ Antonio Palama, DOS port <[email protected]>

Egmont Koblinger <[email protected]>
Support of 256 colors
Support of italic text
Support of extended mouse clicks beyond 223 column
Support of bracketed paste mode of xterm
(http://invisible-island.net/xterm/ctlseqs/ctlseqs.html#Bracketed%20Paste%20Mode)
Expand Down
2 changes: 1 addition & 1 deletion doc/man/mc.1.in
Original file line number Diff line number Diff line change
Expand Up @@ -3609,7 +3609,7 @@ color16 to color255, or as rgb000 to rgb555 and gray0 to gray23. Example:
base_color=normal=white,default:marked=magenta,default
.fi
.PP
Attributes can be any of bold, underline, reverse and blink, appended by a
Attributes can be any of bold, italic, underline, reverse and blink, appended by a
plus sign if more than one are desired. The special word "none" means no
attributes, without attempting to fall back to base_color. Example:
.PP
Expand Down
2 changes: 1 addition & 1 deletion doc/man/mcedit.1.in
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ uses the color before the slash. See cooledit(1) for supported
.B cooledit
colors.
.PP
Attributes can be any of bold, underline, reverse and blink, appended by a
Attributes can be any of bold, italic, underline, reverse and blink, appended by a
plus sign if more than one are desired.
.PP
Comments may be put on a separate line starting with the hash sign (#).
Expand Down
2 changes: 1 addition & 1 deletion doc/man/ru/mc.1.in
Original file line number Diff line number Diff line change
Expand Up @@ -3999,7 +3999,7 @@ lightgray и white. Для прозрачного фона используют
base_color=normal=white,default:marked=magenta,default
.fi
.PP
Атрибуты обозначаются словами "bold", "underline", "reverse" и "blink".
Атрибуты обозначаются словами "bold", "italic", "underline", "reverse" и "blink".
Чтобы использовать несколько атрибутов, их надо перечислить через символ "+".
The special word "none" menas no attributes, without attempting to fall back
to base_color. Пример:
Expand Down
3 changes: 3 additions & 0 deletions lib/tty/color-internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ mc_tty_color_table_t const color_table[] = {

mc_tty_color_table_t const attributes_table[] = {
{"bold", A_BOLD},
#ifdef A_ITALIC /* available since ncurses-5.9-20130831 / slang-pre2.3.0-107 */
{"italic", A_ITALIC},
#endif /* A_ITALIC */
{"underline", A_UNDERLINE},
{"reverse", A_REVERSE},
{"blink", A_BLINK},
Expand Down
7 changes: 6 additions & 1 deletion lib/tty/color-slang.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,17 @@
/*** typedefs(not structures) and defined constants **********************************************/

/* When using Slang with color, we have all the indexes free but
* those defined here (A_BOLD, A_UNDERLINE, A_REVERSE, A_BLINK)
* those defined here (A_BOLD, A_ITALIC, A_UNDERLINE, A_REVERSE, A_BLINK)
*/

#ifndef A_BOLD
#define A_BOLD SLTT_BOLD_MASK
#endif /* A_BOLD */
#ifdef SLTT_ITALIC_MASK /* available since slang-pre2.3.0-107 */
#ifndef A_ITALIC
#define A_ITALIC SLTT_ITALIC_MASK
#endif /* A_ITALIC */
#endif /* SLTT_ITALIC_MASK */
#ifndef A_UNDERLINE
#define A_UNDERLINE SLTT_ULINE_MASK
#endif /* A_UNDERLINE */
Expand Down
35 changes: 19 additions & 16 deletions misc/skins/sand256.ini
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,12 @@
#
# Following the foreground and background colors, the third (optional) value
# can specify special attributes to enable. Valid values are bold, underline,
# reverse and blink. Append more with a plus sign, e.g. "underline+bold".
# italic, reverse and blink. Append more with a plus sign, e.g. "bold+italic".
# Leaving the field empty makes it fall back to the attributes of _default_.
# Use any other word (e.g. "none") to prevent fallback and disable all flags.
#
# Italic support requires a recent enough ncurses (>= 5.9.20130831) or slang
# (>= 2.3). All attributes are subject to support by the terminal emulator.

[skin]
description = Sand skin using 256 colors
Expand Down Expand Up @@ -81,31 +84,31 @@
[core]
_default_ = black;rgb554
selected = ;rgb452
marked = rgb400
markselect = rgb400;rgb452
marked = rgb400;;italic
markselect = rgb400;rgb452;italic
gauge = ;rgb452
input = ;rgb452
inputunchanged = gray;rgb452
inputmark = rgb452;gray
disabled = gray;rgb553
reverse = ;rgb452
commandlinemark = white;gray
header = red
header = red;;italic

[dialog]
_default_ = black;rgb553
dfocus = ;rgb452
dhotnormal = ;;underline
dhotfocus = ;rgb452;underline
dtitle = ;;underline
dtitle = ;;italic+underline

[error]
_default_ = rgb554;rgb320;bold
# "black" might change color when going bold, so use "rgb000" instead
errdfocus = rgb000;rgb452;bold
errdhotnormal = ;;bold+underline
errdhotfocus = rgb000;rgb452;bold+underline
errdtitle = ;;bold+underline
errdtitle = ;;bold+italic+underline

[filehighlight]
directory =
Expand All @@ -126,36 +129,36 @@
database = rgb421

[menu]
_default_ = black;rgb452
_default_ = black;rgb452;italic
menusel = ;rgb551
menuhot = ;;underline
menuhotsel = ;rgb551;underline
menuhot = ;;italic+underline
menuhotsel = ;rgb551;italic+underline
menuinactive =

[popupmenu]
_default_ = black;rgb553
menusel = ;rgb452;underline
menutitle = ;;underline
menutitle = ;;italic+underline

[buttonbar]
hotkey = black;rgb554
button = black;rgb452
hotkey = black;rgb554;italic
button = black;rgb452;italic

[statusbar]
_default_ = black;rgb452
_default_ = black;rgb452;italic

[help]
_default_ = black;rgb553
helpitalic = green
helpbold = red
helpitalic = green;;italic
helpbold = red;;bold
helplink = blue;;underline
helpslink = blue;;reverse
helptitle = ;;underline

[editor]
_default_ = black;rgb554
editbold = rgb400
editmarked = ;rgb452
editmarked = ;rgb452;italic
editwhitespace = rgb400;rgb553
editlinestate = ;rgb553
bookmark = ;rgb551
Expand Down
2 changes: 1 addition & 1 deletion src/args.c
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,7 @@ mc_args_new_color_group (void)
"Extended colors, when 256 colors are available:\n"
" color16 to color255, or rgb000 to rgb555 and gray0 to gray23\n\n"
"Attributes:\n"
" bold, underline, reverse, blink; append more with '+'\n")
" bold, italic, underline, reverse, blink; append more with '+'\n")
);
/* *INDENT-ON* */

Expand Down

0 comments on commit 89d2db5

Please sign in to comment.