From 3908a900ef2db98409fa7ad9e97df64f65c3186d Mon Sep 17 00:00:00 2001 From: Behnam Esfahbod Date: Thu, 17 Sep 2009 20:00:03 +0430 Subject: [PATCH] Add ZWNJ/ZWJ parts to nbsp group - Add 8 options for ZWNJ and ZWJ on space key to nbsp group - Use the partial layouts in af, in, ir, lk, sy --- rules/base.xml.in | 50 ++++++++++++++++++++- symbols/af | 15 ++++--- symbols/in | 5 +- symbols/ir | 26 +++++----- symbols/lk | 2 +- symbols/nbsp | 130 +++++++++++++++++++++++++++++++++++++++++++++++++--- symbols/sy | 3 +- 7 files changed, 199 insertions(+), 32 deletions(-) diff --git a/rules/base.xml.in b/rules/base.xml.in index f43e651..26850e3 100644 --- a/rules/base.xml.in +++ b/rules/base.xml.in @@ -5037,7 +5037,7 @@ - + nbsp <_description>Using space key to input non-breakable space character @@ -5090,6 +5090,54 @@ <_description>Non-breakable space character at fourth level, thin non-breakable space character at sixth level (via Ctrl+Shift) + + + + + + + + diff --git a/symbols/af b/symbols/af index 3ff8ad4..919f656 100644 --- a/symbols/af +++ b/symbols/af @@ -56,7 +56,6 @@ xkb_symbols "basic" { key { [ 0x10006af, Arabic_semicolon, 0x10006ab ] }; key { [ backslash, bar, 0x100003f ] }; - key { [ space, 0x100200c, 0x10000a0 ] }; key { [ Arabic_zah, Arabic_kaf, 0x10006d2] }; key { [ Arabic_tah, 0x1000653 , 0x1000691 ] }; @@ -68,6 +67,8 @@ xkb_symbols "basic" { key { [ Arabic_waw, greater, 0x100002c ] }; key { [ period, less, 0x10006c7 ] }; key { [ slash, Arabic_question_mark, 0x10006c9 ] }; + + include "nbsp(zwnj2nb3)" include "level3(ralt_switch)" }; @@ -126,7 +127,6 @@ xkb_symbols "ps" { key { [ 0x10006ab, Arabic_semicolon, 0x10006af ] }; key { [ backslash, 0x100002a, 0x100007c ] }; - key { [ space, 0x100200c, 0x10000a0 ] }; key { [ 0x10006cd, 0x1000638, 0x100003f] }; key { [ 0x10006d0, 0x1000637, 0x100003b ] }; @@ -138,6 +138,8 @@ xkb_symbols "ps" { key { [ Arabic_waw, 0x100060c, 0x100002c ] }; key { [ 0x1000696, 0x100002e, 0x10006c7 ] }; key { [ slash, Arabic_question_mark, 0x10006c9 ] }; + + include "nbsp(zwnj2nb3)" include "level3(ralt_switch)" }; @@ -196,7 +198,6 @@ xkb_symbols "uz" { key { [ 0x10006af, Arabic_semicolon, 0x10006ab ] }; key { [ backslash, bar, 0x100003f ] }; - key { [ space, 0x100200c, 0x10000a0 ] }; key { [ Arabic_zah, 0x10006c9, 0x10006d2] }; key { [ Arabic_tah, 0x10006c7, 0x1000691 ] }; @@ -208,6 +209,8 @@ xkb_symbols "uz" { key { [ Arabic_waw, greater, 0x100002c ] }; key { [ period, less ] }; key { [ slash, Arabic_question_mark, 0x1000655 ] }; + + include "nbsp(zwnj2nb3)" include "level3(ralt_switch)" }; @@ -256,7 +259,6 @@ xkb_symbols "olpc-ps" { key { [ 0x10006AB, 0x100061B, 0x10006AF ] }; // Arabic kaf with ring, Arabic semicolon, Arabic gaf key { [ backslash, asterisk, bar ] }; - key { [ space, 0x100200C, 0x10000A0 ] }; // zero width non-joiner, no break space key { [ 0x1000638, 0x1000626, question] }; // Arabic zah, Arabic yeh with hamza above key { [ 0x10006D0, 0x1000637, semicolon ] }; // Arabic tah, Arabic E @@ -269,6 +271,7 @@ xkb_symbols "olpc-ps" { key { [ 0x1000696, 0x100002E, 0x10006C7 ] }; // Arabic reh with dot below and dot above, full stop, Arabic letter U key { [ slash, 0x100061F, 0x10006C9 ] }; // Arabic question mark, Arabic kirghiz yu + include "nbsp(zwnj2nb3)" include "group(olpc)" }; @@ -317,7 +320,6 @@ xkb_symbols "olpc-fa" { key { [ 0x10006AF, 0x100061B, 0x10006AB ] }; // Arabic gaf, Arabic semicolon, Arabic kaf with ring key { [ backslash, bar, question ] }; - key { [ space, 0x100200C, 0x10000A0 ] }; // zero width non-joiner, no break space key { [ 0x1000638, 0x1000643, 0x10006D2 ] }; // Arabic zah, Arabic kaf, Arabic yeh barree key { [ 0x1000637, 0x1000653, 0x1000691 ] }; // Arabic tah, Arabic maddah above, Arabic rreh @@ -330,6 +332,7 @@ xkb_symbols "olpc-fa" { key { [ period, less, 0x10006C7 ] }; // Arabic u key { [ slash, 0x100061F, 0x10006C9 ] }; // Arabic question mark, Arabic kirghiz yu + include "nbsp(zwnj2nb3)" include "group(olpc)" }; @@ -378,7 +381,6 @@ xkb_symbols "olpc-uz" { key { [ 0x10006AF, 0x100061B, 0x10006AB ] }; // Arabic gaf, Arabic semicolon, Arabic kaf with ring key { [ backslash, bar, question ] }; - key { [ space, 0x100200C, 0x10000A0 ] }; // zero width non-joiner, no break space key { [ 0x1000638, 0x10006C9, 0x10006D2 ] }; // Arabic zah, Arabic kirghiz yu, Arabic yeh barree key { [ 0x1000637, 0x10006C7, 0x1000691 ] }; // Arabic tah, Arabic u, Arabic rreh @@ -391,5 +393,6 @@ xkb_symbols "olpc-uz" { key { [ period, less ] }; key { [ slash, 0x100061F, 0x1000655 ] }; // Arabic question mark, Arabic hamza below + include "nbsp(zwnj2nb3)" include "group(olpc)" }; diff --git a/symbols/in b/symbols/in index f80abfe..110caac 100644 --- a/symbols/in +++ b/symbols/in @@ -85,7 +85,7 @@ xkb_symbols "deva" { key { [ U092f, U095f, slash, question ] }; // space, space, Zero-Width-Non-Joiner (ZWNJ), Zero-Width-Joiner (ZWJ): - key { [ space, space, U200c, U200d ] }; + include "nbsp(zwnj3zwj4)"; }; //Name : Bolnagri (Combined) @@ -1261,7 +1261,8 @@ xkb_symbols "olpc" { key { [ period, U0964 ] }; // DEVANAGARI DANDA key { [ U092F, U095F ] }; // DEVANAGARI LETTER YA; DEVANAGARI LETTER YYA - key { [ space, space, U200C, U200D ] }; // ZERO-WIDTH-NON-JOINER (ZWNJ); ZERO-WIDTH-JOINER (ZWJ) + // space, space, Zero-Width-Non-Joiner (ZWNJ), Zero-Width-Joiner (ZWJ): + include "nbsp(zwnj3zwj4)"; include "group(olpc)" }; diff --git a/symbols/ir b/symbols/ir index 85f18b1..a974188 100644 --- a/symbols/ir +++ b/symbols/ir @@ -16,19 +16,25 @@ partial default alphanumeric_keys xkb_symbols "pes" { - include "ir(pes_part_basic)" - include "ir(pes_part_ext)" - name[Group1]= "Iran"; + + include "ir(pes_part_basic)"; + include "ir(pes_part_ext)"; + + include "nbsp(zwnj2nb3nnb4)"; + include "level3(ralt_switch)"; }; partial alphanumeric_keys xkb_symbols "pes_keypad" { - include "ir(pes_part_basic)" - include "ir(pes_part_keypad)" - name[Group1]= "Iran - Persian, with Persian Keypad"; + + include "ir(pes_part_basic)"; + include "ir(pes_part_keypad)"; + + include "nbsp(zwnj2nb3nnb4)"; + include "level3(ralt_switch)"; }; partial hidden alphanumeric_keys @@ -87,10 +93,6 @@ xkb_symbols "pes_part_basic" { key { [ minus, Arabic_tatweel, underscore ] }; key { [ equal, plus, 0x1002212 ] }; key { [ backslash, bar, 0x1002010 ] }; - - key { [ space, 0x100200c, nobreakspace ] }; - - include "level3(ralt_switch)" }; partial hidden alphanumeric_keys @@ -107,8 +109,6 @@ xkb_symbols "pes_part_ext" { key { [ 0x10006f8, asterisk, enfilledcircbullet, 8 ] }; key { [ 0x10006f9, parenright, 0x100200e, 9 ] }; key { [ 0x10006f0, parenleft, 0x100200f, 0 ] }; - - key { [ space, 0x100200c, nobreakspace, 0x100202F ] }; }; partial hidden alphanumeric_keys @@ -184,7 +184,6 @@ xkb_symbols "ku_ara" { // Other 3-Level symbols key { [ 0x100200d, division, asciitilde ] }; key { [ backslash, bar, ccedilla, Ccedilla ] }; - key { [ space, 0x100200c, nobreakspace ] }; // Digits key { [ 1, exclam, 0x10006f1, quoteleft ] }; @@ -236,6 +235,7 @@ xkb_symbols "ku_ara" { key { [ period, less, apostrophe ] }; key { [ slash, Arabic_question_mark, question ] }; + include "nbsp(zwnj2nb3)" include "level3(ralt_switch)" }; diff --git a/symbols/lk b/symbols/lk index 1615186..d07453b 100644 --- a/symbols/lk +++ b/symbols/lk @@ -74,7 +74,7 @@ xkb_symbols "sin_phonetic" { key { [ any, any, 0x0100200d, NoSymbol ] }; // Space - key { [ space, nobreakspace, 0x0100200c, NoSymbol ] }; + include "nbsp(zwnj2nb3s)"; include "level3(ralt_switch)" }; diff --git a/symbols/nbsp b/symbols/nbsp index 1033470..2f273be 100644 --- a/symbols/nbsp +++ b/symbols/nbsp @@ -1,7 +1,12 @@ // $XKeyboardConfig$ -// -// Let space provide nobreakspace for the desired level. +// Let Space key provide No-Break Space (NBSP), Narrow No-Break Space (NNBSP), +// Zero-Width Non-Joiner (ZWNJ), and Zero-Width Joiner (ZWJ) for the desired +// levels. + + +//////////////////////////////////////// +// Only Space partial xkb_symbols "none" { @@ -11,6 +16,10 @@ xkb_symbols "none" { }; }; + +//////////////////////////////////////// +// No-Break Space + partial xkb_symbols "level2" { key { @@ -42,22 +51,25 @@ xkb_symbols "level3s" { }; }; -// level3n provides narrow no-breaking space in addition to the normal one +// for this reason pushing no-breaking spaces to level4 is the safe default nowadays partial -xkb_symbols "level3n" { +xkb_symbols "level4" { key { type[Group1]="FOUR_LEVEL", - symbols[Group1]= [ space, space, nobreakspace, 0x100202F ] + symbols[Group1]= [ space, space, space, nobreakspace ] }; }; -// for this reason pushing no-breaking spaces to level4 is the safe default nowadays +//////////////////////////////////////// +// Narrow No-Break Space + +// level3n provides narrow no-breaking space in addition to the normal one partial -xkb_symbols "level4" { +xkb_symbols "level3n" { key { type[Group1]="FOUR_LEVEL", - symbols[Group1]= [ space, space, space, nobreakspace ] + symbols[Group1]= [ space, space, nobreakspace, 0x100202F ] }; }; @@ -81,3 +93,105 @@ xkb_symbols "level4nl" { }; }; + +//////////////////////////////////////// +// Zero-Width Non-Joiner & Zero-Width Joiner +// Author: Behnam Esfahbod + +// ZWNJ and ZWJ are widely used in Persian, Kurdinsh, Pashto, Uzbek and other +// languages that use PersoArabic script. + + +// ZWNJ on level 2 +partial +xkb_symbols "zwnj2" { + key { + type[Group1]="TWO_LEVEL", + symbols[Group1]= [ space, 0x100200c ] + }; +}; + + +// ZWNJ on level 2 +// ZWJ on level 3 +partial +xkb_symbols "zwnj2zwj3" { + key { + type[Group1]="FOUR_LEVEL", + symbols[Group1]= [ space, 0x100200c, 0x100200d ] + }; +}; + + +// ZWNJ on level 2 +// ZWJ on level 3 +// NBSP on level 4 +partial +xkb_symbols "zwnj2zwj3nb4" { + key { + type[Group1]="FOUR_LEVEL", + symbols[Group1]= [ space, 0x100200c, 0x100200d, nobreakspace ] + }; +}; + +// ZWNJ on level 2 +// NBSP on level 3 +// Used by ir(ku_ara), af(basic), af(ps), af(uz), af(olpc-fa), af(olpc-ps), af(olpc-uz) +partial +xkb_symbols "zwnj2nb3" { + key { + type[Group1]="FOUR_LEVEL", + symbols[Group1]= [ space, 0x100200c, nobreakspace ] + }; +}; + + +// ZWNJ on level 2 +// ZWJ on level 3 +// NBSP on level 4 +// Used by lk(sin_phonetic) +partial +xkb_symbols "zwnj2nb3s" { + key { + type[Group1]="FOUR_LEVEL", + symbols[Group1]= [ space, 0x100200c, nobreakspace, NoSymbol ] + }; +}; + + +// ZWNJ on level 2 +// NBSP on level 3 +// ZWJ on level 4 +partial +xkb_symbols "zwnj2nb3zwj4" { + key { + type[Group1]="FOUR_LEVEL", + symbols[Group1]= [ space, 0x100200c, nobreakspace, 0x100200d ] + }; +}; + + +// ZWNJ on level 2 +// NBSP on level 3 +// NNBSP on level 4 +// Used by ir(pes) +partial +xkb_symbols "zwnj2nb3nnb4" { + key { + type[Group1]="FOUR_LEVEL", + symbols[Group1]= [ space, 0x100200c, nobreakspace, 0x100202F ] + }; +}; + + +// ZWNJ on level 3 +// ZWJ on level 4 +// Used by in(deva), in(olpc) +partial +xkb_symbols "zwnj3zwj4" { + key { + type[Group1]="FOUR_LEVEL", + symbols[Group1]= [ space, space, 0x100200c, 0x100200d ] + }; +}; + diff --git a/symbols/sy b/symbols/sy index f9a9f42..6bdba99 100644 --- a/symbols/sy +++ b/symbols/sy @@ -54,7 +54,6 @@ xkb_symbols "syc" { key { [ 0x100071F, 0x1000323 ] }; key { [ 0x100071B, 0x1000330 ] }; - key { [ space, 0x100200c ] }; key { [ bracketright, 0x1000732, Arabic_sukun ] }; key { [ bracketleft, 0x1000735 ] }; key { [ 0x1000724, 0x1000738, 0x100200D ] }; @@ -68,6 +67,8 @@ xkb_symbols "syc" { // End Alphanumeric Section + // Space + include "nbsp(zwnj2)"; // Begin Modifier Mappings -- 1.5.6.3