[Fedora-i18n-bugs] [Bug 616277] hangul text color is not properly set in kwrite

bugzilla at redhat.com bugzilla at redhat.com
Thu Jul 22 07:00:13 UTC 2010


Please do not reply directly to this email. All additional
comments should be made in the comments box of this bug.


https://bugzilla.redhat.com/show_bug.cgi?id=616277

fujiwara <tfujiwar at redhat.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
               Flag|needinfo?(tfujiwar at redhat.c |
                   |om)                         |

--- Comment #2 from fujiwara <tfujiwar at redhat.com> 2010-07-22 03:00:12 EDT ---
I tried the old qt/kde which showed the preedit text with colors but
QApplication::x11ProcessEvent() didn't call IBusInputContext::x11FilterEvent()
so the preedit was drawn by the default colors but IBus colors.
E.g. IBus active preedit color is purple in ibus-anthy/ibus-pinyin but the old
one was black.

So actually this bus is not a regression but a feature to use inputmethod
colors.
I think revering the KDE/QT codes doesn't make sense to resolve this issue.

The previous patch fixes ibus-hangul and ibus-rawcode issue, i,e, in case the
drawing ranges are same.

But ibus-anthy and ibus-pinyin provides the different ranges.
underline is all preedit range.
purple background color is active lookup table range.

The bug is, ibus-anthy doesn't show the purple color.

I understood the KDE implementation:

kdelibs-4.3.4/kate/view/kateviewinternal.cpp:
void KateViewInternal::inputMethodEvent(QInputMethodEvent* e)
{
    int decorationColumn = 0;
    foreach (const QInputMethodEvent::Attribute &a, e->attributes()) {
      if (a.type == QInputMethodEvent::Cursor) {
      } else if (a.type == QInputMethodEvent::TextFormat) {
        QTextCharFormat f = qvariant_cast<QTextFormat>(a.value).toCharFormat();
        if (f.isValid() && decorationColumn <= a.start) {
          decorationColumn = a.start + a.length;
        }
      }
    }
}

The decorationColumn checks if the next format doesn't have the duplicated
start point a.start.

In ibus-anthy, underline is whole the preedit length and lookup table(purple
color) is one segment in preedit and the a.start is duplicated and the color
formats are ignored.

I.e. KDE doesn't support the layered colors in preedit.
If we would send the multiple KateViewInternal::inputMethodEvent(), the last
update is effective and the colors would be overrided.

The solution is that ibus-qt changes the layered colors to segment colors.
E.g. first segment is underline, purple background, black foreground.
     other segments are underline only.
So if the ranges are same, I think the formats should be consolidated to one
format.

Revised the patch:
http://github.com/fujiwarat/ibus-qt/commit/7233a42974d959069f7399c85dcc97275fcfd86e

-- 
Configure bugmail: https://bugzilla.redhat.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the i18n-bugs mailing list