Using MtScript |
Once MtScript is installed on your system, you can run it by simply typing the following on the command line:
mtscriptThis command invokes MtScript for a new (untitled) text. Until the user chooses the language in which to begin typing (see below), the language is initially set to <unknown>.
If you want to start with a particular language, type:
mtscript -lang <language_code>Here, the language is initially set to <language_code> instead of <unknown>, thus invoking the appropriate language rules and character set. For example, the command
mtscript -lang fropens a new file and invokes the language rules and character set for French.
See the list of language codes for the languages currently supported.
When a text is created with MtScript, all of the information concerning the languages associated with portions of the text is stored in a corresponding "style file"). To edit a file previously created with MtScript and automatically load its style file, type:mtscript <file_name>Note that the -lang option is not valid when calling up an MtScript file.
If the text stored in <file_name> was not created with MtScript (and therefore has no associated style file), the text can be loaded into MtScript with the commandmtscript <file_name>Initially, the language is set to <unknown> for the entire text. Once loaded, the user can change the language for the entire text or portions of it by selecting the appropriate zone and choosing the desired language. The -lang option may be used when calling up a non-MtScript file:mtscript -lang <language_code> <file_name>This sets the language of the entire text initially to <language_code>.
The following options are available:
- -version
- displays the version number
- -bw
- sets the display of all languages to black and white: useful on monochrome screens or for people with vision problems
- -visual staticgray | grayscale | staticcolor |
- pseudocolor | truecolor | directcolor
sets the type of display on color or grayscale monitors: see the X11 documentation
- -lang <lang>
- sets the initial language to <lang>, where <lang> is a language code, e.g. 'fr'
default value: 'xx' ("unknown")
- -unknown <charset>
- sets the character set of the "unknown" language to <charset>, e.g. 'iso_8859_2'
default value: 'iso_8859_1'
To choose the language in which you will enter text:
To modify the language of any previously typed portion of text:
For convenience, each language is displayed in a different color in the text (the language name appears in the same color in the Insert menu). The language-to-color mapping cannot be changed in the current version.
Typing text in many different languages based on different alphabets on a standard keyboard requires
- writing rules, i.e. special key sequences, for inputing characters with diacritics and contextual variants,
- transliteration rules, i.e. a direct mapping between keys and characters, for alphabetic languages not based on the Latin alphabet.
These rules are kept in language rule files and can be redefined by the user.
The current version of MtScript includes writing rules for several languages, for example:
French The rule "a + ` = à" indicates that when the user types a immediately followed by `, an a with grave accent (à) is displayed. There is an escape mechanism which allows displaying the sequence a`, if needed.
The rule "é + BS = e" indicates that when the user enters a backspace following é, the accent is deleted first. A second backspace erases the character e itself.
German The rule "s + s = ß" indicates that typing two consecutive s's results in displaying ß. The escape mechanism allows displaying two s's where needed.
Greek This table provides two rules for the letter "sigma" in Greek, which has two different forms, depending whether it appears at the end of a word (rule "sigma + space") or inside a word (rule "sigma + any").
Arabic This table provides contextual rules for Arabic characters, most of which can be written in four different forms, depending on their position within a word: initial, internal, final, or isolated. These rules specify that when a user initially types any letter, the isolated form is first displayed. If the letter is followed by a space, it remains as such. If it is followed by a second letter, it becomes an initial form, and the second one is displayed as final, etc.
Note: In the left column of the table, the characters are given in the order they are typed, whereas in the second column they are given in the order in which they are displayed (Arabic is written from right to left).
For languages that are not based on the Latin alphabet, a file of transliteration rules provides a mapping between keys on the standard keyboard and non-Latin characters. These rules can be redefined by the user.
The figure on the left gives an example of the Arabic transliteration rules (file keys.ar).
Writing rules provide a means to compose characters with diacritics and contextual variants that are common in a language. When inputing text in any language, it is possible to insert characters, which, although part of the same character set for that language, are not a part of the usual set of characters used in displaying that language. For example, the character é is not defined in the writing rules for English, since it is not a character in that language, although é is part of the same character set used by MtScript for displaying English. If it is desired to input é in a portion of text that has been identified as English, the by using the compose key provided on Sun keyboards. A mapping between various compose and character key sequences and special characters is standard to Sun keyboards (see the Sun documentation for a table of correspondences).
Example: when typing English, the character é can be displayed by typing
COMPOSE + e + ' = é
Note: The feature above does not work properly in the current version.
When necessary, special sequences for generating characters with diacritics can be disabled. For example, in the default writing rules for French, the keystroke sequence e + ' yields the character é; if it is desired to generate the actual two characters e', an escape sequence can be used. Thus:
e + ' = é
e + ESC + ' = e'
Typing text for non-alphabetic languages such as Chinese, Japanese or Korean requires special input modules. These modules are still under development.
For the time being, although texts in non-alphabetic languages cannot be typed, they can be displayed using the following procedure:
To save a text, use the item Save or Save as in the File menu.
Each file saved under a "file_name" is associated with a style file named "file_name@":
The current version of MtScript does not include menus for changing the style, size, color or justification attributes of characters. Until the menus are incorporated into MtScript, you can modify these attributes manually by editing the style file associated with your text.
As noted above, each language is associated with two sets of rules: writing rules and transliteration rules. Existing writing rules and transliteration rules may be redefined by the user to accomodate special needs, and new writing rules and transliteration rules may be created from scratch when adding new languages.
Each language is associated with a set of writing rules (filename: rules.<language_name_code>). Each rules.<language_code> file is divided into two main parts:
- Part 1: classification of the whole characters into subsets of characters having the same features, for example:
- class for the accented lowercase characters
- class for the non-accented lowercase characters
- class for the accented capital characters
- class for the numbers
- etc.
- Part 2: writing rules represented by finite state automata, for example:
- French: e + ' = é
- German: s + s = ß
- Greek: medial_sigma + space = final_sigma + space
- Arabic: isolated_ain + ain = initial_ain + final_ain
- etc.
Example: rules.fr file.
The transliteration rules define the association between individual keyboard keys and the characters of the non-Latin languages. Each language is associated with a set of transliteration rules (filename: keys.<language_code>).
Example: keys.ar file.
When you want to load a given language lang, MtScript looks for the corresponding rules.lang_code and keys.lang_code files successively in the following directories:
- current directory
- ~/.ml
- /usr/local/lib/ml
Therefore, several versions of the rules files may exist on the system; the one used on a particular invocation of MtScript is determined by the directory search order given above.