This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Konsole spacing between lines.

Tags: None
(comma "," separated)
johannespfister
Registered Member
Posts
4
Karma
0

Konsole spacing between lines.

Mon Aug 24, 2020 12:15 pm
TL;DR: Can i change the distance between the lines in Konsole without change the font size?

I have 2 computers both with Debian. Both have Konsole installed and use the same profiles (the files in ~/.local/share/konsole/) and both use monospace with a size of 7.
One with Debian Stretch and Konsole 16.12.0 installed. There the font spacing works like i want and it uses 10 pixel per line.
The second with Debian Buster and Konsole 18.04.0 installed. There the spacing between the lines is larger than i want and it uses 12 pixels per line. The size of the characters is the same as in version 16.12.0 with font size 7. When i change the font size to 6 version 18.04.0 uses only 10 pixels per line, but the characters are harder to read (not enough pixels) than the 16.12.0 version with font size 7.

I would like to have 10 per line on both versions, in combination with readable characters. Is there a way to do that?
Or another way to display as many lines as possible while still being readable?
Copying the /etc/fonts folder from Stretch to Buster did not help.

  • Konsole Version 16.12.0 font size 7: 10 Pixel per line. Good
  • Konsole Version 18.04.0 font size 7: 12 Pixel per line. Uses too much space. Characters look good (same as above).
  • Konsole Version 16.12.0 font size 6: 9 Pixel per line. Characters too small.
  • Konsole Version 18.04.0 font size 7: 10 Pixel per line. Characters too small (same as above).

The Appearance section of my .profile-file.
Code: Select all
[Appearance]
AntiAliasFonts=false
ColorScheme=DarkPastels
Font=Monospace,7,-1,5,50,0,0,0,0,0
User avatar
raphaelra
Registered Member
Posts
209
Karma
0
OS

Re: Konsole spacing between lines.

Tue Aug 25, 2020 9:29 am
You can add the line
Code: Select all
LineSpacing=-1
(or any other negative number) to the [Appearance] section of the profile config file, but this will be overwritten if you change anything via the appearance settings dialog
johannespfister
Registered Member
Posts
4
Karma
0

Re: Konsole spacing between lines.

Tue Aug 25, 2020 11:35 am
Thank you. Added LineSpacing=-2 after the font settings and it works.
User avatar
raphaelra
Registered Member
Posts
209
Karma
0
OS

Re: Konsole spacing between lines.

Tue Aug 25, 2020 1:20 pm
You can lock this settings down using [$i] after key name
Code: Select all
LineSpacing[$i]=-2
This should prevent the value from overwriting when using settings dialogs
johannespfister
Registered Member
Posts
4
Karma
0

Re: Konsole spacing between lines.

Tue Aug 25, 2020 1:43 pm
Sorry, correction.
It works somewhat. But now there are cases (it seems random) where the line above overwrites some of the pixels of the chars a line below. How can i fix that? Because it worked in the old version.
If i see it correctly, it removes 2 lines of pixels above a character but it should be 1 above and 1 below. Now it is the case that if there is a line with a different background color, the highest pixel of the letters of this line are 1 pixel above the color and there are 1 pixels below the characters which still have the color of that line.
User avatar
raphaelra
Registered Member
Posts
209
Karma
0
OS

Re: Konsole spacing between lines.

Tue Aug 25, 2020 2:08 pm
johannespfister wrote:/.../ It works somewhat. But now there are cases (it seems random) where the line above overwrites some of the pixels of the chars a line below. How can i fix that?

I'm afraid you can't. This with negative numbers for LineSpacing is a side effect. I suppose LineSpacing was originally intended for additional pixels between two lines. This is an amount of pixels added to y position where the next line is painted. Because each line may have one or two pixels of empty space below/above the text, this hack works for values of -1 or at most -2. For smaller values you will see the overlapping.

UPDATE ...

I checked the source code of konsole. The y-position for the next line is calculated with height() and ascent() returned from used font and the additional LineSpacing attribute.


Bookmarks



Who is online

Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell