Bug 364992 - [Feature request] Add an option to disable the embedded "drawLineChar" mechanism
Summary: [Feature request] Add an option to disable the embedded "drawLineChar" mechanism
Status: RESOLVED FIXED
Alias: None
Product: konsole
Classification: Applications
Component: font (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-02 06:34 UTC by Yi Yang
Modified: 2016-07-19 01:40 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Screenshot showcasing worst-case scenario for the built-in line drawing mechanism (35.40 KB, image/png)
2016-07-02 06:41 UTC, Yi Yang
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Yi Yang 2016-07-02 06:34:13 UTC
Currently, for certain box drawing characters, Konsole hardcode their shapes disregarding the font used. This has a few consequences:
* When using a high quality font fine tweaked for use in a terminal, the quality becomes lower. The designer might have chosen better line widths, or different corner styles, which are all lost.
* When using a high resolution screen, the pixel level line drawing done by Konsole produces unrecognizable characters. The problem worsens when double-line box drawing characters and bold font are involved.

So I'm not asking to remove this line drawing feature, since it's still useful when one uses an inadequate terminal font. However, since nowadays high quality terminal fonts are much easier to come by, with all kinds of license from open source to free-of-charge to commercial, at least we should allow the user to use their box-drawing characters from their fonts.

While this is a feature request, it's also a bug report, in the sense that the letter "╫", in bold style, is rendered insanely poorly, to the point that it's simply impossible to tell it's actually double vertical line and single horizontal line.

Reproducible: Always

Steps to Reproduce:
Copy the following character to Konsole: "╫".
For worse result, set the font to bold.
For worse result, use a high resolution screen.
Grab quality free fonts, and set them. You will find the shape of "╫" does not change.

Actual Results:  
You will see the glyph "╫", always drawn with lines of width of exactly one pixel. If you set it to bold, the vertical lines becomes two pixels wide, and the gap between the two vertical lines completely disappears.

if you use a high resolution screen, you might not be able to spot it's two vertical lines without a magnifier.

When you resize the terminal fonts, the line width of "╫" does not change, causing style inconsistency with your console font.

Expected Results:  
Since this is a feature request, I wish we could have an option to simply use the box drawing glyphs built in the console font I chose.
Comment 1 Yi Yang 2016-07-02 06:36:57 UTC
This should be fairly easy to implement:

In TerminalDisplay.cpp, method TerminalDisplay::drawCharacters, there is a if-clause calling isLineCharString(text) to decide whether to draw something with built-in line drawing mechanism or to draw it with the chosen font.

Probably one could add an option that forces one to draw with the chosen font there.
Comment 2 Yi Yang 2016-07-02 06:41:17 UTC
Created attachment 99796 [details]
Screenshot showcasing worst-case scenario for the built-in line drawing mechanism

The command was
echo -e '╫\033[01m╫'
and as you can see, one can barely see it's two lines, and it's impossible to tell it in bold style.
Comment 3 Martin Sandsmark 2016-07-03 02:18:35 UTC
https://bugs.kde.org/show_bug.cgi?id=61637 is the original bug where the feature came from, Maksim noted that it didn't scale properly.
Comment 4 Yi Yang 2016-07-10 07:14:29 UTC
It's amazing to see some code written 11 years ago which fixes a bug reported 13 years ago can still work.

However, as I have argued, the available fonts have changed, and the available screen resolutions have changed. Maybe it's time to revisit this patch.
Comment 5 Kurt Hindenburg 2016-07-17 19:50:37 UTC
I have code that does this - I'll see if I can get it in the next few days for the next release.
Comment 6 Kurt Hindenburg 2016-07-19 01:36:40 UTC
Git commit a4de3feb16df7f18559587ebf78f115d88acc022 by Kurt Hindenburg.
Committed on 19/07/2016 at 01:34.
Pushed by hindenburg into branch 'master'.

Add option to use the selected font's line characters

Konsole has builtin code to manually write out line characters.  There
are certain reasons why this might not be desired.  This adds a profile
option to use the fonts line characters.  The default is as-is today
using the builtin code.

M  +9    -0    src/EditProfileDialog.cpp
M  +1    -0    src/EditProfileDialog.h
M  +10   -0    src/EditProfileDialog.ui
M  +2    -0    src/Profile.cpp
M  +8    -0    src/Profile.h
M  +2    -1    src/TerminalDisplay.cpp
M  +16   -0    src/TerminalDisplay.h
M  +1    -0    src/ViewManager.cpp

http://commits.kde.org/konsole/a4de3feb16df7f18559587ebf78f115d88acc022
Comment 7 Kurt Hindenburg 2016-07-19 01:40:10 UTC
Git commit e33355a4d0f57a27ca50270d74b23486fd3ddf2c by Kurt Hindenburg.
Committed on 19/07/2016 at 01:37.
Pushed by hindenburg into branch 'Applications/16.08'.

Add option to use the selected font's line characters

Konsole has builtin code to manually write out line characters.  There
are certain reasons why this might not be desired.  This adds a profile
option to use the fonts line characters.  The default is as-is today
using the builtin code.
(cherry picked from commit a4de3feb16df7f18559587ebf78f115d88acc022)

M  +9    -0    src/EditProfileDialog.cpp
M  +1    -0    src/EditProfileDialog.h
M  +10   -0    src/EditProfileDialog.ui
M  +2    -0    src/Profile.cpp
M  +8    -0    src/Profile.h
M  +2    -1    src/TerminalDisplay.cpp
M  +16   -0    src/TerminalDisplay.h
M  +1    -0    src/ViewManager.cpp

http://commits.kde.org/konsole/e33355a4d0f57a27ca50270d74b23486fd3ddf2c