[Konsole-devel] [Bug 156071] Thai Support for Konsole

Jakkapun Kwanroengjai glooffy23 at gmail.com
Fri Jan 18 12:50:28 UTC 2008


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=156071         




------- Additional Comments From glooffy23 gmail com  2008-01-18 13:50 -------
> +void TerminalDisplay::drawCharSequence(   QPainter& painter,const QRect& rect, const QString& str,
> +                                    const Character* attributes)
> +{
> +    painter.drawText(rect,str[0]);
> +    Qt::BGMode bgMode = painter.backgroundMode();
> +    painter.setBackgroundMode(Qt::TransparentMode);
> +    for (int i = 1; i < str.length(); i++)
> +        painter.drawText(rect,str[i]);
> +    painter.setBackgroundMode(bgMode);
> +}

> Character-by-character text drawing is very slow.  Complete strings should be drawn if at all possible.  What is the background mode change here for? 

The problem is that, for this kind of font (pure monospace), drawing the whole string using QPainter::DrawText() would yield incorrect output -- combining characters will be in different cells, hence not combined. We set the background mode to transparent to that the to-be-combined upper or lower vowles will be drawn on top of the previous character (i.e. "combine" them).
 Or should we fix QPainter::DrawText() to detect this kind of font and draw string accordingly instead?  but i imagine that won't be too easy (as it could affect a lot of things...)
Advise welcomed.



More information about the konsole-devel mailing list