Ticket #3065 (closed enhancement: fixed)

Opened 11 years ago

Last modified 9 years ago

Support italic text

Reported by: egmont Owned by: andrew_b
Priority: minor Milestone: 4.8.14
Component: mc-tty Version: master
Keywords: Cc:
Blocked By: Blocking:
Branch state: merged Votes for changeset: committed-master

Description

This ticket is for future reference, currently it's a proof of concept only.

Some terminals (the ones I know about right now are: rxvt-unicode and vte (gnome-terminal etc.)) support italic text. To test whether your terminal supports it, try this command:

echo $'Normal \e[3mItalic\e[0m'

I've created proof of concept patches for SLang and MC - if you patch both, and compile mc against the patched slang, you'll get italic support in your skins.

I've talked to ncurses's author, he said he'll consider adding support. I'm just about to contact slang's developers.

In order for mc to add proper support, the following would be required:

  • at least one of ncurses and slang (but ideally both) providing mainstream support
  • configure-time autodetect whether the required constants are defined

Let's hope this can happen at some point in the future.

Attachments

mc-italic.png (49.0 KB) - added by egmont 11 years ago.
screenshot
slang-2.2.4-italic.patch (3.3 KB) - added by egmont 11 years ago.
patch for slang
mc-4.8.10-italic.patch (6.0 KB) - added by egmont 11 years ago.
patch for mc
mc-3065-italic.patch (6.7 KB) - added by egmont 10 years ago.
Italic patch, updated

Change History

Changed 11 years ago by egmont

screenshot

Changed 11 years ago by egmont

patch for slang

Changed 11 years ago by egmont

patch for mc

comment:1 Changed 11 years ago by egmont

(Just for the record: Konsole's latest version also supports italic.)

comment:2 follow-up: ↓ 3 Changed 11 years ago by egmont

My slang patch made it to dev snapshot pre2.3.0-107, so forthcoming slang-2.3.0 will support italics :)

comment:3 in reply to: ↑ 2 Changed 11 years ago by andrew_b

Replying to egmont:

My slang patch made it to dev snapshot pre2.3.0-107, so forthcoming slang-2.3.0 will support italics :)

But ncurses does't yet.

Well, in this case mc must require newest slang (>= 2.3.0). I don't thing this is good idea. If we use the #ifdef for slang-italic-related code, what about skins? Will attributes like bold+italic+underline be parsed correctly w/o italic support?

comment:4 Changed 11 years ago by egmont

That's why I started my ticket with "this ticket is for future reference" :) I don't think it should be applied yet, I'm just gathering information. IMO we should wait at least until slang 2.3 is officially released and see where ncurses is at that time, or maybe even wait until ncurses adds support.

Skins will be parsed correctly and italic will be ignored if we put "#if SLANG_VER >= 20300" guards properly.

comment:6 Changed 11 years ago by egmont

Cool, thanks :) I wasn't keeping an eye on ncurses snapshots.

I'll come up with a proper mc patch soon.

comment:7 Changed 10 years ago by egmont

Now that slang-2.3 is out with italic support, and ncurses weekly snapshots have supported it for over a year, I went ahead and updated the patch.

Could you please try it out, review and apply?

I've added some #ifdef guards so that it still compiles with older version, you just silently won't get italic support then.

I've tested with old ncurses, old slang (=> compiles, no italic), new ncurses, new slang (italic works).

Changed 10 years ago by egmont

Italic patch, updated

comment:8 Changed 9 years ago by egmont

Friendly ping... Could you please take a look at the patch?

At least two leading distributions will ship slang-2.3 in their next release (Ubuntu Vivid and Fedora 22 expected this April / May - not sure about the other distros), making it possible to use italic text in mc skins. I think it's a really cool feature :)

comment:9 Changed 9 years ago by andrew_b

  • Owner set to andrew_b
  • Status changed from new to accepted
  • Component changed from mc-skin to mc-tty
  • Branch state changed from no branch to on review
  • Milestone changed from Future Releases to 4.8.14

Thanks!

Branch: 3065_italic
Initial changeset:89d2db5ca3f27e19a3f2551706ef515879faa846

comment:10 Changed 9 years ago by andrew_b

  • Votes for changeset set to andrew_b
  • Branch state changed from on review to approved

comment:11 Changed 9 years ago by andrew_b

  • Status changed from accepted to testing
  • Votes for changeset changed from andrew_b to committed-master
  • Resolution set to fixed
  • Branch state changed from approved to merged

Merged to master: [e7e3aed174d94c90d00c9bb13e9218442a5fcdbb].

git log --pretty=oneline 45d135d..e7e3aed

comment:12 Changed 9 years ago by andrew_b

  • Status changed from testing to closed
Note: See TracTickets for help on using tickets.