— For users of special diacritical fonts —
Introduction
Now that we have Nisus Writer Express for OS X (currently, as of May 2003, we have still only a public beta version), the "dreamt" transition from Classic OS to OS X environment seems to become possible for users of Classic Nisus Writer. Unfortunately, the transition is not so easy, especially for people who had to use special diacritical fonts for transliteration of Asian (or other) languages such as Sanskrit, who write multilingual documents (using for example Japanese, Chinese, Korean, English, French, etc.), who use many footnotes, etc., in short, researchers in the field of Asian studies.The first version of Nisus Writer Express (hereafter, NW-Ex) is not a full featured word-processor. Jerzy Lewak, CEO Nisus Software, wrote himself, to the members of the Nisus mailing list:
This first version, the Express version, is being released without many of the features, present in Nisus Writer 6.5 because of popular demand that something be released quickly....One of the most important things lacking in NW-Ex is the footnotes. As to graphics, it is only possible to import external graphic files in NW-Ex documents. Layout capabilities are very basic also. It would be perhaps better to wait for a more featured version of Nisus Writer for OS X. However, there may be impatient users who would like to use the new version already at this stage (for example myself...!). I investigated how it would be possible to make this transition as smooth and as easy as possible.
1. Some Basic Facts to Know...
Before dealing with the actual steps that we should take, it seems good to let the users know some basic differences between Classic OS and OS X.
- Fonts: Every Classic OS TrueType font can produce Regular, Bold, Italic and Bold-Italic typefaces; in OS X, each typeface seems to require a kind of "sub-font". For example, Times has all the four typefaces, but Monaco has only Regular typeface. More importantly for us, some of the diacritical fonts commonly used for the transliteration of Asian languages, such as MyTimes, NormanSk have only Regular typeface (as well as ITimesSkRom). On the other hand, the same can be said about some of the Unicode fonts supporting diacritical characters for transliteration of Asian languages. For example Lucida Grande has only Regular and Bold typefaces; Gentium has only Regular and Italic... One of the few Unicode fonts having all the four typefaces is Thryomanes -- which can be highly recommended.
On the other hand, for CJK fonts, the typefaces Bold, Italic and Bold-Italic seem to have no equivalent in OS X. First, there is no Italic typeface at all in CJK fonts. As to Bold typeface, there are two kinds of things that I may call substitutes. One is the "weight" of typeface: for Hiragino Mincho Pro, we have two typefaces, one "W3", which is "lighter", the other "W6", "heavier" one. Another "susbtitute" is simply the use of a different font. In Classic OS, you can have Osaka Regular and Osaka Bold; in OS X, you may use for example Hiragino Kaku Gothic Pro as substitute of Osaka Regular, and Hiragino Maru Gothic Pro as substitute of Osaka Bold. -- But of course, this depends on your personal preferences. Anyway, I will not cover here this problem (it is possible to change the font settings in raw rtf data, but this would become too complicated).
- Font names: In OS X Unicode savvy applications (such as TextEdit and NW-Ex), we have access to all the fonts that were available in Classic OS, plus Unicode fonts which are available only in these applications. But the name of some fonts are different. For example, Japanese PostScript font named 細明朝体 in Classic OS is named SaiMincho in OS X. In the same way, all the font names which were written in non ASCII characters in Classic OS are renamed in OS X, with names written in only ASCII characters. As to most common Japanese fonts, only Osaka has the same name in both Classic OS and OS X. These differences are not recognized by NW-Ex when it attempts to open Classic Nisus Writer files...
- Unicode files and rtf files: In Classic OS, the notion of TEXT file was not totally incompatible with that of multilingual text and styled text. Texts of different languages -- or rather, scripts, were written with fonts of different scripts, e.g. Times for Roman languages, Osaka for Japanese, Taipei for Traditional Chinese, etc. Some kinds of text files could contain information about different fonts used in them, as well as basic styles such as Italic, Bold, etc. For example, files created by TeachText and SimpleText were of this kind; Tex-Edit Plus and JEdit also created this kind of files (and they continue to do the same in their OS X versions); and more importantly for us, files created by Nisus Writer were at the same time pure TEXT files and fully styled text files. This was possible because of the special file format of Classic OS, which had two "forks". Data fork contained all the TEXT data, while resource fork could contain style data. Thanks to this mechanism, we could use search programs like MgrepApp or perl scripts to search words in these files without any problem. This was also very good for data exchange.
In OS X, unfortunately, this mechanism no longer works (with the "package" mechanism, it should be possible to do something similar, but neither NW-Ex nor TextEdit adopted such strategy...). For multilingual documents, we have only two options: one is Unicode files, which are pure TEXT files without any style information, and the other is rtf files which contains only styled data. It is practically impossible to search in rtf files with search utilities like MgrepApp or perl scripts. My conclusion, for now, is that we should always make at least two kinds of files for each document: one in pure Unicode text, and the other in formatted rtf files. We should probably consider if it would not be better to make some kind of marked up files (using something like the xml markup). Unicode text files will be used for searching and data exchange. RTF files are to be printed, and presenting. We would have also marked up files, which would be easily converted either in pure Unicode texts or rtf files, or any other format of text, e.g. html text or TeX text. In this page, I will only consider the problms related to the conversion of Classic Nisus files into NW-Ex rtf files and pure Unicode files. But please bear in mind that in the future, we should probably consider the possibility of marking up files. And this would be done most easily within Classic Nisus Writer.
Case study 1. Simple File without Notes, Written in a Single Diacritical Font
Hereafter, I will consider some typical cases.The first case will be that of a simple file without notes, written in a single diacritical fonts.
In this case, you will:
- Open the file in question in Classic Nisus Writer; run one of the macros in the macro file "font<->HTML_Entities macros" which will convert all the diacritical characters in your file to HTML entities. For example, if the font used in your file is Appeal, you will run the macro "Appeal2htmlEntity"; if it is Minion-Indologist, you will run the macro "Minion-Indologist2htmlEntity". If there is no macro for your font, you will have to make one; for this, please refer to my page East Asian Diacritical Fonts and Unicode. If you have difficulties to do it, please write me; I may be able to help you.
Explanation: As you will be able to see it yourself, the macro <font_name>2htmlEntity convert all the diacritical characters into their html entity equivalents. For example, "é" will be converted to é, and "ō" will be converted to ō. The signs "&" and ";" enclose what is called html entity; and here the entities are "#" sign and Unicode decimal numbers.For now, the macro file "font<->HTML_Entities macros" contains macros for the following eleven fonts:
- Appeal
- BharatiTimes
- Hobogirin
- ITimesSkRom
- Minion-Indologist
- MyTimes
- NormanSk
- Normyn
- SanskritTimes
- TimesCSXPlus
- Times_Norman
- Select all the text, and change the font to one of the fonts which have Bold, Italic, Bold-Italic typefaces in OS X -- for example, Times may be a good choice.
- Do a "Save As..." this changed file.
Now, you will have to work with NW-Ex.
- Open the newly saved file in NW-Ex. You will see that most of the style information is preserved in NW-Ex: Italic, Bold, Bold-Italic, ruler setting, etc. Now, select all, and change the font to some Unicode font, containing the diacritical characters that you need: Thryomanes can be a good choice.
- Now, run the macro named "htmlEntity2RTFUnicode". You will see a new window, in which all the diacritical characters will be restored to their original form.
Explanation: The Perl macro "htmlEntity2RTFUnicode" works on the raw rtf data. In rtf data, Unicode characters are rendered by the command "\uunicode_decimal_number ?" -- so we simply find occurrences of sequences "&#decimal_number;", and replace the sign "&#" with "\u" and the sign ";" with " ?".- This is the converted rtf file. Save this file as a rtf file doing a "Save As..."
Now, you will work with TextEdit (because for the moment, NW-Ex's "Save As..." Unicode file is not implemented correctly):
- Open the newly converted rtf file with TextEdit.
- Choose "Make Plain Text" in "Format" menu (Command + Shift + T).
- Do a "Save As..." and choose UTF-16, or UTF-8 as encoding. This is the Unicode text file.
Now, if you want, you can work on this new Unicode text file to mark up the text, etc. (but since Unicode text file cannot have any style, it would be more convinient to work on the Classic Nisus file to mark up the text...).
Case Study 2. Multilingual File with Fonts of Different Scripts and Diacritical Font(s)
Although at first glance, this case may seem much more difficult, it is not so different from the first case. Here are the steps to be taken:First, you prepare a file in Classic Nisus Writer:
- Open the file in question in Classic Nisus Writer; run one of the macros in the macro file "font<->HTML_Entities macros" which will convert all the diacritical characters in your file to HTML entities (see above).
- If you have Japanese text written in one of the fonts having names in Kanji (for example 細明朝体 or 平成明朝, etc.), select all the text, and change the font to Osaka (it is the only font which has the same name in Classic OS and OS X [see above]). I think you have to do the same thing with Korean text, but as I cannot read hangul, I am unable to give any font name here...
- Select all the text, and change the font to one of the fonts which have Bold, Italic, Bold-Italic typefaces in OS X -- for example, Times may be a good choice (note that this will not affect text written in a different script font, for example a Japanese font).
- Do a "Save As..." this changed file.
After this, you can take exactly the same steps as in the case 1. Of course, while working in NW-Ex, you can change the font of Japanese text from Osaka to some other font, for example one of the Hiragino family fonts which has a more beatiful shape.
Case Study 3. File with Footnotes/Endnotes
As NW-Ex does not (yet?) support footnotes/endnotes, it is impossible to import simply Classic Nisus Writer files with footnotes/endnotes. For these files, you would perhaps better wait for a later version of NW-Ex. But in fact, it is already possible to work with notes within NW-Ex, if you don't mean them to be "footnotes/endnotes" in ordinary sense.There are reasons for which I would even recommend the use of these "non-ordinary" notes. First, footnotes/endnotes in Classic Nisus files are stored not in the data fork, but in the resource fork, so that when your publisher asks you to send the text file of your work, the notes will not be included. On the other hand, when you write footnotes, you are in a different window than the main text window, so it is difficult to refer to the main text. It seems impossible to include footnotes/endnotes in your index. Finally, you cannot search in your footnotes/endnotes with search utilities like MgrepApp...
The system I would propose here is the following. You write your notes in the main text itself, enclosing them in a special pair of tags. The tags are "<fn>" and "</fn>". Your text would look like:
My_main_text my_main_text my_main_text<fn>My_note1</fn> my_main_text
my_main_text<fn>My_note2</fn> my_main_text my_main_text my_main_text...When you have finished writing your document, andhave done all the editing work, you will run a macro, which will send your notes at the end of the document, and add to them the corresponding note numbers, in the main text and at the beginning of each note. The document would look like...:
My_main_text my_main_text my_main_text (n. 1) my_main_text
my_main_text (n. 2) my_main_text my_main_text my_main_text...
<End of the main text>Notes:
(n. 1) My_note1
(n. 2) My_note2
...
Of course, this method has some drawbacks. First, with this method, you can make endnotes, but not footnotes. Another problem is that if you want to add or remove notes after you have put them at the end of the main text, you will have to insert them at the wanted places, and renomber the notes yourself (you can use a macro to do that work, but the renombering is not fully automatic).
I wrote a macro file for Classic Nisus Writer containing all kinds of converting macros for footnotes: with it, you can convert footnotes to "fn_tag" notes or "text end-notes" or vice-versa in three ways. If you have files with footnotes, and you want to use NW-Ex to edit these files, I would recommend you to use the macro named "Footnotes->TextEndNote" to convert your footnotes into "text end-notes" before opening them with NW-Ex.
I wrote also two Perl macros for NW-Ex which converts "fn_tag" notes into "text end-notes", and vice-versa, and some other macros. And Kino-san wrote a Perl macro that colors "fn-tag" notes in blue, so that it would be easier to distinguish from the main text; and he kindly allowed me to distribute his macro in this page.
So, here are the steps that you would take to import your Classic Nisus file with footnotes into NW-Ex.
First, you prepare a file in Classic Nisus Writer:
- Open the file in question in Classic Nisus Writer; run one of the macros in the macro file "font<->HTML_Entities macros" which will convert all the diacritical characters in your file to HTML entities (see above). Open the Footnotes/Endnotes window, and run the same macro.
- If you have Japanese text written in one of the fonts having names in Kanji (for example 細明朝体 or 平成明朝, etc., select all the text, and change the font to Osaka (it is the only font which has the same name in Classic OS and OS X [see above]). Do the same in the Footnotes/Endnotes window.
- Select all the text, and change the font to one of the fonts which have Bold, Italic, Bold-Italic typefaces in OS X -- for example, Times may be a good choice (note that this will not affect text written in a different script font, for example a Japanese font). -- Do the same in Footnotes/Endnotes window.
- Run the macro "Footnotes->TextEndNote" in the macro file NoteMacros, so that all your footnotes/endnotes become "Text end-notes".
- Do a "Save As..." this changed file.
When you have done this work, the rest is the same as the case 2 above. You can open the file with NW-Ex, change the font to Thryomanes (for example), run the macro "htmlEntity2RTFUnicode", and change the Japanese font to some other font. When this file is saved as rtf file, you will be able to open it with TextEdit, and convert it to a Unicode text file.
And if you want to edit footnotes (i.e. "Text end-notes") in NW-Ex, you would run the Perl macro "TextEndNotes2fnTags", so that the notes would be in the main text, enclosed between the tags "<fn>" and "</fn>". You could use the macro "fnTags2blue", so that your "fn_tag" notes would be easier to distinguish from your main text. And when you have finished editing, you could run the macro "fnTags2TextEndNotes", to send the notes at the end of the main text.
Download
Here is the download link: download package (80 KB).
This package contains:
- Classic Nisus macros:
- font<->HTML_Entities macros
- NoteMacros
- MacrosExample_files (appendices to the ReadMe)
- Nisus Writer Express Perl macros:
- autoUpdateNoteNum.pl
- fnTags2blue.pl
- fnTags2TextEndNotes.pl
- htmlEntity2RTFUnicode.pl
- removeNs.pl
- TextEndNotes2fnTags.pl
- A detailed ReadMe
You can also download:
A little passage in ReadMe uses this font for the demonstration purpose.
- Appeal font (720 KB)
I hope these explanations and macros are of some help for some users.
I would appreciate any feedback. Thank you in advance.
Go to Research tools Home Page
Go to NI Home Page
Mail to Nobumi Iyanaga
This page was last built with Frontier on a Macintosh on Fri, May 16, 2003 at 1:20:02 AM. Thanks for checking it out! Nobumi Iyanaga