sorlok / waitzar

Automatically exported from code.google.com/p/waitzar
Other
0 stars 0 forks source link

Add a way to type U+200C #90

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
From Lionslayer:

For the purpose of, e.g., search algorithms, users should be able to type a
"hidden space". The "|"s in the following sentence represent these
zero-width spaces:

ဒါေပမယ့္ 
ေဆာင္းဦး|မနက္ခင္း|ျမဴေတြ|ကို 
ျမင္|ရင္ 
ရင္|ထဲမွာ|တစ္ခုခု|လို|ေနသလို
ဝမ္းနည္းေန|မိတတ္ပါေသးတယ္။ 
အင္း ျမဴေတြ|ကို|ခ်စ္တတ္|လို့ 
ျဖစ္ေပမွာေပါ့။

Options are:
  1) Typing space types one of these. Typing space twice types a regular
space. 
  2) Typing shift+space enters one of these.

We need to figure out a good way to do this, and also a good way to show
some feedback to the user regarding where these spaces are. The last thing
we want to do is confuse them.

Original issue reported on code.google.com by seth.h...@gmail.com on 3 Dec 2009 at 11:21

GoogleCodeExporter commented 9 years ago
Note that, although WaitZar still has this problem, one can always type ZWS 
using
another Input Method. All the more reason for us to patch the behavior into WZ.

Original comment by seth.h...@gmail.com on 14 Apr 2010 at 9:21

GoogleCodeExporter commented 9 years ago
After talking with Lionslayer, I've added narrowed down how we might add this:

   1) Shift+Space is the only way to (easily) add this for 1.8, without disrupting existing typing patterns. (Note: although a "space" is LESS common than a ZWS, using the "spacebar" is MORE common than ZWS, since we use it to select words.)

  2) Lionslayer suggested adding a horizontal bar for each ZWS in the input string. I agree; something like a GREEN line with a triangle at the top & bottom facing each other, with a width of 1px. 

  3) We should shown the horizontal bar for U200D/U200C/any invisible space. We should also add a settings option "type-string-filter" (or something) which is, e.g., "\u200D\u200C", and allows the user to customize what is actually typed. This way, if the Ayar font fixes its display of U200D, we don't have to roll out a new version to allow people to type this. 

So, a bit tricky (with all the complexity of Burglish switching Tab/Space, 
etc.) But overall quite doable, and MUCH cleaner than I thought it would be 
initially.

Original comment by seth.h...@gmail.com on 20 Sep 2010 at 10:46

GoogleCodeExporter commented 9 years ago
2) done (simple green for now)
3) done

Need to add in the hotkey for WZ.

Also, I'm considering another setting:
4) dont-display-whitespace
...which won't show at all. This way, if Ayar users get tired of seeing the 
green lines, they can just filter them.
This would act in the recalculate() function, not in PulpCoreFont.

By the way, this highlighting currently does not work for TTF Fonts. But it 
shouldn't break using them (we'll test with Ayar, of course).

Original comment by seth.h...@gmail.com on 26 Sep 2010 at 8:11

GoogleCodeExporter commented 9 years ago
Minor issue; a setting which is empty ("") won't be parsed properly by 
spirit_json. Need to fix this for the general case. Otherwise, 4) is done.

Original comment by seth.h...@gmail.com on 26 Sep 2010 at 8:24

GoogleCodeExporter commented 9 years ago
Fixed "", so:
   4) Done.

For (1), we need to consider WZ's weird issue with typing letters it doesn't 
know about. I think we can set it as a "system key" (which won't be typable 
normally anyway). Then, typing should be somewhat simpler.

Original comment by seth.h...@gmail.com on 26 Sep 2010 at 2:35

GoogleCodeExporter commented 9 years ago
Fixed, see screenshot.

I used U200B for now, because it seems more appropriate. ZWS = 
zero-width-space, which is closer to the "hidden space" letter than ZWNJ.

U200C (ZWNJ) is zero-width non-joiner, which is used for causing letters that 
would NORMALLY join to instead stay separate. 

Currently, WZ filters U200B, but it is easy to remove this in the config file.

Original comment by seth.h...@gmail.com on 27 Sep 2010 at 3:31

Attachments:

GoogleCodeExporter commented 9 years ago
Added ZWS for TTF fonts, too. Now, both will look the same.
I've set all whitespace to "unmarked"; users can override this easily, and it 
might confuse new users. We'll enable this later if necessary.

(Still "Fixed"; just wanted to update the status. :D)

Original comment by seth.h...@gmail.com on 27 Sep 2010 at 8:59