<?xml version="1.0" encoding="utf-8"?>
<book fpi="-//Sun::SunSoft//DOCUMENT SOLCMPLXSUPPT Version 1.0//en" role="numbered" label="fcs" id="ctllssoe" lang="en" userlevel="developer"><title lang="en">Complex Text Layout Language Support in the Solaris Operating Environment</title><bookinfo><bookbiblio><title lang="en">Complex Text Layout Language Support in the Solaris Operating Environment</title><authorgroup lang="en"><author lang="en"><firstname lang="en">John</firstname><surname lang="en">White</surname></author></authorgroup><isbn lang="en"/><pubsnumber lang="en"><gentext type="text">Part No: </gentext>806-5583</pubsnumber><releaseinfo lang="en"/><pubdate lang="en">May 2000</pubdate><publisher lang="en"><publishername lang="en">Sun Microsystems, Inc.</publishername><address lang="en"><street lang="en">901 San Antonio Road</street><city lang="en">Palo Alto<gentext type="text">, </gentext></city><state lang="en">CA<gentext type="text"></gentext></state><postcode lang="en">94303-4900</postcode><country lang="en">U.S.A.</country></address></publisher><copyright lang="en"><year lang="en">2000</year><holder lang="en">     Sun Microsystems</holder></copyright><abstract lang="en"><para lang="en">Title: Complex Text Layout Language Support in the Solaris Operating Environment</para><para lang="en">Part number: 806-5583</para><para lang="en">Audience: System administrators, software developers</para><para lang="en">Page count: 28</para><para lang="en">Keywords: Solaris 8 operating environment, Internationalization, I18N,
CTL</para><para lang="en">This book provides information and software features for internationalizing
software in Complex Text Layout language markets</para></abstract></bookbiblio><legalnotice lang="en"><para lang="en">This product or document is protected by copyright and distributed under licenses restricting its use, copying, distribution, and decompilation. No part of this product or document may be reproduced in any form by any means without prior written authorization of Sun and its licensors, if any. Third-party software, including font technology, is copyrighted and licensed from Sun suppliers.</para><para lang="en">Parts of the product may be derived from Berkeley BSD systems, licensed from the University of California. UNIX is a registered trademark in the U.S. and other countries, exclusively licensed through X/Open Company, Ltd.</para><para lang="en">Sun, Sun Microsystems, the Sun logo, docs.sun.com, AnswerBook, AnswerBook2, 
 and Solaris are trademarks, registered trademarks, or service marks of Sun Microsystems, Inc. in the U.S. and other countries. All SPARC trademarks are used under license and are trademarks or registered trademarks of SPARC International, Inc. in the U.S. and other countries. Products bearing SPARC trademarks are based upon an architecture developed by Sun Microsystems, Inc. </para><para lang="en">The OPEN LOOK and <trademark class="trade" lang="en">Sun</trademark> Graphical User Interface was developed by Sun Microsystems, Inc. for its users and licensees. Sun acknowledges the pioneering efforts of Xerox in researching and developing the concept of visual or graphical user interfaces for the computer industry. Sun holds a non-exclusive license from Xerox to the Xerox Graphical User Interface, which license also covers Sun's licensees who implement OPEN LOOK GUIs and otherwise comply with Sun's written license agreements.</para><para lang="en">Federal Acquisitions: Commercial Software-Government Users Subject to Standard License Terms and Conditions.</para><para lang="en">DOCUMENTATION IS PROVIDED "AS IS" AND ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD TO BE LEGALLY INVALID.</para><para lang="fr"/><para lang="en">Ce produit ou document est protégé par un copyright et distribué avec des licences qui en restreignent l'utilisation, la copie, la distribution, et la décompilation. Aucune partie de ce produit ou document ne peut être reproduite sous aucune forme, par quelque moyen que ce soit, sans l'autorisation préalable et écrite de Sun et de ses bailleurs de licence, s'il y en a. Le logiciel détenu par des tiers, et qui comprend la technologie relative aux polices de caractères, est protégé par un copyright et licencié par des fournisseurs de Sun.</para><para lang="en">Des parties de ce produit pourront être dérivées du système Berkeley BSD licenciés par l'Université de Californie. UNIX est une marque déposée aux Etats-Unis et dans d'autres pays et licenciée exclusivement par X/Open Company, Ltd. </para><para lang="en">Sun, Sun Microsystems, le logo Sun, docs.sun.com, AnswerBook, AnswerBook2, 
 et Solaris sont des marques de fabrique ou des marques déposées, ou marques de service, de Sun Microsystems, Inc. aux Etats-Unis et dans d'autres pays. Toutes les marques SPARC sont utilisées sous licence et sont des marques de fabrique ou des marques déposées de SPARC International, Inc. aux Etats-Unis et dans d'autres pays. Les produits portant les marques SPARC sont basés sur une architecture développée par Sun Microsystems, Inc.</para><para lang="en">L'interface d'utilisation graphique OPEN LOOK et <trademark class="trade" lang="en">Sun</trademark> a été développée par Sun Microsystems, Inc. pour ses utilisateurs et licenciés. Sun reconnaît les efforts de pionniers de Xerox pour la recherche et le développement du concept des interfaces d'utilisation visuelle ou graphique pour l'industrie de l'informatique. Sun détient une licence non exclusive de Xerox sur l'interface d'utilisation graphique Xerox, cette licence couvrant également les licenciés de Sun qui mettent en place l'interface d'utilisation graphique OPEN LOOK et qui en outre se conforment aux licences écrites de Sun.</para><para lang="en">CETTE PUBLICATION EST FOURNIE "EN L'ETAT" ET AUCUNE GARANTIE, EXPRESSE OU IMPLICITE, N'EST ACCORDEE, Y COMPRIS DES GARANTIES CONCERNANT LA VALEUR MARCHANDE, L'APTITUDE DE LA PUBLICATION A REPONDRE A UNE UTILISATION PARTICULIERE, OU LE FAIT QU'ELLE NE SOIT PAS CONTREFAISANTE DE PRODUIT DE TIERS. CE DENI DE GARANTIE NE S'APPLIQUERAIT PAS, DANS LA MESURE OU IL SERAIT TENU JURIDIQUEMENT NUL ET NON AVENU.</para></legalnotice><subjectset lang="en"><subject lang="en"><subjectterm lang="en">Programming &amp; Tools</subjectterm></subject><subject lang="en"><subjectterm lang="en">System Administration</subjectterm></subject></subjectset></bookinfo><preface id="preface-1" lang="en" role="preface"><gentext type="text">Preface</gentext><gentext type="toc">Preface</gentext><title lang="en">Preface</title><highlights lang="en"><para lang="en">The <citetitle lang="en">Complex Text Layout Language Support in the <trademark class="trade" lang="en">Solaris</trademark> Operating Environment</citetitle> white paper presents
