Re: Static compose table in gtkimcontextsimple.c



On Tue, 2007-12-04 at 08:31 +0200, Tor Lillqvist wrote:
> > GDK_dead_circumflex, GDK_C, 0, 0, 0, 0x0108, /* LATIN_CAPITAL_LETTER_C_WITH_CIRCUMFLEX */
> > [...]
> > GDK_dead_circumflex, GDK_c, 0, 0, 0, 0x0109, /* LATIN_SMALL_LETTER_C_WITH_CIRCUMFLEX */
> > [...]
> 
> The sequences you list are exactly of the straightforward kind that in
> my opinion can and should be handled algorithmically. I.e. a "dead"
> accent followed by a letter can be mapped to the corresponding
> precomposed character without an explicit table. I have a patch in bug
> #321896 that implements such an algorithm (and which would handle your
> cases, too.) Basically it's waiting for a second opinion from the GTK+
> maintainers.

I made two small changes to the patch (now at #321896):
1. if diacritic marks belong to the same combining class, normalisation
does not reorder them, so we need to try out all permutations then
attempt to normalise again.
2. added a check if the compose sequence is overlong; otherwise one can
type up too many dead keys, and overflow the buffer.

I added a script at #321896 as well that parses UnicodeData.txt, checks
and counts all characters that can be taken care of by the algorithmic
function. They are about 1000 of them.

Simos



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]