Bug 447234 - Strange handling of bold fonts and incorrect operation of "Draw intense colours in bold font" option.
Summary: Strange handling of bold fonts and incorrect operation of "Draw intense colou...
Status: REPORTED
Alias: None
Product: konsole
Classification: Applications
Component: font (show other bugs)
Version: 19.12.3
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-12-19 15:48 UTC by Denys
Modified: 2021-12-19 15:49 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Various combinations of normal/bold text in normal and bright colours as shown by "xterm +pc" (35.44 KB, image/png)
2021-12-19 15:48 UTC, Denys
Details
Various combinations of normal/bold text in normal and bright colours as shown by Konsole with "Draw intense colours in bold font" is OFF (30.44 KB, image/png)
2021-12-19 15:49 UTC, Denys
Details
Various combinations of normal/bold text in normal and bright colours as shown by Konsole with "Draw intense colours in bold font" is ON (36.37 KB, image/png)
2021-12-19 15:49 UTC, Denys
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Denys 2021-12-19 15:48:21 UTC
Created attachment 144682 [details]
Various combinations of normal/bold text in normal and bright colours as shown by "xterm +pc"

SUMMARY
***
Background:
ANSI escape codes allow to specify colours of text as well as attributes such as "bold". Colours can be "normal" or "bright".
So ideally a terminal should work like this:
a) normal colour + normal font -> normal colour + normal font
b) normal colour +  bold  font -> normal colour +  bold  font
c) bright colour + normal font -> bright colour + normal font
d) bright colour +  bold  font -> bright colour +  bold  font

Some antique terminals were not able to show bold fonts, so they simulated it by changing the brightness of text from "normal" to "bright". This is called "PC-style of bold colours".
This limitation resulted in this:
a) normal colour + normal font -> normal colour + normal font
b) normal colour +  bold  font -> BRIGHT colour + NORMAL font
c) bright colour + normal font -> bright colour + normal font
d) bright colour +  bold  font -> bright colour + NORMAL font

------------
Problem:

Strangely, Konsole does not work in either way and so it neither follows standards nor does what it promises.
The behaviour depends on an option called "Draw intense colours in bold font".

Where "Draw intense colours in bold font" is OFF, the behaviour is identical to "PC-style":
a) normal colour + normal font -> normal colour + normal font
b) normal colour +  bold  font -> BRIGHT colour + NORMAL font
c) bright colour + normal font -> bright colour + normal font
d) bright colour +  bold  font -> bright colour + NORMAL font
So there are no bold fonts, they are simulated. Surely this makes no sense in any modern graphical environment where bold fonts are easily accessible.

Where "Draw intense colours in bold font" is ON, the behaviour is just weird:
a) normal colour + normal font -> normal colour + normal font
b) normal colour +  bold  font -> BRIGHT colour +  bold  font
c) bright colour + normal font -> bright colour + normal font
d) bright colour +  bold  font -> bright colour +  bold  font

So overall,
1. Konsole does not follow standards precisely in any case.
2. The meaning of "Draw intense colours in bold font" is actually "Draw bold fonts in intense colours".

I suppose the original intention for "Draw intense colours in bold font" was to simulate "PC-style" workaround for incapable devices. However, it does a different thing, which is both non-standard and not useful AFAIK.

I am attaching three screenshots showing the behaviour.
One of the screenshots is that of xterm with "PC-style behaviour" switched off. It shows the ideal output, demonstrating the available richness of text attributes. The other two are two different modes of Konsole.

***


STEPS TO REPRODUCE
1. In Konsole, produce text with various boldness attributes and colours from both levels of brightness. You can use https://github.com/rtvd/terminal-aesthetics/blob/main/ansi_demo.sh with "--no-faint" option to produce the same picture as in the screenshots.
2. Try both options of "Draw intense colours in bold font", which is in "Edit Current Profile ..." > "Appearance".
3. Observe how the brightness and font weight change.

OBSERVED RESULT

In all cases, "bold" text attribute always makes "normal" colour to become "bright" (for bright colours it does not do anything). Disabling "Draw intense colours in bold fonts" simply means that bold fonts are shown as normal ones, which essentially results in PC-style behaviour.

EXPECTED RESULT

Terminal should follow the standards of ASCI escape codes, and "show bold fonts in intense colours" should do what it promises.


SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Ubuntu 20.04.3 LTS 
KDE Plasma Version: N/A, I am running konsole in Gnome
KDE Frameworks Version: N/A, I am running konsole in Gnome
Qt Version: 5.12.8

ADDITIONAL INFORMATION

N/A
Comment 1 Denys 2021-12-19 15:49:23 UTC
Created attachment 144683 [details]
Various combinations of normal/bold text in normal and bright colours as shown by Konsole with "Draw intense colours in bold font" is OFF
Comment 2 Denys 2021-12-19 15:49:40 UTC
Created attachment 144684 [details]
Various combinations of normal/bold text in normal and bright colours as shown by Konsole with "Draw intense colours in bold font" is ON