information and software features for internationalizing software in Complex
Text Layout language markets. </para><para lang="en">Complex Text Layout (CTL) languages require text layout transformations
on text input to properly display text output on the screen or printed page.
CTL functionality is available in all Unicode locales as well as the Thai,
Arabic, and Hebrew locales.</para></highlights><sect1 id="preface-9" lang="en"><title id="preface-2" lang="en">Who Should Use This Book</title><para lang="en">This white paper is intended for software developers who are interested
in developing internationalized software for the Complex Text Layout Language <trademark class="trade" lang="en">Solaris</trademark> operating environment. This white paper is part of a 4-part
series on internationalization for Solaris software developers. The four internationalization
white papers are:</para><itemizedlist lang="en" mark="bullet"><listitem lang="en"><para lang="en"><citetitle lang="en">Asian-Language Support in the <trademark class="trade" lang="en">Solaris</trademark> Operating Environment</citetitle></para></listitem><listitem lang="en"><para lang="en"><citetitle lang="en">Complex Text Layout Language Support in the <trademark class="trade" lang="en">Solaris</trademark> Operating Environment</citetitle></para></listitem><listitem lang="en"><para lang="en"><citetitle lang="en">Unicode Support in the <trademark class="trade" lang="en">Solaris</trademark>
Operating Environment</citetitle></para></listitem><listitem lang="en"><para lang="en"><citetitle lang="en">Euro Currency Support in the <trademark class="trade" lang="en">Solaris</trademark> Operating Environment</citetitle></para></listitem></itemizedlist></sect1><sect1 id="preface-4" lang="en"><title lang="en">How This Book Is Organized</title><para lang="en"><link linkend="chapter1-1" lang="en">Chapter 1</link> describes characteristics
of CTL languages and how they are managed by the Solaris CTL language engines.</para><para lang="en"><link linkend="chapter2-1" lang="en">Chapter 2</link> provides an overview of
the Solaris CTL architecture and explains how developers can add CTL functionality
to an application.</para><para lang="en"><link linkend="chapter3-1" lang="en">Chapter 3</link> provides helpful resource
information.</para></sect1><sect1 id="preface-5" lang="en"><title lang="en">Related Books</title><para lang="en">The following books are related to software internationalization: </para><para lang="en"><itemizedlist lang="en" mark="bullet"><listitem lang="en"><para lang="en"><citetitle lang="en">Creating Worldwide Software: Solaris International
Developer's Guide</citetitle> Bill Tuthill and David Smallberg.</para></listitem><listitem lang="en"><para lang="en"><citetitle lang="en">Internationalization Guide, Version 2: Open Group
Guide</citetitle> The Open Group</para></listitem><listitem lang="en"><para lang="en"><citetitle lang="en">International Language Environments Guide</citetitle>
Solaris Developer Collection.</para></listitem><listitem lang="en"><para lang="en"><citetitle lang="en">Programming for the World: A Guide to Internationalization</citetitle> Sandra Martin O'Donnell.</para></listitem><listitem lang="en"><para lang="en"><citetitle lang="en">The Unicode Standard, Version 3.0</citetitle> The
Unicode Consortium.</para></listitem><listitem lang="en"><para lang="en"><citetitle lang="en">X Windows on the World, Developing Internationalized
Software with X, Motif, and CDE</citetitle> Thomas C. McFarland.</para></listitem></itemizedlist></para><para lang="en">The following books are related to CTL language support: </para><para lang="en"><itemizedlist lang="en" mark="bullet"><listitem lang="en"><para lang="en"><citetitle lang="en">CAE Specification: Portable Layout Services</citetitle>
ISBN 1-85912-142-X.</para></listitem><listitem lang="en"><para lang="en"><citetitle lang="en">Portable Layout Services: Context-dependent and
Directional Text</citetitle> ISBN 1-85912-075-X.</para></listitem></itemizedlist></para></sect1><sect1 id="sundocs-1" lang="en"><title lang="en">Ordering Sun Documents</title><para lang="en">Fatbrain.com, an Internet professional bookstore, stocks select product
documentation from Sun Microsystems, Inc.</para><para lang="en">For a list of documents and how to order them, visit the Sun Documentation
Center on Fatbrain.com at <ulink url="http://www1.fatbrain.com/documentation/sun"><literal moreinfo="none" lang="en">http://www1.fatbrain.com/documentation/sun</literal></ulink>.</para></sect1><sect1 id="sundocs-2" lang="en"><title lang="en">Accessing Sun Documentation Online</title><para lang="en">The <trademark class="service" lang="en">docs.sun.com</trademark> Web site enables
you to access Sun technical documentation online. You can browse the docs.sun.com
archive or search for a specific book title or subject. The URL is <ulink url="http://docs.sun.com"><literal moreinfo="none" lang="en">http://docs.sun.com</literal></ulink>.</para></sect1></preface><chapter id="chapter1-1" lang="en"><gentext type="text">Chapter 1</gentext><gentext type="toc">1.  Complex Text Layout Languages</gentext><title lang="en">Complex Text Layout Languages</title><highlights lang="en"><para lang="en">This chapter introduces features of Complex Text Layout languages and
their support in the Solaris operating environment. </para></highlights><itemizedlist lang="en" mark="bullet"><listitem lang="en"><para lang="en">Complex Text Layout language support in Solaris</para></listitem><listitem lang="en"><para lang="en">Bidirectional scripts (Arabic and Hebrew)</para></listitem><listitem lang="en"><para lang="en">Character representation</para></listitem><listitem lang="en"><para lang="en">Input and text handling</para></listitem><listitem lang="en"><para lang="en">Numbers and dates</para></listitem></itemizedlist><sect1 id="chapter1-2" lang="en"><title lang="en"><gentext type="text">1.1 </gentext>Introduction</title><para lang="en">Storing and displaying text has traditionally followed the basic structure
of writing systems in Western languages (languages based on the Roman, Cyrillic,
and Greek alphabets). Input characters are stored in the order in which they
are typed, and displayed in the same order. There is no logical difference
between how text is stored and how it is displayed.</para><para lang="en">Some writing systems, however, are different than those of Western languages.
The direction in which characters are displayed can be different and the shape
of a character or word can be modified depending on the adjoining text. Complex
text layout transformations are required for display. A Complex Text Layout
(CTL) language is any language which stores text differently from how it is
displayed. </para><para lang="en">Particularly, many CTL languages use <emphasis lang="en">bidirectional
script</emphasis>. Words and sentences are written from <emphasis lang="en">right to
left</emphasis>, while some text, such as numbers and Roman-based words, are
written from <emphasis lang="en">left to right</emphasis>. Arabic and Hebrew use bidirectional
script. Furthermore, some CTL languages are <emphasis lang="en">context dependent</emphasis>.
In Arabic, characters can be modified depending on the preceding and following
characters. Written Thai uses character clusters, a collection of syllabic
elements denoting consonants, vowels, and tonal values.</para></sect1><sect1 id="chapter1-3" lang="en"><title lang="en"><gentext type="text">1.2 </gentext>CTL Language Support in Solaris</title><para lang="en">The Solaris operating environment supports CTL easily and conveniently
in all Unicode and Thai, Arabic, and Hebrew locales. CTL scripts are properly
rendered as screen output or in printed format. Most applications need only
be recompiled  without changing the source code to run under these locales.
A CTL-supported application enables users to input, view, and display CTL
text without any additional development work.</para><para lang="en">The Solaris operating environment contains a standard API, the Portable
Layout Services (PLS) from The Open Group, which provide applications with
a consistent interface to the CTL language engines. Developers set various
CTL attributes in the PLS configuration file, including cursor positioning
and character and cell deletion.</para><note lang="en" role="note"><gentext type="text">Note - </gentext><para lang="en">Unless otherwise stated, the CTL language engines manage complex text
layout transparently to the user.</para></note></sect1><sect1 id="chapter1-4" lang="en"><title lang="en"><gentext type="text">1.3 </gentext>Bidirectional Scripts</title><para lang="en">Arabic and Hebrew use bidirectional script. In a bidirectional script,
the default text direction is from right to left. However, numbers and Western-language
text (such as quotations or proper names) are written from left to right.
Text justification depends on line direction--typically, right-to-left
text is right justified and left-to-right text is left justified.</para><para lang="en">Because input characters are stored in order, an application must manage
the display of blocks of right-to-left and left-to-right text in the proper
order. In <link linkend="chapter1-fig-1" lang="en">Figure 1-1</link>, text direction is left to right
for the English text and right to left for the Arabic text. Note that the
cursor is to the left of the Arabic text after input.</para><figure float="0" id="chapter1-fig-1" lang="en"><gentext type="text">Figure 1-1 </gentext><title lang="en">Bidirectional text</title><graphic filename="figures/Fig1-1.tiff.gif" width="130" depth="22" scale="70" lang="en"/></figure><note lang="en" role="note"><gentext type="text">Note - </gentext><para lang="en">In the Solaris operating environment, complex text layout issues are
managed by <emphasis lang="en">Motif. </emphasis>Applications using Motif do not need
to address these issues directly. For more information, see <link linkend="chapter2-2" lang="en">Section 2.1, <citetitle lang="en">Architecture</citetitle></link>.</para></note><sect2 id="chapter1-5" lang="en"><title lang="en"><gentext type="text">1.3.1 </gentext>Managing Bidirectional Text</title><para lang="en">In an application supporting bidirectional script, the <emphasis lang="en">global
direction</emphasis> determines text flow and alignment. For example, in an
Arabic word processor, the global direction is right to left for justification,
tabulation, and related formatting operations. Roman words and phrases within
an Arabic text string, however, remain left-to-right aligned. When a line
break occurs in the middle of an Arabic string imbedded in an English sentence,
however, the break must still respect the left-to-right text flow as shown
in <link linkend="chapter1-fig-2" lang="en">Figure 1-2</link>.</para><figure float="0" id="chapter1-fig-2" lang="en"><gentext type="text">Figure 1-2 </gentext><title lang="en">English-Arabic-English left-to-right text flow</title><graphic filename="figures/Fig1-2.tiff.gif" width="352" depth="45" scale="70" lang="en"/></figure></sect2><sect2 id="chapter1-6" lang="en"><title lang="en"><gentext type="text">1.3.2 </gentext>Symmetrical Swapping</title><para lang="en">Some characters have a meaning related to their direction, such  as
greater than (&gt;) and less than (&lt;). Bidirectional text strings containing
these characters may need to replace one character with its complement to
retain the correct meaning. For example, the expression 3 &lt; 4 (three is
less than four) is stored in the sequence in which it is typed. To display
this expression correctly in a right-to-left string, however, it must appear
as 4 &gt; 3 (read right to left as 3 less than 4). Because a direct transposition
of the three characters in storage would give 4 &lt; 3, which is incorrect,
the transformation process must swap &lt; and &gt;.</para><para lang="en">Replacing complementary symbols to retain their correct meaning is called <emphasis lang="en">symmetrical swapping</emphasis>. Characters requiring symmetrical swapping
include parentheses: ( and ), angle brackets: &lt; and &gt;, square brackets:
[ and ], and curly brackets: { and }. </para></sect2></sect1><sect1 id="chapter1-7" lang="en"><title lang="en"><gentext type="text">1.4 </gentext>Character Representation</title><para lang="en">In CTL languages, the basic input character is often modified before
being displayed. <emphasis lang="en">Character representation</emphasis> is the final
display form of the screen or printed character and depends on context, ligatures,
diacritical marks, and character clusters. </para><para lang="en">Note that any modified input will not have a one-to-one correspondence
between the number of input characters and the number of output glyphs. A
single glyph occupying one display cell can represent two or more typed characters.
Internal algorithms determine the character representation from the number
and sequence of input characters. By using the PLS library, an application
uses the appropriate character representation in each CTL language.</para><sect2 id="chapter1-8" lang="en"><title lang="en"><gentext type="text">1.4.1 </gentext>Contextual Analysis</title><para lang="en">The shape of a character in its final display form can depend on its
position in a word or its position relative to neighboring characters. Changing
the shape of a character is called shaping or <emphasis lang="en">contextual analysis</emphasis>. For example, in English handwriting, letters can have different
shapes in isolation or connected to other letters: the letter "r"
appears differently at the beginning, in the middle, or at the end of a word.
In English printing, however, character representation is unaffected by position--a
character in isolation or connected to other letters is identically represented.
For example, lowercase "a" is represented as "a"--either
by itself, at the start, in the middle, or at the end of a word as in: a,
all, lap, formula.)</para><para lang="en">Arabic uses a cursive script, connecting one character to another as
in English handwriting. All characters are affected in many different ways
by their context. Arabic characters can have up to four final display forms: <emphasis lang="en">initial, final, medial,</emphasis> or <emphasis lang="en">isolated</emphasis>. During
input, the keystrokes are stored as basic code-point values. The Arabic
language engine reads the code-point values and selects the appropriate final
display form from the context. Ligatures and diacritics, however, must also
be considered.</para><note lang="en" role="note"><gentext type="text">Note - </gentext><para lang="en">Only the basic shape of each character appears on an Arabic keyboard.</para></note></sect2><sect2 id="chapter1-9" lang="en"><title lang="en"><gentext type="text">1.4.2 </gentext>Ligatures </title><para lang="en">A ligature is the combination of two or more characters to create a
single character or syllable. For example, in English, a diphthong is a ligature
which unites two vowel characters to create another sound: a + e = æ.</para><para lang="en">In Arabic, ligatures are the combinations of two and, sometimes, three
characters into one glyph. The resulting glyph replaces the characters composing
it. For example, an Arabic letter typed twice is stored in memory as two distinct
keystrokes, occupying two display cells. However, the Arabic language engine
recognizes the context of each character and returns one glyph as shown in <link linkend="chapter1-fig-3" lang="en">Figure 1-3</link>.</para><figure float="0" id="chapter1-fig-3" lang="en"><gentext type="text">Figure 1-3 </gentext><title lang="en">Arabic ligature</title><graphic filename="figures/Fig1-3.tiff.gif" width="106" depth="28" lang="en"/></figure><para lang="en"/><para lang="en">In the Arabic language engine, a ligature occupies the same number of
display cells as input characters, with one exception: the combination character <emphasis lang="en">lamalif</emphasis>.</para><figure float="0" id="chapter1-fig-4" lang="en"><gentext type="text">Figure 1-4 </gentext><title lang="en">Lamalif combination character</title><graphic filename="figures/Fig1-4.tiff.gif" width="224" depth="28" lang="en"/></figure><para lang="en"/><para lang="en">The rules governing ligatures in Arabic text are very complex and do
not depend solely on individual characters. Certain fonts define as many as
200 ligatures, while other fonts do not use ligatures at all.</para></sect2><sect2 id="chapter1-10" lang="en"><title lang="en"><gentext type="text">1.4.3 </gentext>Diacritics</title><para lang="en">Diacritical marks (or diacritics) are added to a character to show pronunciation.
For example, in French, an accent is a diacritical mark above a vowel which
alters the stress of the vowel: à á è é.</para><para lang="en">In Hebrew, diacritical marks represent vowel sounds and appear above,
below, or inside characters . Typically, however, words are written without
diacritics and vowel sounds are determined from the context.</para><para lang="en">In Arabic, diacritical marks can appear above (single or double diacritic)
or below (single diacritic) any character. In the Arabic language engine,
diacritics are entered as separate keystrokes and occupy the same cell as
their associated character.</para><para lang="en">In Thai, diacritical marks appear above or below the base line containing
consonants, vowels, symbols, and numbers. In the Thai language engine, diacritics
are entered as separate keystrokes and occupy the same cell as their associated
character.</para></sect2><sect2 id="chapter1-11" lang="en"><title lang="en"><gentext type="text">1.4.4 </gentext>Character Clusters</title><para lang="en">A <emphasis lang="en">character cluster</emphasis> is a collection of alphabetic
characters forming a single word or syllable.</para><para lang="en">A Hebrew character cluster can contain characters and diacritics, though
diacritics are not often used. </para><para lang="en">Character clusters are integral to written text in Thai. A Thai character
cluster consists of up to four parallel lines:</para><itemizedlist lang="en" mark="bullet"><listitem lang="en"><para lang="en">Base line of consonant, vowel, or symbol</para></listitem><listitem lang="en"><para lang="en">Lower line of lower vowel or diacritic</para></listitem><listitem lang="en"><para lang="en">Upper line of upper vowel or diacritic</para></listitem><listitem lang="en"><para lang="en">Line above the upper line for tone marks and upper diacritics</para></listitem></itemizedlist><para lang="en">One or more elements may change shape in the presence of other elements.
In the Thai language engine, a character cluster occupies one display cell.
Depending on the composition, one display cell can contain up to three input
characters, as shown in <link linkend="chapter1-fig-5" lang="en">Figure 1-5</link>.</para><figure float="0" id="chapter1-fig-5" lang="en"><gentext type="text">Figure 1-5 </gentext><title lang="en">Thai-language character cluster</title><graphic filename="figures/Fig1-5.tiff.gif" width="149" depth="37" lang="en"/></figure></sect2></sect1><sect1 id="chapter1-12" lang="en"><title lang="en"><gentext type="text">1.5 </gentext>Input and Text Handling</title><para lang="en">The Solaris operating environment locales support text input in a number
of different writing systems. In the UTF-8 locale, to choose an input mode,
press the <computeroutput moreinfo="none" lang="en">Compose</computeroutput> key and a two-letter code
as in <link linkend="chapter1-tbl-1" lang="en">Table 1-1</link>. For example, to input text in Thai,
press <computeroutput moreinfo="none" lang="en">Compose+tt</computeroutput>. Alternatively, click the
status area and select an input mode. (To select the English/European input
mode, press <computeroutput moreinfo="none" lang="en">Control+Space</computeroutput>.)</para><note lang="en" role="note"><gentext type="text">Note - </gentext><para lang="en">In a CTL locale, to toggle between the English/European and CTL locale,
press <computeroutput moreinfo="none" lang="en">Control+Space</computeroutput>. </para></note><para lang="en">The bottom left corner of the text window displays the current input
mode, as shown in <link linkend="chapter1-fig-6" lang="en">Figure 1-6</link>.</para><figure float="0" id="chapter1-fig-6" lang="en"><gentext type="text">Figure 1-6 </gentext><title lang="en">Current input mode (Thai)</title><graphic filename="figures/Fig1-6.tiff.gif" width="366" depth="237" scale="70" lang="en"/></figure><para lang="en">The user can mix text between English and the CTL language locale (Arabic,
Hebrew, Thai) by switching input modes. The formatting rules governing the
input stream are managed by the application.</para><table frame="topbot" id="chapter1-tbl-1" lang="en"><gentext type="text">Table 1-1 </gentext><title lang="en">UTF-8 Input Mode two-letter codes</title><tgroup cols="2" colsep="0" rowsep="0" lang="en"><colspec colname="colspec0" colwidth="50*"/><colspec colname="colspec1" colwidth="50*"/><thead lang="en"><row rowsep="1" lang="en"><entry lang="en"><para lang="en">Language</para></entry><entry lang="en"><para lang="en">Code</para></entry></row></thead><tbody lang="en"><row lang="en"><entry colname="colspec0" lang="en"><para lang="en">Cyrillic</para></entry><entry colname="colspec1" lang="en"><para lang="en"><computeroutput moreinfo="none" lang="en">cc</computeroutput></para></entry></row><row lang="en"><entry colname="colspec0" lang="en"><para lang="en">Greek</para></entry><entry colname="colspec1" lang="en"><para lang="en"><computeroutput moreinfo="none" lang="en">gg</computeroutput></para></entry></row><row lang="en"><entry colname="colspec0" lang="en"><para lang="en">Thai</para></entry><entry colname="colspec1" lang="en"><para lang="en"><computeroutput moreinfo="none" lang="en">tt</computeroutput></para></entry></row><row lang="en"><entry colname="colspec0" lang="en"><para lang="en">Arabic</para></entry><entry colname="colspec1" lang="en"><para lang="en"><computeroutput moreinfo="none" lang="en">ar</computeroutput></para></entry></row><row lang="en"><entry colname="colspec0" lang="en"><para lang="en">Hebrew</para></entry><entry colname="colspec1" lang="en"><para lang="en"><computeroutput moreinfo="none" lang="en">hh</computeroutput></para></entry></row><row lang="en"><entry colname="colspec0" lang="en"><para lang="en">Unicode Hex</para></entry><entry colname="colspec1" lang="en"><para lang="en"><computeroutput moreinfo="none" lang="en">uh</computeroutput></para></entry></row><row lang="en"><entry colname="colspec0" lang="en"><para lang="en">Unicode Octal</para></entry><entry colname="colspec1" lang="en"><para lang="en"><computeroutput moreinfo="none" lang="en">uo</computeroutput></para></entry></row><row lang="en"><entry colname="colspec0" lang="en"><para lang="en">Lookup</para></entry><entry colname="colspec1" lang="en"><para lang="en"><computeroutput moreinfo="none" lang="en">ll</computeroutput></para></entry></row><row lang="en"><entry colname="colspec0" lang="en"><para lang="en">English/European</para></entry><entry colname="colspec1" lang="en"><para lang="en"><computeroutput moreinfo="none" lang="en">Control+Space</computeroutput></para></entry></row></tbody></tgroup></table><note lang="en" role="note"><gentext type="text">Note - </gentext><para lang="en">To switch modes, press <computeroutput moreinfo="none" lang="en">Compose+code</computeroutput>.
On a X86 machine, use <computeroutput moreinfo="none" lang="en">Ctrl+Shift+F1</computeroutput> as the <computeroutput moreinfo="none" lang="en">Compose</computeroutput> key.</para></note><para lang="en">CTL text can also be input with a lookup table as shown in <link linkend="chapter1-fig-7" lang="en">Figure 1-7</link>.</para><figure float="0" id="chapter1-fig-7" lang="en"><gentext type="text">Figure 1-7 </gentext><title lang="en">Lookup Thai input mode</title><graphic filename="figures/Fig1-7.tiff.gif" width="358" depth="69" scale="30" lang="en"/></figure><para lang="en">To view a lookup table, click the status area, [Lookup], and a Lookup
input mode. To input a character, click the character. </para><sect2 id="chapter1-13" lang="en"><title lang="en"><gentext type="text">1.5.1 </gentext>Cursor Positioning</title><para lang="en">The default cursor position is the upper left corner of the screen.
The cursor direction depends on the input mode (left-to-right for Western
languages and right-to-left for Arabic and Hebrew). The cursor position is
determined after the second keystroke. </para><para lang="en">In English and other Western languages, the cursor redisplays to the
right of each keystroke. In Hebrew and Arabic, the cursor remains stationary,
with the character stream appearing to the right or left of the cursor, depending
on the page alignment.</para><para lang="en">In Thai, the character cluster is composed to the left of the cursor.
If a set of two or three keystrokes belong to the same cluster, the language
engine values these keystrokes as zero and the cursor remains in place. The
cursor moves to the right as each cluster is composed.</para><note lang="en" role="note"><gentext type="text">Note - </gentext><para lang="en">Cursor attributes can be reconfigured in the application resource file.
For more information,  see Step 4 in Section 3.1 <citetitle lang="en">CTL Motif Resources</citetitle>.</para></note></sect2><sect2 id="chapter1-14" lang="en"><title lang="en"><gentext type="text">1.5.2 </gentext>Character and Cell Deletion</title><para lang="en">To manage editing character clusters, the CTL language supports both <emphasis lang="en">character-based deletion</emphasis> and <emphasis lang="en">cell-based deletion</emphasis>.
In character-based deletion, the user deletes the separate elements of the
character cluster with each press of the <computeroutput moreinfo="none" lang="en">Delete</computeroutput>
key. In cell-based deletion, the user deletes the entire cluster with one
keystroke.</para><para lang="en">The two deletion modes can be assigned to separate keys on the keyboard
using translation and resources. For more information, see Step 3 in <link linkend="chapter3-2" lang="en">Section 3.1 <citetitle lang="en">CTL Motif Resources</citetitle></link>.</para></sect2><sect2 id="chapter1-15" lang="en"><title lang="en"><gentext type="text">1.5.3 </gentext>Processing Stored Text</title><para lang="en">In the Solaris operating environment, all CTL text is stored in <emphasis lang="en">logical</emphasis> order--the order of the character input stream. The
CTL language engines manage the transformation from CTL scripts to final display
form on screen.</para><para lang="en">Most legacy systems containing CTL text store data in <emphasis lang="en">physical</emphasis> order--the order represented on screen. This was done because
there was no processing capability at the terminal for reading and correctly
rendering logical input. Screens of text were stored and then read again to
screen.</para><para lang="en">Applications can read legacy data using the CTL language engines by
configuring the appropriate language engine modifier. For more information,
see Step 1 in <link linkend="chapter3-2" lang="en">Section 3.1 <citetitle lang="en">CTL Motif
Resources</citetitle></link>.</para><para lang="en">For other language-engine configuration parameters, see <citetitle lang="en">CAE Specification: Portable Layout Services (ISBN 1-85912-142-X)</citetitle>.</para></sect2></sect1><sect1 id="chapter1-16" lang="en"><title lang="en"><gentext type="text">1.6 </gentext>Numbers and Dates</title><para lang="en">For numbers, most countries use the "Arabic" or Western format of ten
digits: 1 2 3 4 5 6 7 8 9 0. Some Arabic countries, however, use <emphasis lang="en">Hindi</emphasis> digits.</para><figure float="0" id="chapter1-fig-8" lang="en"><gentext type="text">Figure 1-8 </gentext><title lang="en">Hindi digits</title><graphic filename="figures/Fig1-8.tiff.gif" width="326" depth="29" scale="80" lang="en"/></figure><para lang="en"/><para lang="en">The Solaris operating environment supports both Arabic and Hindi digits.
By default, Western language input modes display Arabic numbers while the
Arabic input mode displays Hindi numbers, though this is configurable by the
user. To change the default, see Step 1 in <link linkend="chapter3-2" lang="en">Section
3.1 <citetitle lang="en">CTL Motif Resources</citetitle></link>.</para><para lang="en">Arabic countries use both the Gregorian (Western) and Hijri (Islamic)
date systems. These and other numeric data, such as time and monetary formats
and currency symbol, are managed by the Solaris operating environment locale
settings.</para></sect1><sect1 id="chapter1-17" lang="en"><title lang="en"><gentext type="text">1.7 </gentext>Summary</title><para lang="en">CTL languages require complex transformations to properly display or
print characters. The fundamental characteristics of CTL languages are:</para><itemizedlist lang="en" mark="bullet"><listitem lang="en"><para lang="en">Bidirectional text--Arabic and Hebrew are written right
to left, but numbers and Roman-based characters are written left to right. </para></listitem><listitem lang="en"><para lang="en">Contextual analysis--each Arabic character has up to
four display representations. The representation glyph depends on its position
in the text. </para></listitem><listitem lang="en"><para lang="en">Ligatures--combinations of two or more Arabic characters
can form a different, single character. </para></listitem><listitem lang="en"><para lang="en">Diacritics--diacritical marks placed above, below, or
inside vowels and consonants modify their tonal value. </para></listitem><listitem lang="en"><para lang="en">Character clusters--syllables and cells, especially in
Thai, are composed of several alphabetic elements, including vowels, consonants,
diacritics, and tone marks. </para></listitem><listitem lang="en"><para lang="en">Number and date formats--some Arabic countries use Hindi
digits rather than Arabic digits, and the Islamic calendar rather than the
Western calendar.</para></listitem></itemizedlist><para lang="en">Motif interfaces with PLS which interfaces with the CTL language engines.
Applications that make use of Motif services need not address CTL issues directly
because all CTL transformations and rendering are handled transparently.</para></sect1></chapter><chapter id="chapter2-1" lang="en"><gentext type="text">Chapter 2</gentext><gentext type="toc">2.  Technical Considerations</gentext><title lang="en">Technical Considerations</title><highlights lang="en"><para lang="en">This chapter outlines the implementation of CTL support in the Solaris
operating environment.</para><itemizedlist lang="en" mark="bullet"><listitem lang="en"><para lang="en">Architecture</para></listitem><listitem lang="en"><para lang="en">Multiscript support</para></listitem><listitem lang="en"><para lang="en">Representation management</para></listitem><listitem lang="en"><para lang="en">CTL locales</para></listitem></itemizedlist></highlights><sect1 id="chapter2-2" lang="en"><title lang="en"><gentext type="text">2.1 </gentext>Architecture</title><para lang="en">CTL language support in the Solaris operating environment comprises
a set of extensions supporting transformations between text input and text
output.</para><para lang="en">The CTL language engines enable the CDE/Motif drawing and measurement
API for character shaping, such as ligatures and diacritics, the transformation
of static and dynamic text widgets, and right-to-left and left-to-right text
alignment and tabbing. Because text rendering is handled through the rendition
layer, other widget libraries can be extended to support CTL.</para><para lang="en">The new CTL features require the Portable Layout Services (PLS) library
and the appropriate language engine. CTL uses PLS as the interface to the
language engines to transform text before rendering.</para><note lang="en" role="note"><gentext type="text">Note - </gentext><para lang="en">1. There are no changes to the Motif public APIs. A few resources have
been added, but all old resources still work.</para><para lang="en">2. Existing applications can inherit CTL support by adding the resources
without changing any source code.</para></note><figure float="0" id="chapter2-fig-1" lang="en"><gentext type="text">Figure 2-1 </gentext><title lang="en">CTL language architecture</title><graphic filename="figures/Fig2-1.eps.gif" width="759" depth="366" lang="en"/></figure><para lang="en">Desktop and Motif applications, at the top of the stack, use Motif functionality
to render text. Motif interfaces with the language engines using PLS. PLS
needs to know the current locale only when calling the appropriate language
engine.</para><para lang="en">The language engines perform character transformations for shaping and
reordering text. The character stream can come from keyboard input, an application's
text strings, or a file.</para><note lang="en" role="note"><gentext type="text">Note - </gentext><para lang="en">Because the CTL architecture easily supports new languages, Sun may
develop new language engines in future.</para></note><para lang="en"> </para></sect1><sect1 id="chapter2-3" lang="en"><title lang="en"><gentext type="text">2.2 </gentext>Multiscript Support</title><para lang="en">Because of the CTL framework, Unicode characters and CTL
features can easily be presented together in a Unicode locale. </para><para lang="en">The UTF-8 locales use the Universal Multiscript Language Engine (UMLE).
UMLE is controlled by the utility <computeroutput moreinfo="none" lang="en">genlayouttbl(1)</computeroutput>
which can be used to add/customize the script layout. For more information
about this utility and the Universal Multiscript Language Engine, see the <computeroutput moreinfo="none" lang="en">genlayouttbl(1)</computeroutput> man pages. <link linkend="chapter2-fig-2" lang="en">Figure 2-2</link>
shows a sample multiscript e-mail in <computeroutput moreinfo="none" lang="en">dtmail</computeroutput>
(<computeroutput moreinfo="none" lang="en">en_US.UTF-8</computeroutput> locale).</para><figure float="0" id="chapter2-fig-2" lang="en"><gentext type="text">Figure 2-2 </gentext><title lang="en">Multiscript e-mail in <computeroutput moreinfo="none" lang="en">dtmail</computeroutput> (en_US.UTF-8
locale)</title><graphic filename="figures/Fig2-2.tiff.gif" width="372" depth="344" scale="60" lang="en"/></figure></sect1><sect1 id="chapter2-4" lang="en"><title lang="en"><gentext type="text">2.3 </gentext>Representation Management</title><para lang="en">The various components of the CTL stack manage different functions of
the string, processing, and display of CTL language characters and symbols. </para><para lang="en">The language engines are responsible for all aspects of character formation
and rendering in the appropriate language. The language engines support the
following shaping and reordering features:</para><itemizedlist lang="en" mark="bullet"><listitem lang="en"><para lang="en">Bidirectionality</para></listitem><listitem lang="en"><para lang="en">Symmetrical swapping</para></listitem><listitem lang="en"><para lang="en">Numeral shaping</para></listitem><listitem lang="en"><para lang="en">Contextual analysis</para></listitem><listitem lang="en"><para lang="en">Positional variation</para></listitem><listitem lang="en"><para lang="en">Ligation</para></listitem><listitem lang="en"><para lang="en">Diacritics</para></listitem><listitem lang="en"><para lang="en">Character clusters</para></listitem></itemizedlist><para lang="en">The language engine algorithms apply language-specific rules to the
input stream and return the appropriate glyphs for rendering by the <computeroutput moreinfo="none" lang="en">X11</computeroutput> rendition layer. </para><para lang="en">Motif is responsible for all on screen text manipulations, including: </para><itemizedlist lang="en" mark="bullet"><listitem lang="en"><para lang="en">Cursor positioning</para></listitem><listitem lang="en"><para lang="en">Highlighting</para></listitem><listitem lang="en"><para lang="en">Text selection</para></listitem><listitem lang="en"><para lang="en">Cut and paste</para></listitem><listitem lang="en"><para lang="en">Insert/delete</para></listitem></itemizedlist><para lang="en">Motif also manages the flow of the character input stream so that the
language engine receives only CTL characters for processing. </para><para lang="en">The application manages the physical layout of text, including alignment,
justification, word demarcation, and other page-formatting features. The application
also manages the collation of CTL text, non-processed text, and locale-specific
information. For example, when displaying currency strings, the application
collates the processed number stream and the current locale's monetary format
and currency symbol.</para></sect1><sect1 id="chapter2-5" lang="en"><title lang="en"><gentext type="text">2.4 </gentext>CTL Locales</title><para lang="en">The Solaris operating environment provides the following CTL locales.</para><table frame="topbot" id="chapter2-tbl-1" lang="en"><gentext type="text">Table 2-1 </gentext><title lang="en">CTL Locales</title><tgroup cols="4" colsep="0" rowsep="0" lang="en"><colspec colname="colspec2" colwidth="20.78*"/><colspec colname="colspec3" colwidth="15.50*"/><colspec colname="colspec4" colwidth="22.46*"/><colspec colname="colspec5" colwidth="41.26*"/><thead lang="en"><row rowsep="1" lang="en"><entry lang="en"><para lang="en">Locale</para></entry><entry lang="en"><para lang="en">Codeset</para></entry><entry lang="en"><para lang="en">Typeface</para></entry><entry lang="en"><para lang="en">Conversion</para></entry></row></thead><tbody lang="en"><row lang="en"><entry lang="en"><para lang="en">Arabic: ar_AR</para></entry><entry lang="en"><para lang="en">iso8859-6</para></entry><entry lang="en"><para lang="en">Akhbar, Shayyal, Naskh (Regular and Bold)</para></entry><entry lang="en"><para lang="en">8859-6 &lt;-&gt; UTF-88859-6 &lt;-&gt; Win1256</para></entry></row><row lang="en"><entry lang="en"><para lang="en">Hebrew: he_HE</para></entry><entry lang="en"><para lang="en">iso8859-8</para></entry><entry lang="en"><para lang="en">Arial, CourierNew, TimesNewRoman, LucidaSans (Regular, Bold,
Italic, and BoldItalic)</para></entry><entry lang="en"><para lang="en">8859-8 &lt;-&gt; UTF-8</para></entry></row><row lang="en"><entry colname="colspec2" lang="en"><para lang="en">Thai: th_TH</para></entry><entry colname="colspec3" lang="en"><para lang="en">iso8859-11 (TIS620.2533)</para></entry><entry colname="colspec4" lang="en"><para lang="en">AngsanaUPC,
BrowaliaUPC, CordiaUPC, Lucida (Medium, Bold, Italic, and BoldItalic)</para></entry><entry colname="colspec5" lang="en"><para lang="en">8859-11 &lt;-&gt; UTF-8</para></entry></row><row lang="en"><entry colname="colspec2" lang="en"><para lang="en">*.UTF-8</para></entry><entry colname="colspec3" lang="en"><para lang="en">Unicode 3.0</para></entry><entry colname="colspec4" lang="en">All of the above</entry><entry colname="colspec5" lang="en">UTF-8 &lt;-&gt; ISO 646(ASCII)UTF-8&lt;-&gt;ISO 8859-1 ~ -11, -15UTF-8&lt;-&gt;KOI8-R&lt;-&gt;UCS-2UTF-8&lt;-&gt;UTF-7UTF-8&lt;-&gt;UTF-16&lt;-&gt;UCS-4,UTF-8&lt;-&gt;PCK(aka SJIS)UTF-8&lt;-&gt;various euc encodingsUTF-8&lt;-&gt;ISO-2022-JP ~ -TW, -KR, -CNUTF-8&lt;-&gt;BIG5UTF-8&lt;-&gt;GBKUTF-8&lt;-&gt;IBM MBCS CP933, CP935, CP937</entry></row></tbody></tgroup></table><note lang="en" role="note"><gentext type="text">Note - </gentext><para lang="en">CTL locales must be installed before CTL applications can be used.</para></note></sect1></chapter><chapter id="chapter3-1" lang="en"><gentext type="text">Chapter 3</gentext><gentext type="toc">3.  Adding CTL Support to an Application</gentext><title lang="en">Adding CTL Support to an Application</title><highlights lang="en"><para lang="en">Adding CTL support to an application requires little or no change to
the source code. Certain resources are set in the resource file to control
the behavior of the language engine for all <computeroutput moreinfo="none" lang="en">Text</computeroutput>, <computeroutput moreinfo="none" lang="en">TextField</computeroutput>, and other static text.  </para><para lang="en">If an application was compiled in an earlier version of Solaris, the
code should be recompiled in Solaris 8. Ensure that the application
is linked to the default Motif library in Solaris 8 (<computeroutput moreinfo="none" lang="en">libXm.so</computeroutput>) which is linked to the latest Motif library (<computeroutput moreinfo="none" lang="en">libXm.so.4</computeroutput>). Add the flag <computeroutput moreinfo="none" lang="en">-DSUN_CTL</computeroutput>
to Makefiles for compilation. </para><para lang="en">For finer control over CTL attributes, such as cursor positioning and
character and cell deletion, use the APIs provided in PLS with its configuration
file. For more information about the Portable Layout Services APIs, see <citetitle lang="en">CAE Specification: Portable Layout Services: ISBN 1-85912-142-X</citetitle> </para></highlights><sect1 id="chapter3-2" lang="en"><title lang="en"><gentext type="text">3.1 </gentext>CTL Motif Resources</title><para lang="en">To control CTL functionality in an application, use the following Motif
resources: </para><orderedlist continuation="restarts" lang="en"><listitem lang="en"><para lang="en"><computeroutput moreinfo="none" lang="en">layoutModifier</computeroutput> </para></listitem><listitem lang="en"><para lang="en">Visual mode</para></listitem><listitem lang="en"><para lang="en">Default keystroke override</para></listitem><listitem lang="en"><para lang="en"><computeroutput moreinfo="none" lang="en">layoutDirection</computeroutput></para></listitem><listitem lang="en"><para lang="en">Dynamically switch screen layout </para></listitem></orderedlist><para lang="en">Step 1. Control the behavior of the language engine through the <computeroutput moreinfo="none" lang="en">layoutModifier</computeroutput> resource in the application resource file.
For example, the default numeral type, text type, and text orientation can
be changed using the following resource:<computeroutput moreinfo="none" lang="en">*layoutModifier:
@ls numerals=nominal:contextual,</computeroutput><computeroutput moreinfo="none" lang="en">typeoftext=implicit:visual, orientation=ltr:rtl</computeroutput></para><table frame="topbot" id="chapter3-tbl-2" lang="en"><gentext type="text">Table 3-1 </gentext><title lang="en">Common Modifiers</title><tgroup cols="3" colsep="0" rowsep="0" lang="en"><colspec colname="colspec6" colwidth="23.82*"/><colspec colname="colspec7" colwidth="20.42*"/><colspec colname="colspec8" colwidth="54.75*"/><thead lang="en"><row rowsep="1" lang="en"><entry lang="en"><para lang="en">Modifier</para></entry><entry lang="en"><para lang="en">Values</para></entry><entry lang="en"><para lang="en">Description</para></entry></row></thead><tbody lang="en"><row lang="en"><entry colname="colspec6" lang="en"><para lang="en">orientation=in:out</para></entry><entry colname="colspec7" lang="en"><para lang="en">ltr</para></entry><entry colname="colspec8" lang="en"><para lang="en">left-to-right global orientation (default in and out) </para></entry></row><row lang="en"><entry colname="colspec6" lang="en"><para lang="en"/></entry><entry colname="colspec7" lang="en"><para lang="en">rtl</para></entry><entry colname="colspec8" lang="en"><para lang="en">right-to-left global orientation</para></entry></row><row lang="en"><entry colname="colspec6" lang="en"><para lang="en"/></entry><entry colname="colspec7" lang="en"><para lang="en">contextual</para></entry><entry colname="colspec8" lang="en"><para lang="en">context-sensitive
orientation</para></entry></row><row lang="en"><entry colname="colspec6" lang="en"><para lang="en">numerals=in:out</para></entry><entry colname="colspec7" lang="en"><para lang="en">nominal </para></entry><entry colname="colspec8" lang="en"><para lang="en">Arabic numerals (Latin) (default in) </para></entry></row><row lang="en"><entry colname="colspec6" lang="en"><para lang="en"/></entry><entry colname="colspec7" lang="en"><para lang="en">national  </para></entry><entry colname="colspec8" lang="en"><para lang="en">national shaping
of numerals</para></entry></row><row lang="en"><entry colname="colspec6" lang="en"><para lang="en"/></entry><entry colname="colspec7" lang="en"><para lang="en">contextual</para></entry><entry colname="colspec8" lang="en"><para lang="en">numeral shaping based
on the context of the surrounding text (default out)</para></entry></row><row lang="en"><entry colname="colspec6" lang="en"><para lang="en">swapping=value</para></entry><entry colname="colspec7" lang="en"><para lang="en">yes</para></entry><entry colname="colspec8" lang="en"><para lang="en">enable symmetric swapping
(default) </para></entry></row><row lang="en"><entry colname="colspec6" lang="en"><para lang="en"/></entry><entry colname="colspec7" lang="en"><para lang="en">no</para></entry><entry colname="colspec8" lang="en"><para lang="en">disable symmetric swapping </para></entry></row><row lang="en"><entry colname="colspec6" lang="en"><para lang="en">typeoftext=in:out</para></entry><entry colname="colspec7" lang="en"><para lang="en">visual</para></entry><entry colname="colspec8" lang="en"><para lang="en">visual order (default out) </para></entry></row><row lang="en"><entry colname="colspec6" lang="en"><para lang="en"/></entry><entry colname="colspec7" lang="en"><para lang="en">implicit</para></entry><entry colname="colspec8" lang="en"><para lang="en">logical order (default
in) </para></entry></row><row lang="en"><entry colname="colspec6" lang="en"><para lang="en"/></entry><entry colname="colspec7" lang="en"><para lang="en">explicit</para></entry><entry colname="colspec8" lang="en"><para lang="en">logical order with
embedded control</para></entry></row></tbody></tgroup></table><para lang="en">For a complete list of layout modifiers, see <citetitle lang="en">Portable Layout
Services: Context-Dependent and Directional Text: ISBN 1-85912-075-X</citetitle>.</para><para lang="en">Step 2. Configure Hebrew and Arabic locales to support Visual mode for
editing in the resource file as follows: <computeroutput moreinfo="none" lang="en">*editPolicy:
XmEDIT_VISUAL</computeroutput> (default is <computeroutput moreinfo="none" lang="en">XmEDIT_LOGICAL</computeroutput>)</para><para lang="en">Step 3. To <emphasis lang="en">override</emphasis> the default keystrokes in an
application, make the necessary changes in the resource file, as shown in
the following example: <programlisting format="linespecific" lang="en" role="fragment">*XmText.translations: #override \n\
c &lt;Key&gt;q:right-word() \n\
c &lt;Key&gt;w:left-word() \n\
c &lt;Key&gt;g:forward-word(extend) \n\
c &lt;Key&gt;h:backward-word(extend) \n\
c &lt;Key&gt;f:next-line(extend) \n\
c &lt;Key&gt;b:previous-line(extend) \n\
c &lt;Key&gt;&gt;:right-character() \n\
c &lt;Key&gt;&lt;:left-character() \n\
c &lt;Key&gt;t:prev-cell() \n\
c &lt;Key&gt;v:forward-cell() \n\
c &lt;Key&gt;+:delete-right-word() \n\
c &lt;Key&gt;-:delete-left-word() \n\
c &lt;Key&gt;r:right-character(extend) \n\
c &lt;Key&gt;l:left-character(extend) </programlisting></para><para lang="en">Step 4. The Motif resource <computeroutput moreinfo="none" lang="en">layoutDirection</computeroutput>
can be used to set the right to left screen layout. In this screen mode, the
screen origin is the top right corner and all application Motif widgets are
mirrored. The following example shows how to set this in the resource file:<computeroutput moreinfo="none" lang="en">*layoutDirection: XmBOTTOM_TO_TOP_RIGHT_TO_LEFT</computeroutput></para><para lang="en">This resource changes the layout of the whole application. To change
the layout of some widgets only, such as <computeroutput moreinfo="none" lang="en">Text</computeroutput>
or <computeroutput moreinfo="none" lang="en">TextField</computeroutput>, use the following:<programlisting format="linespecific" lang="en" role="fragment">*XmText*layoutDirection: XmBOTTOM_TO_TOP_RIGHT_TO_LEFT
*XmTextField*layoutDirection: XmBOTTOM_TO_TOP_RIGHT_TO_LEFT</programlisting></para><para lang="en">Step 5. The screen layout can be dynamically switched for the <computeroutput moreinfo="none" lang="en">Text</computeroutput> and <computeroutput moreinfo="none" lang="en">TextField</computeroutput> widgets
by defining the dynamic switching hot keys in the Motif translation table.
The following example shows how to add this function to the resource file:</para><para lang="en">1-<computeroutput moreinfo="none" lang="en">Text</computeroutput>: <programlisting format="linespecific" lang="en" role="fragment"> *XmText.translations: #override \n\
Ctrl&lt;Key&gt;m:toggle-rtl-mode()</programlisting>2-<computeroutput moreinfo="none" lang="en">TextField</computeroutput>: <programlisting format="linespecific" lang="en" role="fragment">*XmTextField.translations: #override \n\
Ctrl&lt;Key&gt;m:toggle-rtl-mode()  </programlisting></para><note lang="en" role="note"><gentext type="text">Note - </gentext><para lang="en"><computeroutput moreinfo="none" lang="en">CTRL+m</computeroutput> is defined as the key combination
to dynamically switch the screen layout. Any key combination which doesn't
interfere with the application hot keys can be defined instead. This entry
can also be appended to the original key translation table as discussed in
Step 3 above. </para></note></sect1><sect1 id="chapter3-3" lang="en"><title lang="en"><gentext type="text">3.2 </gentext>CTL Printing</title><para lang="en">Each locale provides text input and display in the locale language and
in English. Solaris 8 also includes the print utilities <computeroutput moreinfo="none" lang="en">ctlmp</computeroutput> and <computeroutput moreinfo="none" lang="en">ctlconvert_text</computeroutput> which
can be used to print the CTL text. </para><itemizedlist lang="en" mark="bullet"><listitem lang="en"><para lang="en"><computeroutput moreinfo="none" lang="en">ctlmp</computeroutput> creates a PostScript
file from a text file created in a CTL locale. The utility performs the necessary
CTL transformations and ensures WYSIWYG printing support. For more information
on <computeroutput moreinfo="none" lang="en">ctlmp</computeroutput>, see <computeroutput moreinfo="none" lang="en">man ctlmp</computeroutput>. </para></listitem><listitem lang="en"><para lang="en"><computeroutput moreinfo="none" lang="en">ctlconvert_text</computeroutput> creates a
standard print file from a text file created  in a CTL locale for printing
on non-PostScript devices.</para></listitem></itemizedlist></sect1></chapter></book>