Page 1 of 1

Reverse Text Problem

Posted: 2009-06-20 10:44:54
by tgivargis
I'm moving from classic Nisus to Nisus Pro on X. When I open up my old syriac files, the text is reversed. On classic Nisus, there was a menu item that allowed me to reverse the text. Is this feature still in Pro? If so, where's it at? Also, how can i reverse/fix my old files.

thanks!

Re: Reverse Text Problem

Posted: 2009-06-20 20:52:06
by Kino
So you are using a visual Hebrew font? Have a look at this thread:
http://www.nisus.com/forum/viewtopic.php?f=18&t=3416
It is not recommendable to continue to use that kind of fake encoded fonts in Unicode based text editing applications such as Nisus Writer Pro. As discussed in the thread, you can write a macro which translates passges in those fonts into Unicode.

However, some people still need them due to OS X’s shortcomings in handling RTL scripts, it seems. If it is the case, then, you can either [1] actually reverse the order of characters in those fonts using Mark’s macro mentioned in the thread or [2] make them look reversed by inserting some direction markers with a macro like this:

Code: Select all

# Enclose selected text(s) between 0+202E and 0+202C

$POP = Text.newWithCodepoint 0x202C
$RTL = Text.newWithCodepoint 0x202E
$doc = Document.active
if $doc == undefined
	exit 'There is no open document, exit...'
end
$sels = $doc.textSelections
if ! $sels.firstValue.length
	exit 'Nothing selected, exit...'
end
foreach $sel in reversed $sels
	$sel.text.insertAtIndex $sel.bound, $POP
	$sel.text.insertAtIndex $sel.location, $RTL
end

Re: Reverse Text Problem

Posted: 2009-06-20 20:56:38
by tgivargis
Thanks! I'm actually using a Syriac font. The fonts are MacOS 9 based TrueType fonts. Will the macro reverse the order? Also, how can i run the macro?

Thanks!

Re: Reverse Text Problem

Posted: 2009-06-20 21:23:27
by Kino
I'm actually using a Syriac font.
Ah, Syriac font? I don’t know about Syriac but if Unicode Syriac fonts are of good quality and work well in Nisus Writer Pro, you’d better write a macro for translating passages in that font into Unicode.
Will the macro reverse the order? Also, how can i run the macro?
The macro I posted here does not reverse the order of characters but just makes look them reversed like Nisus Writer Classic’s Reverse Text command. To run it, [1] use Load Macro command under Macro menu to load “MakeLookReversed” macro attached below, [2] run the macro after selecting passages in the OS 9 Syriac font by using the Find panel with Attribute Sensitive turned on or by a macro like this.
http://www2.odn.ne.jp/alt-quinon/files/ ... nt_nwm.zip
MakeLookReversed_nwm.zip
(3.98 KiB) Downloaded 507 times

Re: Reverse Text Problem

Posted: 2009-06-20 21:32:12
by tgivargis
Thanks. I should clarify: the original document was written using classic Nisus in 9. The fonts used there aren't installed on my X machine. So, I'm trying to open them up in Pro with font substitution. I'll try the methods below. Thanks!

