GNOME Bugzilla – Bug 88639
More compose sequences would be a nice thing
Last modified: 2008-03-17 23:18:56 UTC
There could be a lot more compose sequences than there are. Here's a patch that adds some vulgar fractions, superscript numbers, characters used in Esperanto, and a few random other characters that seemed like a good idea at the time. It occurs to me that we should probably follow some sort of standard for these. It also occurs to me that it is likely that no such standard exists, and we should fall back to well thought out design principles for what compose sequences should be included. It also occurs to me that these also may not as yet exist. --- gtk+-2.0.5/gtk/gtkimcontextsimple.c Wed Jun 12 11:16:36 2002 +++ gtk+-2.0.5.t/gtk/gtkimcontextsimple.c Fri Jul 19 10:24:58 2002 @@ -235,9 +235,11 @@ GDK_Multi_key, GDK_parenleft, GDK_parenleft, 0, 0, 0x005B, /* LEFT_SQUARE_BRACKET */ GDK_Multi_key, GDK_parenleft, GDK_minus, 0, 0, 0x007B, /* LEFT_CURLY_BRACKET */ GDK_Multi_key, GDK_parenleft, GDK_G, 0, 0, 0x011E, /* LATIN_CAPITAL_LETTER_G_WITH_BREVE */ + GDK_Multi_key, GDK_parenleft, GDK_U, 0, 0, 0x016C, /* LATIN_CAPITAL_LETTER_U_WITH_BREVE */ GDK_Multi_key, GDK_parenleft, GDK_c, 0, 0, 0x00A9, /* COPYRIGHT_SIGN */ GDK_Multi_key, GDK_parenleft, GDK_g, 0, 0, 0x011F, /* LATIN_SMALL_LETTER_G_WITH_BREVE */ GDK_Multi_key, GDK_parenleft, GDK_r, 0, 0, 0x00AE, /* REGISTERED_SIGN */ + GDK_Multi_key, GDK_parenleft, GDK_u, 0, 0, 0x016C, /* LATIN_SMALL_LETTER_U_WITH_BREVE */ GDK_Multi_key, GDK_parenright, GDK_parenright, 0, 0, 0x005D, /* RIGHT_SQUARE_BRACKET */ GDK_Multi_key, GDK_parenright, GDK_minus, 0, 0, 0x007D, /* RIGHT_CURLY_BRACKET */ GDK_Multi_key, GDK_asterisk, GDK_0, 0, 0, 0x00B0, /* DEGREE_SIGN */ @@ -338,24 +340,64 @@ GDK_Multi_key, GDK_0, GDK_c, 0, 0, 0x00A9, /* COPYRIGHT_SIGN */ GDK_Multi_key, GDK_0, GDK_s, 0, 0, 0x00A7, /* SECTION_SIGN */ GDK_Multi_key, GDK_0, GDK_x, 0, 0, 0x00A4, /* CURRENCY_SIGN */ + GDK_Multi_key, GDK_1, GDK_slash, 0, 0, 0x215F, /* FRACTION NUMERATOR ONE */ + GDK_Multi_key, GDK_1, GDK_2, 0, 0, 0x00BD, /* VULGAR_FRACTION_ONE_HALF */ + GDK_Multi_key, GDK_1, GDK_3, 0, 0, 0x2153, /* VULGAR_FRACTION_ONE_THIRD */ + GDK_Multi_key, GDK_1, GDK_4, 0, 0, 0x00BC, /* VULGAR_FRACTION_ONE_QUARTER */ + GDK_Multi_key, GDK_1, GDK_5, 0, 0, 0x2155, /* VULGAR_FRACTION_ONE_FIFTH */ + GDK_Multi_key, GDK_1, GDK_6, 0, 0, 0x2159, /* VULGAR_FRACTION_ONE_SIXTH */ + GDK_Multi_key, GDK_1, GDK_8, 0, 0, 0x215B, /* VULGAR_FRACTION_ONE_EIGHTH */ GDK_Multi_key, GDK_1, GDK_S, 0, 0, 0x00B9, /* SUPERSCRIPT_ONE */ GDK_Multi_key, GDK_1, GDK_asciicircum, 0, 0, 0x00B9, /* SUPERSCRIPT_ONE */ GDK_Multi_key, GDK_1, GDK_s, 0, 0, 0x00B9, /* SUPERSCRIPT_ONE */ + GDK_Multi_key, GDK_2, GDK_3, 0, 0, 0x2154, /* VULGAR FRACTION TWO THIRDS */ + GDK_Multi_key, GDK_2, GDK_5, 0, 0, 0x2156, /* VULGAR FRACTION TWO FIFTHS */ GDK_Multi_key, GDK_2, GDK_S, 0, 0, 0x00B2, /* SUPERSCRIPT_TWO */ GDK_Multi_key, GDK_2, GDK_asciicircum, 0, 0, 0x00B2, /* SUPERSCRIPT_TWO */ GDK_Multi_key, GDK_2, GDK_s, 0, 0, 0x00B2, /* SUPERSCRIPT_TWO */ + GDK_Multi_key, GDK_3, GDK_4, 0, 0, 0x00BE, /* VULGAR FRACTION THREE QUARTERS */ + GDK_Multi_key, GDK_3, GDK_5, 0, 0, 0x2157, /* VULGAR FRACTION THREE FIFTHS */ + GDK_Multi_key, GDK_3, GDK_8, 0, 0, 0x215C, /* VULGAR FRACTION THREE EIGHTHS */ GDK_Multi_key, GDK_3, GDK_S, 0, 0, 0x00B3, /* SUPERSCRIPT_THREE */ GDK_Multi_key, GDK_3, GDK_asciicircum, 0, 0, 0x00B3, /* SUPERSCRIPT_THREE */ GDK_Multi_key, GDK_3, GDK_s, 0, 0, 0x00B3, /* SUPERSCRIPT_THREE */ + GDK_Multi_key, GDK_4, GDK_5, 0, 0, 0x2158, /* VULGAR FRACTION FOUR FIFTHS */ + GDK_Multi_key, GDK_4, GDK_S, 0, 0, 0x2074, /* SUPERSCRIPT_FOUR */ + GDK_Multi_key, GDK_4, GDK_asciicircum, 0, 0, 0x2074, /* SUPERSCRIPT_FOUR */ + GDK_Multi_key, GDK_4, GDK_s, 0, 0, 0x2074, /* SUPERSCRIPT_FOUR */ + GDK_Multi_key, GDK_5, GDK_6, 0, 0, 0x215A, /* VULGAR FRACTION FIVE SIXTHS */ + GDK_Multi_key, GDK_5, GDK_8, 0, 0, 0x215D, /* VULGAR FRACTION FIVE EIGHTHS */ + GDK_Multi_key, GDK_5, GDK_S, 0, 0, 0x2075, /* SUPERSCRIPT_FIVE */ + GDK_Multi_key, GDK_5, GDK_asciicircum, 0, 0, 0x2075, /* SUPERSCRIPT_FIVE */ + GDK_Multi_key, GDK_5, GDK_s, 0, 0, 0x2076, /* SUPERSCRIPT_FIVE */ + GDK_Multi_key, GDK_6, GDK_S, 0, 0, 0x2076, /* SUPERSCRIPT_SIX */ + GDK_Multi_key, GDK_6, GDK_asciicircum, 0, 0, 0x2076, /* SUPERSCRIPT_SIX */ + GDK_Multi_key, GDK_6, GDK_s, 0, 0, 0x2076, /* SUPERSCRIPT_SIX */ + GDK_Multi_key, GDK_7, GDK_8, 0, 0, 0x215E, /* VULGAR FRACTION SEVEN EIGHTHS */ + GDK_Multi_key, GDK_7, GDK_S, 0, 0, 0x2077, /* SUPERSCRIPT_SEVEN */ + GDK_Multi_key, GDK_7, GDK_asciicircum, 0, 0, 0x2077, /* SUPERSCRIPT_SEVEN */ + GDK_Multi_key, GDK_7, GDK_s, 0, 0, 0x2077, /* SUPERSCRIPT_SEVEN */ + GDK_Multi_key, GDK_8, GDK_8, 0, 0, 0x221E, /* INFINITY */ + GDK_Multi_key, GDK_8, GDK_S, 0, 0, 0x2078, /* SUPERSCRIPT_EIGHT */ + GDK_Multi_key, GDK_8, GDK_asciicircum, 0, 0, 0x2078, /* SUPERSCRIPT_EIGHT */ + GDK_Multi_key, GDK_8, GDK_s, 0, 0, 0x2078, /* SUPERSCRIPT_EIGHT */ + GDK_Multi_key, GDK_9, GDK_S, 0, 0, 0x2079, /* SUPERSCRIPT_NINE */ + GDK_Multi_key, GDK_9, GDK_asciicircum, 0, 0, 0x2079, /* SUPERSCRIPT_NINE */ + GDK_Multi_key, GDK_9, GDK_s, 0, 0, 0x2079, /* SUPERSCRIPT_NINE */ + GDK_Multi_key, GDK_colon, GDK_parenleft, 0, 0, 0x2639, /* WHITE_FROWNING_FACE */ + GDK_Multi_key, GDK_colon, GDK_parenright, 0, 0, 0x263A, /* WHITE_SMILING_FACE */ GDK_Multi_key, GDK_colon, GDK_minus, 0, 0, 0x00F7, /* DIVISION_SIGN */ GDK_Multi_key, GDK_less, GDK_slash, 0, 0, 0x005C, /* REVERSE_SOLIDUS */ GDK_Multi_key, GDK_less, GDK_less, 0, 0, 0x00AB, /* LEFTxPOINTING_DOUBLE_ANGLE_QUOTATION_MARK */ + GDK_Multi_key, GDK_less, GDK_equal, 0, 0, 0x2264, /* LESS-THAN_OR_EQUAL_TO */ GDK_Multi_key, GDK_less, GDK_C, 0, 0, 0x010C, /* LATIN_CAPITAL_LETTER_C_WITH_CARON */ GDK_Multi_key, GDK_less, GDK_S, 0, 0, 0x0160, /* LATIN_CAPITAL_LETTER_S_WITH_CARON */ GDK_Multi_key, GDK_less, GDK_Z, 0, 0, 0x017D, /* LATIN_CAPITAL_LETTER_Z_WITH_CARON */ GDK_Multi_key, GDK_less, GDK_c, 0, 0, 0x010D, /* LATIN_SMALL_LETTER_C_WITH_CARON */ GDK_Multi_key, GDK_less, GDK_s, 0, 0, 0x0161, /* LATIN_SMALL_LETTER_S_WITH_CARON */ GDK_Multi_key, GDK_less, GDK_z, 0, 0, 0x017E, /* LATIN_SMALL_LETTER_Z_WITH_CARON */ + GDK_Multi_key, GDK_equal, GDK_less, 0, 0, 0x2264, /* LESS-THAN_OR_EQUAL_TO */ + GDK_Multi_key, GDK_equal, GDK_greater, 0, 0, 0x2265, /* GREATER-THAN_OR_EQUAL_TO */ GDK_Multi_key, GDK_equal, GDK_C, 0, 0, 0x20AC, /* EURO_SIGN */ GDK_Multi_key, GDK_equal, GDK_L, 0, 0, 0x00A3, /* POUND_SIGN */ GDK_Multi_key, GDK_equal, GDK_Y, 0, 0, 0x00A5, /* YEN_SIGN */ @@ -363,6 +405,7 @@ GDK_Multi_key, GDK_equal, GDK_l, 0, 0, 0x00A3, /* POUND_SIGN */ GDK_Multi_key, GDK_equal, GDK_y, 0, 0, 0x00A5, /* YEN_SIGN */ GDK_Multi_key, GDK_greater, GDK_space, 0, 0, 0x005E, /* CIRCUMFLEX_ACCENT */ + GDK_Multi_key, GDK_greater, GDK_equal, 0, 0, 0x2265, /* GREATER-THAN_OR_EQUAL_TO */ GDK_Multi_key, GDK_greater, GDK_greater, 0, 0, 0x00BB, /* RIGHTxPOINTING_DOUBLE_ANGLE_QUOTATION_MARK */ GDK_Multi_key, GDK_greater, GDK_A, 0, 0, 0x00C2, /* LATIN_CAPITAL_LETTER_A_WITH_CIRCUMFLEX */ GDK_Multi_key, GDK_greater, GDK_E, 0, 0, 0x00CA, /* LATIN_CAPITAL_LETTER_E_WITH_CIRCUMFLEX */ @@ -397,6 +440,7 @@ GDK_Multi_key, GDK_C, GDK_less, 0, 0, 0x010C, /* LATIN_CAPITAL_LETTER_C_WITH_CARON */ GDK_Multi_key, GDK_C, GDK_equal, 0, 0, 0x20AC, /* EURO_SIGN */ GDK_Multi_key, GDK_C, GDK_O, 0, 0, 0x00A9, /* COPYRIGHT_SIGN */ + GDK_Multi_key, GDK_C, GDK_asciicircum, 0, 0, 0x0108, /* LATIN_CAPITAL_LETTER_C_WITH_CIRCUMFLEX */ GDK_Multi_key, GDK_C, GDK_o, 0, 0, 0x00A9, /* COPYRIGHT_SIGN */ GDK_Multi_key, GDK_C, GDK_bar, 0, 0, 0x00A2, /* CENT_SIGN */ GDK_Multi_key, GDK_D, GDK_minus, 0, 0, 0x0110, /* LATIN_CAPITAL_LETTER_D_WITH_STROKE */ @@ -417,7 +461,9 @@ GDK_Multi_key, GDK_G, GDK_comma, 0, 0, 0x0122, /* LATIN_CAPITAL_LETTER_G_WITH_CEDILLA */ GDK_Multi_key, GDK_G, GDK_period, 0, 0, 0x012
*** Bug 88641 has been marked as a duplicate of this bug. ***
*** Bug 88642 has been marked as a duplicate of this bug. ***
*** Bug 88643 has been marked as a duplicate of this bug. ***
*** Bug 88644 has been marked as a duplicate of this bug. ***
*** Bug 88647 has been marked as a duplicate of this bug. ***
*** Bug 88648 has been marked as a duplicate of this bug. ***
*** Bug 88652 has been marked as a duplicate of this bug. ***
*** Bug 88653 has been marked as a duplicate of this bug. ***
*** Bug 88656 has been marked as a duplicate of this bug. ***
I have some worries about this table growing without end...
Created attachment 10744 [details] [review] Provides compose sequence support for a large number of characters, including all but one character of the Unicode Latin Extended A range.
I'm basically OK with this, though I don't want to put this in right before 2.4.0. It might be better to actually generate the table Generating rules + list of exceptions and additions. from a script or tool of some sort. That is the generating rules would be like: GDK_Multi_key + GDK_acute + letter = <composed form of LETTER + ACUTE> though that could get complicated... (a tool would have the advantage of being able to automate the ordering as well; with manually maintained list, we run the risk that any mistake in ordering will result in hard-to-detect rare strange behavior.)
Comment on attachment 10744 [details] [review] Provides compose sequence support for a large number of characters, including all but one character of the Unicode Latin Extended A range. Marking this commit-after-freeze based on the comment; Owen, kick me if that's the wrong thing.
I would like to customize the compose table. (Per user or at least system wide.) What about reading the entire table from a file? There could be one file location for the packaged table, one for system-wide customization and one for user customization. (In the simplest case, one of the later files will always completely replace tables of the former.) For example there could be $prefix/share/gtk/compose, /etc/gtk/compose, and ~/.gtk-compose. (Note that there is /usr/X11R6/lib/X11/locale/compose.dir et al, which is not to be considered a complete or superior table, but at least it can be customized in some crude way. Also compare ~/.uim which uses something like scheme to tweak key bindings and IM behaviour. I played a lot with /usr/share/uim/latin.scm before I read from the source that it doesn't have any effect.) Please maintain a good default table, but I think we will need customization anyway. (For example Multi_key + o + k = ✓ U+2713 CHECK MARK)
This patch (attachment 10744 [details] [review]) does not apply to CVS anymore. Alexandre, can you come up with a new patch ? Thanks !
I don't think that a new version of the patch makes sense, at least until we know what we are doing here. There is another patch that makes this customizable, but I'm in general, not all that enthused about extending the GtkIMContext mechanisms.... I think mostly we should be working through desktop wide input method frameworks like IIIMF or Windows IME.
Here is a patch which replaces the compose table in Gtk+ with the table taken from libX11-1.1.1 (excluding characters above U+FFFF which are not supported by UIM). It includes a script to regenerate it. http://cvs.pld-linux.org/cgi-bin/cvsweb/SOURCES/gtk+2-compose-table.patch.bz2 Although the new table doesn't include e.g. [o/ → ø], leaving only [/o → ø], it's richer in other areas, e.g. [<" → “], [>" → ”], [," → „]. Some diacritics have been disunified: , = cedilla, ; = ogonek. The diacritic is always before the base letter, which leaves room for letter keys to denote some diacritics, e.g. o = ring above. I propose to let Gtk+ use the same table as X11 by default, to avoid user confusion. Further improvements should be done in both sources.
I agree that X11 and GTK compose sequences should be harmonized somehow, to not confuse users. What is happening with this issue? Is there some discussion elsewhere? Any GTK design specifications that addresses this issue?
Any news whether there's any work regarding this? I'd like to be able to simply write Esperanto with Gtk+. Thank you.
*** This bug has been marked as a duplicate of 321896 ***