This guide complements the commands reference info explorer for AIX running
on RISC System/6000. It discusses different aspects of Arabic and Hebrew support,
and describes only features unique to Hebrew/Arabic language support. You should
be familiar with the operation of AIX before using this guide. In this document
the word Bidi will be used to specify the mixture of Latin and Arabic or Latin
and Hebrew data, and all references to AIX refer to AIX on the RISC System/6000
platform.
Customization
This section covers the initiation of Arabic and Hebrew support for use on AIX. It describes the locale (language) and font settings, and identifies the special key combinations used in Arabic or Hebrew.
Changing language setting or locale definition
In order to initiate the Bidi support, the current locale has to be changed to the required one. This is done through the 'LANG' environment variable which controls the language to be used. There are 2 (3 starting with AIX 4.3) possible locale values for the LANG variable for each of the Arabic and Hebrew languages.
For Hebrew:
iw_IL (corresponding to the ISO8859-8 code page)
Iw_IL (corresponding to the IBM856 code page)
IW_IL (corresponding to the Unicode code page on AIX4.3 and above)
Note: some time ago, the ISO code for the Hebrew language was changed from 'iw' to 'he'. The name of Hebrew locales should be changed accordingly (conserving the capitalization of the first and/or second letter). However, this change was not yet implemented in AIX Release 4.3.3.
For Arabic :
ar_AA (corresponding to the ISO8859-6 code page)
Ar_AA (corresponding to the IBM1046 code page)
AR_AA (corresponding to the Unicode code page on AIX4.3 and above)
To assign any of these values to LANG, type one of the following at the $ prompt:
$ export LANG=iw_IL
or
$ export LANG=Iw_IL
or
$ export LANG=IW_IL
or
$ export LANG=ar_AA
or
$ export LANG=Ar_AA
or
$ export LANG=AR_AA
Note: to verify that you are working with the required locale, type "locale" at the prompt and you'll get the following:
| Hebrew |
|
Arabic |
|
$locale
LANG=iw_IL
LC_COLLATE="iw_IL"
LC_CTYPE="iw_IL"
LC_MONETARY="iw_IL"
LC_NUMERIC="iw_IL"
LC_TIME="iw_IL"
LC_MESSAGES="iw_IL"
LC_ALL=
for the "iw_IL" locale, or
$locale
LANG=Iw_IL
LC_COLLATE="Iw_IL"
LC_CTYPE="Iw_IL"
LC_MONETARY="Iw_IL"
LC_NUMERIC="Iw_IL"
LC_TIME="Iw_IL"
LC_MESSAGES="Iw_IL"
LC_ALL=
for the "Iw_IL" locale
$locale
LANG=IW_IL
LC_COLLATE="IW_IL"
LC_CTYPE="IW_IL"
LC_MONETARY="IW_IL"
LC_NUMERIC="IW_IL"
LC_TIME="IW_IL"
LC_MESSAGES="IW_IL"
LC_ALL=
for the "IW_IL" locale on AIX4.3 and above
|
|
$locale
LANG=ar_AA
LC_COLLATE="ar_AA"
LC_CTYPE="ar_AA"
LC_MONETARY="ar_AA"
LC_NUMERIC="ar_AA"
LC_TIME="ar_AA"
LC_MESSAGES="ar_AA"
LC_ALL=
for the "ar_AA" locale, or
locale
LANG=Ar_AA
LC_COLLATE="Ar_AA"
LC_CTYPE="Ar_AA"
LC_MONETARY="Ar_AA"
LC_NUMERIC="Ar_AA"
LC_TIME="Ar_AA"
LC_MESSAGES="Ar_AA"
LC_ALL=
for the "Ar_AA" locale
$locale
LANG=AR_AA
LC_COLLATE="AR_AA"
LC_CTYPE="AR_AA"
LC_MONETARY="AR_AA"
LC_NUMERIC="AR_AA"
LC_TIME="AR_AA"
LC_MESSAGES="AR_AA"
LC_ALL=
for the "AR_AA" locale. on AIX4.3 and above
|
Using an Arabic font
To display Arabic text, you should use an Arabic font. A number of Arabic fonts are available for aixterm, for Motif applications, and for the hft terminal. The fonts available in the aixterm are listed in the directory /usr/lpp/X11/lib/X11/fonts/i18n and those for the hft terminal exist in the directory /usr/lpp/fonts. The way a certain font is selected depends on the application using it. For example, in 'aixterm' the font name is either included in a resource file or as a command line parameter.
Examples of font names:
for the aixterm with locale ar_AA or AR_AA:
Rom14.ibm1046
Block14.ibm1046
for the hft terminal with locale ar_AA or Ar_AA:
Rom28.ibm1046
Note that all the Arabic fonts contain the extension ibm1046. There is no Arabic fonts with extension iso6
Using a Hebrew font
In order to be able to display Hebrew text, you should use a Hebrew font. A number of Hebrew fonts are available for aixterm, for Motif applications and for the hft terminal. The fonts available in the aixterm are listed in the directory /usr/lpp/X11/lib/X11/fonts/i18n and those for the hft terminal exist in the directory /usr/lpp/fonts. The way a certain font is selected depends on the application using it. For example, in 'aixterm' the font name is either included in a resource file or as a command line parameter.
Examples of font names:
for the aixterm with locale Iw_IL
Rom14.ibm856
Rom8.ibm856
Itl14.ibm856
for the aixterm with locale iw_IL
Rom14.iso8
Rom8.iso8
Itl14.iso8
for the hft terminal with locale Iw_IL
Rom28.ibm856
for the hft terminal with locale iw_IL
Rom28.iso8
Note: the extension listed after the '.' character ('ibm856' or 'iso8') means that this is a Hebrew font.
Special Bidi key combinations
Once the Hebrew/Arabic locale has been established, you can use Bidi support functions through special key combinations. The table below shows a list of the most commonly used key combinations in Bidi and their corresponding functions. Note that specific applications may use different key combinations, example of these are the ibm3151 terminal emulator and the host emulators. The order in which you press the keys is important, you press and hold the first key (usually the alt key), then press the next key.
| 1st Key |
2nd Key |
FUNCTION |
| Alt |
ENTER |
Inverse screen direction |
| Alt |
RIGHT SHIFT |
Enable Hebrew/Arabic keyboard |
| Alt |
LEFT SHIFT |
Enable English keyboard |
The default screen orientation is usually left to right, in which case the default keyboard language is English. Using the first key combination, the screen orientation can be changed to right to left (and vice versa) in which case the default keyboard language is Arabic or Hebrew. Still, whether you are working in a left-to-right or right-to-left screen, you can edit bilingual text by switching the keyboard language using one of the other key combinations.
Bidi aixterm command
The purpose of the aixterm command is to initialize a Latin and/or Hebrew/Arabic enhanced X-Windows terminal emulator.
| Syntax |
|
aixterm |
| -nobidi |
|
|
| -text |
|
Text mode |
| -csd |
|
Shaping mode |
| -nss |
|
Numeric Shape Type |
| -orient |
|
Orientation |
| -autopush |
|
|
| -nonulls |
|
|
| -symmetric |
|
|
The aixterm command is used to open a window to be utilized for Latin or Bidi applications. The user can create a Bidi window by specifying the required locale in the language flag "-L iw_IL" or "-L Iw_IL" for Hebrew, and "-L ar_AA" or "-L Ar_AA" for Arabic language or by predefining the required locale from SMIT for the whole system.
The Arabic/Hebrew window, when initiated, supports bilingual text display (i.e. English and Hebrew(or Arabic) text on the same line). The following are Bidi features to be considered:
- Screen orientation
- Text type
- Character shaping
- Numeric representation
- Status line
The screen orientation in a Bidi window can be either left-to-right or right-to-left. The default orientation of a newly created window is left-to-right (unless specified otherwise in the command flags or the ".Bidi-defaults" file). Through the special key combination described above, while the window is active, the screen orientation can be reversed to either direction back and forth according to your needs.
Two text modes with their corresponding manipulation are introduced in the Bidi window:
In the Implicit text mode, characters are stored in keying sequence, i.e. in the same order they are entered; they are transformed into their visual form only when they are displayed. However, in the Visual text mode, characters are stored in the same way they are displayed on the terminal window. The Bidi window supports an optional status line that shows the current status of the window.
The status line contains the following indications:
| Value |
|
Current setting |
| E |
|
English language |
| H |
|
Hebrew language |
| A |
|
Arabic language |
| SCR-> |
|
left-to-right screen orientation |
| <-SCR |
|
right-to-left screen orientation |
| AP |
|
autopush on |
| alef |
|
Auto shape mode |
| blank |
|
Passthru shaping mode |
| ghain |
|
displayed in the currently used shaping mode |
| I |
|
Implicit Text Mode |
| V |
|
Visual text mode |
| U |
|
Upon context numbers |
| A |
|
Arabic numbers |
| H |
|
Hindi numbers |
| P |
|
Passthru for numbers |
Note: It is advisable to use the Implicit text mode (the default text mode) for more efficient data sorting. Added to that is that the Implicit mode deals more transparently with Latin applications handling Bidi data.
Flags
| These options override those in the .Bidi-defaults file: |
| L (or -lang) |
|
ar_AA (for ISO8859-6 locale) |
| |
|
Ar_AA (for IBM 1046 locale) |
| |
|
iw_IL (for ISO 8859-8 locale) |
| |
|
Iw_IL (for IBM 856 locale) |
| nobidi |
|
Disables Bidi functions (such as screen reverse, Arabic/Hebrew keyboard
layering etc.) while keeping the locale characteristics |
| csd CharShape |
|
Specifies default shape of Arabic text. The CharShape argument can
be one of the following:
- automatic - shaping is done automatically
- passthru - no shaping is done; characters are displayed in the same
way they are entered
- isolated - characters are displayed only in isolate shape (valid
in visual mode only)
- initial - characters are displayed only in initial shape (valid
in visual mode only)
- middle - characters are displayed only in middle shape (valid in
visual mode only)
|
| nss NumShape |
|
Specifies default shape of numerals, used in case of Arabic local only |
The NumShape can take one of the following values:
| bilingual (or upon context) |
|
In Implicit mode, Numbers are displayed as Hindi digits within an Arabic
text segment and as Arabic (Latin like) digits within an English text
segment |
| hindi |
|
Numbers are displayed as Hindi digits |
| arabic |
|
Numbers are displayed as Arabic digits |
| passthru |
|
Numbers are displayed in the same way they are entered |
| text TextType |
|
Specifies the type of data stream handled. TextType can be one of two:
- Visual - characters are stored in the same way they are displayed. In visual, you can either work in autopush or in push mode with different shape types
- Implicit - characters are stored in key entry order
|
| orient |
|
Specifies default screen orientation. Orientation can be:
- LTR - for left-to-right screen orientation
- RTL - for right-to-left screen orientation
|
| nonulls |
|
Turns on nonulls mode in which nulls within a line are replaced by spaces |
| autopush |
|
Turns on autopush mode for the visual text type |
| symmetric |
|
Turns on symmetric character swapping mode for handling directional character pairs (e.g.<>, (), etc) |
Key combinations
The following table summarizes the key combinations used in an Hebrew or Arabic window to change certain settings.
| Key Combination |
|
Purpose |
| Alt + ENTER |
|
Reverse Screen direction |
| Alt + RightShift | | Enable Arabic/Hebrew keyboard layer |
| Alt + LeftShift |
|
Enable English keyboard layer |
| For Implicit Mode only: | | |
| Alt + KPD * |
|
For Column Heading adjustment |
| For Visual Mode only: | | |
| Alt + KPD 1 |
|
Characters shaped in initial form |
| Alt + KPD 2 | | Characters shaped in isolated form |
| Alt + KPD 3 |
|
Characters shaped in passthru form |
| Alt + KPD 4 | | Characters shaped automatically (Valid also for Implicit) |
| Alt + KPD 7 |
|
Characters shaped in middle form |
| Alt + KPD 8 | | Characters shaped in final form |
| Shift + KPD / |
|
Push Mode toggle (Push + EndPush) |
| Alt + KPD / | | Automatic Push Mode toggle |
Bi-directional Xm (Motif) library
LibraryName/usr/lib/libXm.a. This is the normal Motif library shipped
with AIX. The Bidi functionality is enabled only when the running locale is
Arabic or Hebrew. Otherwise it runs in a fully Latin mode.
Purpose
The Motif Toolkit is a library that defines a set of widgets with their corresponding functions. The Bidirectional Motif toolkit provides a convenient way of creating Bidi graphical user interfaces.
Description
The Bidi related changes in the Motif library fall into two categories.
There are changes which deal with the inverted geometry (right-to-left screen
orientation). These affect a large number of widgets and gadgets. Other changes
deal with inputting bilingual text and supporting bidirectional functionality
(e.g.: character shaping, symmetric swapping, etc). The later changes affect
mostly Text widgets. For that purpose, a number of additional resources were
incorporated in the toolkit. In the following section, you will find a description
of these resources, their names and their possible values.
Bidi Resources
These resources control the geometry of the screen as well as the Bidi behavior
of widgets. These can be set, like other resources, either from a resource file
or from inside a program (XtSetArg function). Depending on the way you choose
to set them, the way their names and values are written will vary accordingly.
If the resources are set from a resource file:
| Resource Name |
Values |
Effect |
Default Values |
| textMode |
text_mode_implicit |
Text display is in implicit mode |
text_mode_implicit |
| |
text_mode_visual |
|
|
| symmetricSwap |
true |
Symmetric swapping on |
true |
| |
false |
Symmetric swapping off |
|
| * csdMode |
csd_mode_automatic |
Automatic shaping mode |
csd_mode_automatic |
| |
csd_mode_passthru |
Passthru shaping mode |
|
| |
csd_mode_initial |
Characters shaped in Initial form |
|
| |
csd_mode_middle |
Characters shaped in middle form |
|
| |
csd_mode_final |
Characters shaped in final form |
|
| |
csd_mode_isolated |
Characters shaped in Isolated form |
|
| * nssMode |
nss_mode_bilingual |
Numbers represented upon context |
nss_mode_bilingual |
| |
nss_mode_Arabic |
Numbers represented in Arabic |
|
| |
nss_mode_hindu |
Numbers represented in Hindu |
|
| |
nss_mode_passthru |
Numbers in passthru mode |
|
| * expandTail |
true |
Seen Family shaped on 2 cells |
false |
| |
false |
Seen Family shaped on 1 cell |
|
| * textCompose |
true |
Diacritics above consonants |
false |
|
|
|
| |
false |
Diacritics beside consonants |
|
|
|
Characters shaped in Middle formText display is in visual mode
* These attributes are applicable to Arabic language only.
If the resources are set through the widget's argument list (using XtSetArg function):
| Resource Name |
Values |
Effect |
| XmNtextMode |
XmTEXT_MODE_IMPLICIT |
Text display is in implicit mode |
| |
XmTEXT_MODE_VISUAL |
Text display is in visual mode |
| XmNcsdMode |
XmCSD_MODE_AUTOMATIC |
Automatic shaping mode |
| |
XmCSD_MODE_PASSTHRU |
Passthru shaping mode |
| |
XmCSD_MODE_INITIAL |
Characters shaped in Initial form |
| |
XmCSD_MODE_MIDDLE |
Characters shaped in Middle form |
| |
XmCSD_MODE_FINAL |
Characters shaped in final form |
| |
XmCSD_MODE_ISOLATED |
Characters shaped in Isolated form |
| XmNnssMode |
XmNSS_MODE_BILINGUAL |
Numbers represented upon context |
| |
XmNSS_MODE_ARABIC |
Numbers represented in Arabic |
| |
XmNSS_MODE_HINDU |
Numbers represented in Hindu |
| |
XmNSS_MODE_PASSTHRU |
Numbers in passthru mode |
Take care that another resource not related to the added Bidi support still needs to be set, namely the "fontList" resource. The font list must include a font name that can display the characters of the chosen language.
Example
The following example creates a text widget after setting the string direction and layout orientation to right-to-left, and the text mode to implicit. This can be done either from a resource file:
*XmText*stringDirection: string_direction_r_to_l
*XmText*layoutDirection: right_to_left
*XmText*textMode: text_mode_implicit
Or, from inside a program:
ArgList args;
XtSetArg(args[0], XmNstringDirection, XmSTRING_DIRECTION_R_TO_L)
XtSetArg(args[1], XmNlayoutDirection, XmRIGHT_TO_LEFT)
XtSetArg(args[2], XmNtextMode, XmTEXT_MODE_IMPLICIT);
XmCreateTextWidget(parent_widget, text_widget_name, args,3);
The Text Widget
The Text widget is affected by all the Bidi resources discussed above. It can display text in two modes: implicit and visual. It supports character and numeric shaping (for Arabic) in addition to a couple of miscellaneous functions: symmetric swapping and the special handling of the seen family. Furthermore, the text widget, being the only widget dealing with inputting text, is the only widget supporting Bidi key combinations, which are the same as the ones used by aixterm. The text widget also reacts to the stringDirection and layoutDirection resources (see next section). The Text Field WidgetThe Text Field is also affected by all the Bidi resources. It behaves like the text widget, but in single line mode.
The Label Widget and Gadget
The Label widget and gadget are affected by the textMode resource in addition to the stringDirection and layoutDirection resources (see next section). They specifically apply the Bidi reordering algorithm and automatic shaping of the label string when the text mode is implicit. Otherwise, the label string is displayed as stored, and shaped in case of Arabic.
The List Widget
The List widget is also affected by the textMode resource in addition to the stringDirection and layoutDirection resources, just like the Label widget. Transformation is applied to the list item when the text mode is implicit. Otherwise, the list item string is displayed as stored (and shaped in case of Arabic).
Effect of "stringDirection" and "layoutDirection" on Motif Widgets
| Widget name |
Effect |
| CascadeButton |
Reverse side of cascade graphic |
| |
Bring menu on left |
| Command |
Place prompt string at right hand side, with default of < |
| DrawButton |
Show accelerator at left of label
|
| FileSelectionBox |
Lay buttons out from right to left |
| |
Align labels on right hand side |
| |
Force string direction to right-to-left |
| Label Widget |
Locate accelerator text to left of label text |
| |
Force string direction to right to left |
| List Widget |
Force string direction to right to left |
| MessageBox |
Lay buttons out from right-to-left |
| |
Force string direction to right-to-left |
| |
Propagate layout direction to subordinate |
| PushButton |
Show accelerator at left of label |
| RowColumn Widget |
Layout subordinates from right to left for all menu types |
| Scale |
if XmNorientation is XmVertical, and XmNshowValue is true, show the
value to the left of the scale. |
| |
if XmNorientation is XmHorizontal, default XmNprocessing Direction is
XmMAX_ON_LEFT |
| ScrolledWindow |
Propagate direction to subordinates |
| |
Force scrollBarPlacement to XmBOTTOM_LEFT |
| ScrollBar |
if XmNorientation is XmHORIZONTAL, default XmNprocessingDirection is
XmMAX_ON_LEFT |
| SelectionBox & FileSelectionBox |
Lay buttons out from right to left and align labels on right hand side |
| |
Force string direction to right to left |
| |
Propagate layout direction to subordinates |
|
ToggleButton
|
Show accelerator at left of label |
| |
Reverse side of toggle graphic |
| Text widget |
Force text orientation to right to left |
|