Bug 323994 - font rendering bug in English and Chinese chars.
Summary: font rendering bug in English and Chinese chars.
Status: RESOLVED DUPLICATE of bug 371687
Alias: None
Product: konsole
Classification: Applications
Component: font (show other bugs)
Version: 2.11
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Konsole Developer
URL: https://plus.google.com/1173384072600...
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-25 05:54 UTC by Grissiom
Modified: 2016-12-07 19:27 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Grissiom 2013-08-25 05:54:30 UTC
The screen shot is here:

https://plus.google.com/117338407260059907348/posts/HgANx9koSxN

The black part is Konsole and the white part is Kate. You can see from the screen shot that every thing seems fine in Kate but in Konsole, the baseline of Chinese fonts and English fonts are not aligned. The English chars are raised a little and nearly touch the line above.

It makes writing documenting in Konsole painful.

Both Konsole and Kate use monospace fonts and the relative fontconfig part is:

 <alias>
  <family>monospace</family>
  <prefer>
   <family>Consolas</family>
   <family>Liberation Mono</family>
   <family>FZLanTingHei-R-GBK</family>
  </prefer>
 </alias>

I hope that could do some help. Thanks.

Reproducible: Always
Comment 1 Kurt Hindenburg 2013-10-01 13:03:48 UTC
Thanks for the report - do you happen to have a text file w/ the chars in it?  or perhaps copy/paste in this bko.
Comment 2 Yichao Zhou 2013-12-01 15:45:01 UTC
Here is my version of this bug.

1.  Screenshot
http://i.imgur.com/MPEv3Nb.png

2.  User fontconfig
http://bpaste.net/show/154552/

3.  Example.txt in UTF-8
http://bpaste.net/show/154553/

4.  Font: monospace, which will be replace by fontconfig to Dejavu Sans Mono and Droid Sans Fallback.

In order to get it work, you need to install font "droid sans", which is packaged by most distro.
Comment 3 Yichao Zhou 2014-01-27 10:30:46 UTC
Finally, I think I workaround this bug.  In Edit Profile - Advanced - cancel the check about "Enable Bi-Directional Text rendering", and Chinese char displayed correct!

I wonder why that option is enabled by default.
Comment 4 Martin Sandsmark 2016-11-20 16:01:59 UTC
It seems like this might be because bidi disables Qt::AlignBottom?

Not sure how something like this would affect things:

diff --git a/src/TerminalDisplay.cpp b/src/TerminalDisplay.cpp
index dd91177..40b0d49 100644
--- a/src/TerminalDisplay.cpp
+++ b/src/TerminalDisplay.cpp
@@ -863,7 +863,7 @@ void TerminalDisplay::drawCharacters(QPainter& painter,
         //
         // This was discussed in: http://lists.kde.org/?t=120552223600002&r=1&w=2
         if (_bidiEnabled) {
-            painter.drawText(rect, 0, text);
+            painter.drawText(rect, Qt::AlignBottom, text);
         } else {
             // See bug 280896 for more info
             painter.drawText(rect, Qt::AlignBottom, LTR_OVERRIDE_CHAR + text);
Comment 5 Christoph Feck 2016-11-21 23:44:07 UTC
Chinese characters are not RTL, so no bidi issue.

The issue is that fonts have different pixel heights for the same point size.

For aligning the baselines, see https://git.reviewboard.kde.org/r/129281/
Comment 6 Christoph Feck 2016-12-07 19:27:45 UTC
I cannot access the screen shot from comment #0, but reading the description, it is a duplicate of bug 371687.

*** This bug has been marked as a duplicate of bug 371687 ***