Heblish
Try Heblish

Advanced
Heblish

  1. Intro
  2. Vowels
  3. NIS
  4. Text Direction
  5. Text Selection




Web Heblish
Windows Heblish

Type Hebrew like your mother tongue in minutes!

Text Direction
This section deals with a problem in all Hebrew computer support and not only with Heblish. It is somewhat complicated. Some people may wish to skip it.
Anything said below about the English language is equally applicable to other left-to-right languages.

The Problem: Text direction when combining Hebrew & English
As we all know, Hebrew is written right-to-left while Latin alphabet languages like English are written left-to-right. Since punctuation can appear in both languages, in a text which contains both English & Hebrew, it is not always clear whether the punctuation should be placed to the right of the previous character like in English or to the left like in Hebrew.
For example,
Moshe said "שלום!". Mickey said "Hi!".

Notice that the "!" appears to the right of שלום. This is incorrect. Since the exclamation point is part of the Hebrew quote, it should be to the left.

In addition to the direction of ambiguous letters, there is also the problem of the direction of words:
1.שלום, dude!
2.שלום, dude!

In the above example, the same piece of text has been typed: Shin-Lamed-Vav-Mem Sofit-,-space-d-u-d-e-! But it could be displayed two ways: the first assumes it is an English sentence with an "island" of Hebrew word. The second assumes it is a Hebrew sentence with an "island" of English.

How computers determine the direction of letters and words

Word Direction
When words of the same direction follow one another, they are placed according to the direction of their language. When combining words of languages that have difference directions, like in the example above of "Shalom, dude!", the word direction is determined by the direction of the context (context direction). If the document is written in a context of Hebrew like Hebrew Windows, the text editor usually assumes that the sentence is primarily right-to-left with a word of English inserted. If the document is written in English windows, the text editor usually assumes the direction is left-to-right with a word of English inserted. Special characters can also be explicitly inserted to specify context direction. We will discuss this shortly.

In Windows, you can also explicitly determine the context direction. By pressing:
<Ctrl>-<Shift> on right side of keyboardRight justify text and set right-to-left context direction
<Ctrl>-<Shift> on left side of keyboardLeft justify text and set left-to-right context direction

In MS Excel, the context direction is determined by the first word of the cell - if it is Hebrew, the cell's context direction is right-to-left. If it is English, the direction is left-to-right.

Letter Direction
To determine the direction of ambiguous letters like punctuation

  • Let D1 be the direction of the previous letter. If it is the first letter, then D1 is the Context Direction.
  • Let D2 be the direction of the next letter. If it is the last letter, then D2 is the Context Direction.
  1. If D1 and D2 are the same direction, then the ambiguous letter gets that direction.
    E.g. "a, b" - the comma and space are left-to-right because "a" and "b" are left-to-right.
  2. If D1 and D2 are not the same, then the ambiguous letter gets the word direction.
You should now be able to say why in the examples below, punctuation is placed where it is and word order is the way it is:
English Context:שלום, dude!
Hebrew Context:שלום, dude!
Note that MS Word seems to resolve ambiguous punctuation direction based on the keyboard in use when you typed the punctuation. For example, in MS Word:
  • A comma typed when using the English Keyboard is left-to-right.
  • A comma typed when using the Heblish Keyboard is right-to-right.

Setting Word And Letter Direction explicitly

There are three ways to explicitly control direction of text.

1. Marks: Invisible Right-to-left or Left-to-right letters that help set letter direction

To just control letter direction, one can use marks: Marks are invisible "letters" that act as either right-to-left letters or left-to-right letters. Putting a mark next to a punctuation mark can change the direction of the punctuation. For example:
No Mark:Moshe said "שלום!". Mickey said "Hi!".
  1. Notice that the exclamation point should be to the left of "שלום".
  2. Because the exclamation point is preceded by a Hebrew character and followed by English, its direction is the context direction.
  3. Since its context direction is English, it is interpreted as left-to-right. Therefore it gets placed to the right of the preceding shalom Hebrew "island".
  4. In order to change the exclamation point's direction, one can put a right-to-left mark immediately after it. Now the exclamation point is surrounded by right-to-left letters. Therefore, Its direction becomes right-to-left and it is placed correctly.
With Mark:Moshe said "שלום!‏". Mickey said "Hi!".

Web Heblish does not support marks. In Windows Heblish, to insert a mark:
  1. Put cursor between the exclamation point and the following quote.
  2. Press <Ctrl>-<Alt>-r for a right-to-left mark or <Ctrl>-<Alt>-l for a left-to-right mark.

2. Set Context direction

A second method for controlling the direction of text is to change the context direction.
In the following example:
אבי said "שלום, dude!".
  1. The overall context direction is Left-to-right.
  2. The speaker's name is in Hebrew.
  3. The quote is in Hebrew since אבי speaks Hebrew.
  4. אבי inserts an English word (as Israeli's often do!) in his Hebrew quote but the overall context direction of his quote should be Hebrew - right-to-left.
  5. The computer, though, writes the quote as though its context direction was left-to-right like the rest of the sentence. Hence, the word ordering and the direction of the exclamation point are left-to-right.
  6. In order to change this, in Windows XP/NT Windows Heblish, one can set the context direction of a piece of text.
  7. By putting the quote into a right-to-left context, it becomes:
אבי said "‫שלום, dude!‬".

To add such context direction "islands" in Windows Heblish NT+ (XP, 2000, etc.), press
<Ctrl>-<Alt>-[Left-to-right context island
<Ctrl>-<Alt>-]Right-to-left context island

When you insert an island, a placeholder text (either LToRText or RToLText)will appear. This placeholder is the island. Replace the placeholder with the text that you want to have the specified context direction. Before the placeholder there is an invisible letter which says start island and after the text, there is another invisible letter which says end island. If you want to remove the island you have to delete both these invisible letters in addition to the text.
NOTE:
To write over the inserted text, do NOT double-click on the word and then type. This will also select the invisible letters and write over them. You must put the cursor one side of the text and then drag it to the other. This will select only the visible letters. Then start typing.

3. Override letter direction

The last method for controlling text direction also only available in Windows NT+ Windows Heblish, is to create an island in which all letters are considered either Right-to-left or Left-to-right no matter what language they are in. For example:
To type hi in Hebrew, type: ש-ל-ו-ם

The sequence of letters should be from left-to-right since they are an ordered sequence of keys rather than Hebrew text here. The above example should look like this instead:
To type hi in Hebrew, type: ‭ש-ל-ו-ם

One can insert an island of text in which all letters get a certain letter direction in Windows NT+(XP, 2000, etc.). To do so in Heblish, press:
<Ctrl>-<Alt>-(Left-to-right letter island
<Ctrl>-<Alt>-)Right-to-left letter island

When an island is inserted, a placeholder text (either LToRLtrs or RToLLtrs will appear. This placeholder is the island. All letters of the text which replace the placeholder will have the specified direction. Before the placeholder there is an invisible letter which says start island and after the text, there is another invisible letter which says end island. If you want to remove the island you have to delete these invisible letters in addition to the text.
NOTE:
To write over the inserted text, do NOT double-click on the word and then type. This will also select the invisible letters and write over them. You must put the cursor one side of the text and then drag it to the other. This will select only the visible letters. Then start typing.



** Technical note (not important for those who do not understand it) **

Context Direction and Letter Direction override are features of Unicode. Marks are features of pre-Unicode. Heblish just provides a way of accessing these features. In Unicode, setting Context Direction is called "Explicit Directional Embedding" and setting Letter Direction is called "Explicit Directional Overrides".

Next >>