Maximus5 / ConEmu

Customizable Windows terminal with tabs, splits, quake-style, hotkeys and more
https://conemu.github.io/
BSD 3-Clause "New" or "Revised" License
8.64k stars 580 forks source link

Feature Request: Add support for strikethrough (crossed-out) text #677

Open udif opened 8 years ago

udif commented 8 years ago

I guess this is a feature request, not a bug report:

Is it possible to support the strikethrough attribute? (ANSI code ESC[9m) ? I know this code is not supported yet, while others are.

Here is how this is rendered under Linux: http://askubuntu.com/questions/528928/how-to-do-underline-bold-italic-strikethrough-color-background-and-size-i alt tag

I assume that this is impossible using the current rendering method, because the SetConsoleTextAttribute() API call has no support for strikethrough, but with DirectWrite appearing on the road map and here, I hope this would be possible.

http://www.charlespetzold.com/blog/2014/01/Character-Formatting-Extensions-with-DirectWrite.html alt tag

Maximus5 commented 8 years ago

DirectDraw will not magically fix the lack of SetConsoleTextAttribute.

Even with ANSI codes you can only set single-strikethrough attribute (not supported in ConEmu)

udif commented 8 years ago
  1. I don't really understand your note about DirectDraw. if I understand correctly (I'm not a Win32 programmer), the standard Console can set a limited number of attributes using SetConsoleTextAttribute() , with strikethrough not being one of them. With DirectWrite, on the other hand, even though strikethrough is not built-in, you can add it yourself without too much effort, as demonstrated by Petzold's blog article.
  2. I know that ANSI codes only support a single strikethrough, but that is enough for me. I'm using it for my diff utility that uses a combination of ANSI colors and strikethrough to achieve in-line diff, similar to Microsoft Word revision marks. This currently works nicely in Linux, but not Windows (either standard Win 10 TH2 console or ConEmu).

For my diff project, I replaced strikethrough with underline, by using ESC[4;31m instead of ESC9;31m .

The original, under Linux and using ESC[9;31m looks like this: alt img

Using the standard Windows 10 TH2 CMD.EXE console and ESC[4;31m for underline produces: alt img

However, under ConEmu using the same ESC[4;31m sequence produces non-underlined red text with a white grey background using under most of ConEmu's color schemes. alt img

Should I open a separate issue for this?

Maximus5 commented 8 years ago
  1. DirectWrite may be used for painting. It has nothing with console API. Absolutely. Don't thing that change of renderer magically bypasses console API limitations.
  2. ESC[4;31m has different implementations. Yes, in ConEmu it's used for background intensity.
renelindsay commented 8 years ago

udif asked about DirectWrite, NOT DirectDraw. They are not the same thing.

kyldvs commented 6 years ago

This feature would be nice. I ran into the same issues as udif when writing a diff utility.