On a side note: since Mellel works well with these fonts (http://www.redlers.com/download/tips/Wr ... syriac.pdf), how can i get Nisus Pro to work in the same fashion? In classic Nisus, we relied upon the Reverse feature.

Thanks in advanced.

Re: Reverse Text Problem

Posted: 2009-06-20 22:09:11
by Kino
To display your old documents normally in Nisus Writer Pro, you have to install the OS 9 Syriac font and reverse the order of characters actually or apparently. Syriac characters of such a font are assigned to MacRoman character codes. So you cannot transform them into Syriac by just applying a Unicode Syriac font on them. However, perhaps the installation of the OS 9 font may not solve the problem. IIRC, OS X substitutes some glyphs in TrueType fonts with those of Symbol font. In that case, try to install PS Type 1 version of the font if you have it.
how can i get Nisus Pro to work in the same fashion?
So you have already installed Unicode Syriac fonts and a keyboard layout for them? Then, if Cocoa text engine supports Syriac decently, you should be able to write Syriac in Nisus Writer Pro using those fonts and the keyboard layout. If Nisus Writer Pro does not display Syriac text normally, that is a shortcoming of OS X. You have to wait for Apple to improve the situation, hopefully in Snow Leopard, perhaps. Mellel uses its own text engine.

Re: Reverse Text Problem

Posted: 2009-06-20 22:33:06
by Kino
It seems that Cocoa text engine does not support OpenType features required by Syriac yet. There is a set of Syriac fonts which claims to work with other applications than Mellel, presumably using font features supplied by AAT (Apple Advanced Typography).
http://www.xenotypetech.com/osxSyriac.html
It is a rather pricey commercial product, though.

Re: Reverse Text Problem

Posted: 2009-06-21 09:17:51
by tgivargis
Thanks for the info. I've installed the MacOS 9 Font in X. the document opens up, but the macro's not reversing the order. i might be doing it incorrectly. i first select all, then run the macro from the macro menu. i've attached both the original classic nisus file and the mac os 9 font. i'm pulling my hair here.

Re: Reverse Text Problem

Posted: 2009-06-21 09:49:47
by Kino
Sorry, my instructions were not clear enough. You have to select text portions in those fonts excluding Returns and Page/Section Breaks. Please try...

1. Switch to PowerFind Pro mode.

2. Type [^\f]+ in the find field.

3. Apply Format > Any Attributes on [^\f]+ (which will look odd but don't worry).

4. Apply Format > Font > Edessa on it.

5. Find All (and all text portions in Edessa font will be selected).

6. Run MakeLookReversed macro.

• You can omit the steps 3 and 4 if the whole document is in those Syriac fonts.

• You can use AnyText (PowerFind bubble) instead of [^\f]+ if your document does not contain a Page/Section Break.

Re: Reverse Text Problem

Posted: 2009-06-21 11:03:04
by Kino
Probably this version of the macro would be better.

• Select text portions in OS 9 Syriac fonts and run the macro. You don't need exclude Returns and Page/Section Breaks from the selection(s).
• If the whole document is written in OS 9 Syriac fonts, run the macro with nothing selected.

Code: Select all

### Make Look Reversed ###

# Enclose selected text(s) between U+202E (Right-to-Left Override) and U+202C (Pop Directional Formatting).

# This macro works on selection. If there is no selection, the whole document will be processed.

$RTL = Text.newWithCodepoint 0x202E
$POP = Text.newWithCodepoint 0x202C

$doc = Document.active
if $doc == undefined
	exit 'There is no open document, exit...'
end

$selActive = TextSelection.active
if ! $selActive.length
	Select All Document
end

# remove existing directional markers in selections and keeping selections
Replace All in Selection '[\x{200E}\x{200F}\x{202A}-\x{202E}]+', '', 'ES'

# find all no-LF-no-break characters in selections
Find All in Selection '[^\f]+', 'E'

$sels = $doc.textSelections  # get text selections
foreach $sel in reversed $sels  # for each selection
	$sel.text.insertAtIndex $sel.bound, $POP  # put U+202C at selection end
	$sel.text.insertAtIndex $sel.location, $RTL  # put U+202E at selection start
end

### end of macro ###
MakeLookReversed_nwm.zip
(4.31 KiB) Downloaded 509 times

Re: Reverse Text Problem

Posted: 2009-06-21 22:51:29
by Ruchama
I think, that a more thorough solution should be applied here. if unicode syriac fonts do exist, the incorporation of old classic files into NWP should involve conversion of ascii codes of the letters, which should result in automatic reversing the text, and the usage of the new standard fonts. Macroing a lookalike smells like trouble to me, if text is going to be published, or exchanged with others.

creating such a switching table should not be that difficult though it will be tedious, but I think it is a one-off effort that is worthwhile.

Re: Reverse Text Problem

Posted: 2009-06-22 04:01:56
by Kino
Ruchama wrote:if unicode syriac fonts do exist,
If you have ever tried some of OpenType Syriac fonts in Nisus Writer Pro, you should have realized the meaninglessness of your suggestion. As I wrote, AAT fonts are supposed to work but only a commercial package is available so far.

Re: Reverse Text Problem

Posted: 2009-06-22 04:45:40
by Ruchama
I would appreciate an explanation here.. please, and do not be angry with my ignorance.
Indeed, I have not worked with syriac fonts, but if I understand correctly (maybe I am wrong here..) the problem is that the ascii codes of the old fonts do not "belong" to the correct language, as were many fonts from pre OSX era. Is the language not defined by OSX? or is it only NWP that incorporates old classic files without being able to identify the language in use? after all, NWP does convert other languages (like hebrew) to the newer unicode standard. why couldn't it be possible to achieve it with more languages?

please enlighten me,,
thanks

Re: Reverse Text Problem

Posted: 2009-06-22 05:37:36
by Kino
Sorry, my words were too strong.

IIRC there used to be a non-Apple Syriac Language Kit but Syriac had never been officially supported in legacy MacOS. And Apple disabled private Language Kits since MacOS 8.5 or 9.0 (I'm not sure).

So the original poster used to use visual Syriac fonts and Reverse style to write Syriac text in NW Classic.

Of course, translating Classic documents written in those fake encoded fonts into Unicode would be the best solution if Unicode Syriac fonts worked in NW Pro. Unfortunately all Syriac fonts actually available are OpenType fonts except three commercial fonts from XenoType Technologies. And Cocoa text engine does not fully support OpenType features required by Syriac fonts yet. Those OpenType fonts are said to work in Mellel but it has its own text engine.

Then, what we can do for reading or writing in Syriac in NW Pro is to [1] use U+202E and U+202C as replacement of Reverse style or [2] purchase the commercial Syriac font package.

Personally I think it would be a rather good idea to buy the AAT font package to support the very specialized font developer although I find it a bit pricey. Anyway, even if you get the font package and you decide to translate old documents into Unicode, it would be very difficult to write such a macro if you cannot see Syriac text in your old documents normally.

Thus, I think it would not be a bad idea to use U+202E and U+202C to make those Syriac texts look reversed. This method has a merit that the logical character order will remain the same. If you actually reversed the character order, the translation into Unicode would be more difficult.

Ah, I forgot to say this. There are two font technologies for implementing complicated font features (such as contextual glyph selection in Arabic fonts): AAT (Apple Advanced Technology) and OpenType. OS X's default font technology is AAT. All Apple fonts for Arabic, Hebrew, Indic langages are AAT fonts. However, OS X supports also OpenType fonts to a certain extent. Apple has improved it each time they release a major update of OS X. So, usually, you don't encounter a serious problem in using OpenType fonts for European languages. However, as far as complicated writing systems are concerned, there is still a great gap. Hopefully Snow Leopard...

Re: Reverse Text Problem

Posted: 2009-06-22 18:51:54
by Ruchama
Thanks for your detailed explanation. I think I understand well the balance of all options, and definitely understand that within all constrains, your solution is the simplest, and therefore most useful . There is one thing though, in which I do not quite agree with you. I think that the conversion bit, from the old fonts to the new ones, should be not only the little user's problem, but that Nisus people should ( and probably can be, if asked to) be involved. I know that there are many many old fonts, and people used back then in the old classic times to feel 'free' to modify fonts as they wished, and place their specific set where ever they wanted (well.. almost :) ) on the ascii table. but Mellel did do their effort to enable many of those languages to be incorporated into their word processor. Why shouldn't Nisus people do it? Basically, there is a limited number of characters so the conversion should be feasible with a limited effort. From my point of view, the question is really, whether the converted text looks acceptable with the new fonts (in whichever font ), taking into account the lousy job Apple people did in many RTL languages and fonts of "complicated writing systems". If the text looks ok, then a conversion utility should be incorporated into NWP so that NWP can continue serving the scientific community it served so well before OSX. As a loyal user of Nisus I do not like admit that Mellel did a much better job than Nisus, and deserve to be praised on that. If I were in tgivargis place, I would seriously consider using Mellel among all other solutions.

and I share your hopes for Snow, but I do not hold my breath, being disappointed with apple so many times since OSX.

thanks