Hebrew letters and numbers

Everything related to our flagship word processor.
Post Reply
Ninurta
Posts: 19
Joined: 2007-07-19 10:00:10
Location: Germany

Hebrew letters and numbers

Post by Ninurta »

There is still a problem when mixing hebrew and english text: If I type a hebrew word immediately followed by a number (or a punctuation mark) the order of hebrew words and numbers changes. Nothing happens when typing normal (english) letters after hebrew letters. There is a paragraph in the manual but THIS problem will not be solved.
rmark
Official Nisus Person
Posts: 428
Joined: 2003-02-11 10:49:05
Location: Solana Beach, CA
Contact:

Re: Hebrew letters and numbers

Post by rmark »

Ninurta,

I'm sorry you experience difficulties with Nisus Writer Pro.

Please send a file where the problem appears (It can be no more than the few lins of text where you experience the problem) to <support@nisus.com>. We'll take a close look at it and see what we can do.
Write On!
Mark Hurvitz
Nisus Software Inc.
ProfT
Posts: 91
Joined: 2005-03-09 06:53:40
Location: La Mirada, CA

Re: Hebrew letters and numbers

Post by ProfT »

I looked at this problem and reported it before back under NWE and found that it also occurs in Text Edit which would indicate that it is in Apple's text engine. The solution many of us have used is to insert a extra character and change the character color to white in order to allow printed texts to come out correctly. It's an extremely inelegant solution, but one which does in a pinch.

If this could be fixed, it would be great!

Prof T
karinac
Posts: 6
Joined: 2005-10-31 02:43:57

Re: Hebrew letters and numbers

Post by karinac »

Thanks a bunch for this (truely unelegant...) problem-saver, Prof T!
I was going crazy, trying to get parentheses to work (at the beginning and end of) hebrew frases in an otherwise left-to-right text before I found your fix.

Martin:
Should I post a seperate bug-question to your support to get you people to look into these kind of questions (problems with mixing LR-RL-languages) more closely ;-) ?

/karinac
Kino
Posts: 400
Joined: 2008-05-17 04:02:32

Re: Hebrew letters and numbers

Post by Kino »

You can use this macro to force set the directionality of selected text(s) to R to L.

Code: Select all

### Force Right to Left ###

# Enclose selected text(s) between U+202E (RIGHT-TO-LEFT OVERRIDE)
# and U+202C (POP DIRECTIONAL FORMATTING) so that they will display
# in the right to left direction.

# ATTENTION: Although they are defined as zero-width invisible
# characters, they are visible in some wrongly designed fonts.

Require Application Version '3.1'
$RLO = Cast to String "\x{202E}"
$PDL = Cast to String "\x{202C}"
$doc = Document.active
if $doc == undefined  # if there is no open document
   Exit # exit silently
elsif ! $doc.textSelection.length  # if there is just a caret
   Exit 'No selection, exit...'
end

$selections = $doc.textSelections
foreach $sel in reversed $selections
   $sel.text.insertAtIndex $sel.bound, $PDL
   $sel.text.insertAtIndex $sel.location, $RLO
end

### end of macro ###
You may need to get rid of them in a future, for example, to edit text enclosed by them conveniently. Use the following to remove them and other directional markers.

Code: Select all

### Remove Directional Markers ###

# Remove Direction Markers from selected text(s). If there is
# no selection, the whole document will be processed.

# Here are characters to be removed:
#  U+200E LEFT-TO-RIGHT MARK
#  U+200F RIGHT-TO-LEFT MARK
#  U+202A LEFT-TO-RIGHT EMBEDDING
#  U+202B RIGHT-TO-LEFT EMBEDDING
#  U+202C POP DIRECTIONAL FORMATTING
#  U+202D LEFT-TO-RIGHT OVERRIDE
#  U+202E RIGHT-TO-LEFT OVERRIDE

Require Application Version '3.1'
$doc = Document.active
if $doc == undefined  # if there is no open document
   Exit # exit silently
elsif ! $doc.textSelection.length  # if there is just a caret
   Select All Document
end

Replace All '[\x{200E}\x{200F}\x{202A}-\x{202E}]+', '', 'Es'

### end of macro ###
formatted macro files:
http://www2.odn.ne.jp/alt-quinon/files/ ... ft_nwm.zip
http://www2.odn.ne.jp/alt-quinon/files/ ... ks_nwm.zip
karinac
Posts: 6
Joined: 2005-10-31 02:43:57

Re: Hebrew letters and numbers

Post by karinac »

Kino, I can't thank you enough!
This is not the first time your help has been invaluable.
Thank you!!!

/karinac
ProfT
Posts: 91
Joined: 2005-03-09 06:53:40
Location: La Mirada, CA

Re: Hebrew letters and numbers

Post by ProfT »

Just since these posts were first made, I've been experiencing this problem regularly. I have found an alternative solution that has been working very well for me. I've outlined it below.

After typing some Hebrew text in a mixed language document:
1. Return the language selection to English
2. Via the Insert Menu > Directionality Marker, select Left to Right Marker
3. Type English text as normal.

This has consistently allowed me to enter numbers, punctuation, and most important for my recent work, footnote reference numbers without the usual shifting of the text that has been described in this thread. I've created a menu key for it so that I can enter it each time after I switch back from Hebrew to English. I had assumed that the change in language would have already "inserted" a directionality marker, but it appears that there is something different in the process between what happens automatically by changing languages and what happens when manually inserting the marker. Perhaps this is a clue towards a programmed solution. Anyway, I found this more useful as I am not that proficient in the use of macros and wanted a solution that was a part of my typing process. So far, I've not encountered any instances where this solution was not effective.

Hopefully this might help others as well.

EDIT: I did note after looking at the original post that this also works for parentheses, however, the final parenthesis needs to be typed after the language switch has been made to English. Then use the directionality marker to ensure that if say a number follows the parenthesis the text will not switch.
Post Reply