Bug 305555 - Wrong spacing in certain monospace fonts
Summary: Wrong spacing in certain monospace fonts
Status: RESOLVED UPSTREAM
Alias: None
Product: konsole
Classification: Applications
Component: font (show other bugs)
Version: 2.8.3
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL: https://bugs.gentoo.org/show_bug.cgi?...
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-21 14:37 UTC by Thomas Kahle
Modified: 2012-08-22 10:51 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
one d (2.60 KB, image/png)
2012-08-21 14:37 UTC, Thomas Kahle
Details
some d's (2.49 KB, image/png)
2012-08-21 14:38 UTC, Thomas Kahle
Details
many d's (2.53 KB, image/png)
2012-08-21 14:38 UTC, Thomas Kahle
Details
inconsolata font that has the problem (with 'l') (57.09 KB, application/vnd.oasis.opendocument.formula-template)
2012-08-21 19:12 UTC, Thomas Kahle
Details
liberation -> Problem on the 'd' (but not 'l') (307.04 KB, application/x-font-ttf)
2012-08-21 19:14 UTC, Thomas Kahle
Details
FontTest Qt source (801 bytes, application/x-compressed-tar)
2012-08-21 22:02 UTC, Christoph Feck
Details
result of font test (23.96 KB, text/plain)
2012-08-22 06:33 UTC, Thomas Kahle
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Kahle 2012-08-21 14:37:06 UTC
When using liberation-mono version 2.0, or the inconsolata font (and possibly other monospace fonts) the spacing is wrong and leads to display errors. (I'm attaching screenshots of pressing a sequence of d's that moves the curser too far out). This does not happen in other kde applications such as kate.

Reproducible: Always

Steps to Reproduce:
1. Install inconsolata font
2. select it as the font in console
3. fill the screen with text
Actual Results:  
Display errors.
Comment 1 Thomas Kahle 2012-08-21 14:37:51 UTC
Created attachment 73356 [details]
one d
Comment 2 Thomas Kahle 2012-08-21 14:38:11 UTC
Created attachment 73357 [details]
some d's
Comment 3 Thomas Kahle 2012-08-21 14:38:33 UTC
Created attachment 73358 [details]
many d's
Comment 4 Thomas Kahle 2012-08-21 14:38:57 UTC
Adding downstream bug to URL.
Comment 5 Christoph Feck 2012-08-21 18:06:34 UTC
I guess this is a problem in the font. It probably advertises itself as a monospaced, i.e. all characters having the same advance width, but they aren't all the same.

Can you attach the font?
Comment 6 Thomas Kahle 2012-08-21 19:12:16 UTC
Created attachment 73366 [details]
inconsolata font that has the problem (with 'l')
Comment 7 Thomas Kahle 2012-08-21 19:14:10 UTC
Created attachment 73367 [details]
liberation -> Problem on the 'd' (but not 'l')
Comment 8 Thomas Kahle 2012-08-21 19:15:01 UTC
(In reply to comment #5)
> I guess this is a problem in the font. It probably advertises itself as a
> monospaced, i.e. all characters having the same advance width, but they
> aren't all the same.
> 
> Can you attach the font?

I attached two that have the problem on different letters.  Inconsolata with l, and liberation with d (as in the screenshots.)
Comment 9 Christoph Feck 2012-08-21 22:01:16 UTC
Cannot reproduce on my system, both fonts work fine in multiple sizes I tried.
KDE 4.9.0, Qt 4.8.2, freetype 2.4.9, xdyinfo: resolution:    96x96 dots per inch

Could you compile the attached FontTest program using
     qmake -project && qmake && make

and attach its generated "fonttest.txt" output when run using
    ./FontTest 2> fonttest.txt

if possible?
Comment 10 Christoph Feck 2012-08-21 22:02:05 UTC
Created attachment 73374 [details]
FontTest Qt source
Comment 11 Thomas Kahle 2012-08-22 06:33:21 UTC
Created attachment 73376 [details]
result of font test

I'm also on 96x96 dpi
Comment 12 Christoph Feck 2012-08-22 10:51:18 UTC
Thanks. On your system, Qt indeed returns different widths for different characters (the first "w" value). This could be a Qt bug, or a fontconfig/freetype bug.

Konsole cannot be blamed for this. If the Qt font database indicates the font is monospaced, then Qt should not return different widths. Please report this issue to the bug tracker of the Qt project via https://bugreports.qt-project.org/

A workaround in Konsole would be if Konsole rendered each character on its own, instead of rendering complete text lines, but this would be much slower, and I doubt Konsole should work around bugs in upstream libraries.