In the absence of an AttrObject, the locale defaults to the locale
supported by the
More detailed descriptions of the different components of LayoutObject follow in subsequent sections.
The different descriptors are described briefly in the following
sections. The letters S and G indicate whether the value may be set or
retrieved as shown in
For descriptors that do not have an S indicator, the way in which their initial value is set is implementation dependent.
The descriptor Orientation specifies the global directional text orientation. Possible values are:
If there are no strong characters in the text and the descriptor is set to this value, the global orientation of the text is set according to the value of the descriptor Context. This option is meaningful only for bidirectional text.
The initial state for Orientation is dependent on the LayoutObject. If no value is present, the default is ORIENTATION_LTR.
If no value is specified, the default is CONTEXT_LTR.
The TypeOfText descriptor specifies the ordering of the directional text.
Characters may have a natural orientation attached to them as
described under
Consider the following possible embedded controls:
The LayoutObject preserves a bidirectional state across calls to the
Each LayoutObject is expected to provide transformation from each of the above types to any of the other types. However, some transformations may cause layout (directional) information to be lost so that text is presented differently after a round trip transformation. This does not imply any data loss, but only possible loss in layout information.
If the TypeOfText value is not specifically stated, the default (for the C locale) is TEXT_IMPLICIT.
The ImplicitAlg descriptor specifies the type of bidirectional implicit algorithm used in reordering and shaping of directional or context-dependent text.
Possible values of ImplicitAlg are:
Although the basic algorithm used when ImplicitAlg is set to ALGOR_BASIC, is an implicit algorithm, the fact that it recognises some control characters, allows it to be used even when the TypeOfText descriptor is set to TEXT_EXPLICIT.
Note that when TEXT_EXPLICIT is used in conjunction with ALGOR_BASIC, the controls may temporarily change the values of Swapping, Numerals and TextShaping. The ALGOR_IMPLICIT value may be equal to ALGOR_BASIC for a given implementation. Except in this case, it is not meaningful to have TypeOfText=TEXT_EXPLICIT at the same time as ImplicitAlg=ALGOR_IMPLICIT.
All the controls can be found in the referenced Unicode standard.
If the ImplicitAlg value is not specifically stated, the default (for the C locale) is ALGOR_IMPLICIT.
The Swapping descriptor specifies whether symmetric swapping is applied to the text. A list of symmetric swapping characters is given in the ISO/IEC 10646 standard. Possible values are:
If no value is present, the default (for the C locale) is SWAPPING_NO.
The Numerals descriptor specifies the shaping of numerals recognised by the LayoutObject. Possible values are:
An example of how national numbers can be defined
is by using the keyword national_number
in the layout category LO_LTYPE (see
If no value is specified the default value (for the C locale) is NUMERALS_NOMINAL.
The descriptor TextShaping specifies the shaping;
that is, choosing (or composing) the correct shape of the input or
output text.
Possible values of TextShaping are:
The set of shaping characters is limited to the codeset of the locale associated with the LayoutObject.
If no value is present, the default value (for the C locale) is TEXT_SHAPED.
In this document, the term shape form n is used to mean:
For example, if each capital letter represents a Jamo, a syllable HAN is presented as three decomposed Jamos of H, A and N.
If the descriptor ActiveDirectional is set (True), then the LayoutObject includes knowledge of directional code elements, and proper rendering of text implies reordering of directional code elements. Otherwise the LayoutObject does not require any reordering of directional code elements. The way the value of this layout value is set is implementation dependent.
The ActiveDirectional value is guaranteed to remain unchanged for the life of the LayoutObject.
If the descriptor ActiveShapeEditing is set (True), the LayoutObject includes knowledge of context-dependent code elements (an automatic shape determination algorithm) that require shaping for presentation to the ShapeCharset.
The user of a LayoutObject is then required to initiate or perform some shaping transformation prior to rendering the text.
Otherwise, the application that uses the LayoutObject does not perform shaping, and all code elements may be presented independent of the surrounding characters.
The method used to set ActiveShapeEditing is implementation defined. The ActiveShapeEditing value is guaranteed to remain unchanged for the life of the LayoutObject.
The descriptor ShapeCharset specifies the charset of the output text when text is shaped; that is, when ActiveShapeEditing is true. If ActiveShapeEditing is not set (False), in other words, shape editing is a null operation, the ShapeCharset is guaranteed to match the codeset associated with the locale of the LayoutObject.
A charset is defined as "an encoding with a uniform, state-independent mapping from character to code points".
A ShapeCharset is a well known name associated with some type of
presentation encoding usually used to identify the encoding of a font.
Yet, a ShapeCharset need not be a font encoding but may be some
intermediate encoding that can then be rendered to a specific font.
Since the ShapeCharset is associated with a specific font or glyph encoding, when ActiveShapeEditing is True, the ShapeCharset may (but need not) be the same as the codeset of the locale associated with the LayoutObject.
Once chosen, the ShapeCharset is guaranteed to be of a uniform size and state independent, but the size of each ShapeCharset may vary (for example, 8, 16 or another number of bits) so applications should use the ShapeCharsetSize value when doing storage management.
The descriptor ShapeCharsetSize specifies the encoding size of the current ShapeCharset. This value may change when the ShapeCharset is changed. If ActiveShapeEditing is not set (False) the ShapeCharsetSize is set to the maximum code element size (in bytes) for the codeset of the locale for the LayoutObject.
The ShapeContextSize specifies the size of the
context (surrounding code elements)
that must be accounted for when performing
active shape editing. The ShapeContextSize
is defined as structure of type LayoutEditSize,
(see discussion on LayoutEditSize in
The ShapeContextSize value is guaranteed to remain unchanged for the life of the LayoutObject.
This mask is set to tell the layout functions which text descriptors are initialised to valid values when either InOnlyTextDescr or OutOnlyTextDescr are set or queried. For example, if the InOutTextDescrMask is set to denote Orientation and TypeOfText, only these two descriptors are returned when the InOnlyTextDescr is queried. The values used in InOutTextDescrMask are actually a bitwise OR of one or more classification criteria.
The way in which these layout values are set is implementation dependent. By default, this descriptor is initialised to indicate that all the text descriptors are to be set and queried.
When this descriptor is set it indicates that the input values of
the layout values denoted by the InOutTextDescrMask are set or
retrieved when using
When this layout value is set it indicates that the output values of the
layout values denoted by the InOutTextDescrMask are set or retrieved when
using the
The CheckMode layout value indicates the level of checking of the elements in the InpBuf for shaping and reordering purposes. It also defines the behaviour of the implicit algorithm with respect to standalone neutral characters (until stabilised by a new strong character).
Possible values of CheckMode are:
The reordering of bidirectional text will assign the nesting level of an unstablised neutral character such that it follows the level of the previous strong character.
When MODE_STREAM is set, it is guaranteed that:
The reordering of bidirectional text will assign the nesting level of an unstablised neutral character such that it follows the level of the global orientation.
When MODE_EDIT is set:
When no value is present, the default of CheckMode (for the C locale) is MODE_STREAM.
The user is responsible for his own memory allocation (for the layout values to be queried); therefore he needs to know the actual size of each layout value to be queried.
The name QueryValueSize is defined. This can
be ORed with any other name. When
The following example illustrates the use of QueryValueSize:
unsigned long Size;
layout[0].name = QueryValueSize | ShapeCharSet;
layout[0].value = &Size;
layout[1].name = 0;
m_getvalues_layout(hlo,layout,&index);
/*Size should now contain the number of bytes needed
/*to hold ShapeCharSet*/
The following describe the data types used for some of the layout
values.
All layout values are defined in
The value of these layout values may also be combined (logic OR) into a
single attribute.
The layout value AllTextDescriptor can be used to
indicate that all
LayoutTextDescriptor
types are set (see
#include <sys/layout.h>
typedef struct{
LayoutId name; /* int - the id of the layout value*/
LayoutValue value; /* void* - Data of layout value item */
}LayoutValueRec, *LayoutValues;
The name element denotes the layout value to be set and the value element contains the data to be set. The LayoutValue data type is a C-language type large enough to contain the following: char*, long, int*, or a pointer to a function. The end of the array is indicated by a name of value zero (0).
The
#include <sys/layout.h>
typedef int LayoutDesc
typedef struct{
LayoutDesc inp; /* Input buffer description */
LayoutDesc out; /* Output buffer description */
} LayoutTextDescriptorRec, *LayoutTextDescriptor;
The inp and out values are combinations of the
appropriate descriptor items.
Each of the descriptors is specified as a
combination of one value from each of the following groups - a value for
the input descriptor and a corresponding value for the output descriptor.
structure typedef struct{
int front; /* number of code element in front of the */
/* edit position in logical order */
int back; /* number of code elements following the
/* edit position in logical order*/
} LayoutEditSizeRec, *LayoutEditSize;
When a substring is inserted into a string, the front and back elements
define the number of code elements in front of the substring and the
number of code elements after the substring respectively that need to
considered when performing edit shaping. The total number of code
elements needed to be viewed is:
total # of code elements =(front + # code elements in substring + back)
If both front and back elements are set to zero, no additional context
needs to be considered for edit shaping.
When ActiveShapeEditing is not set (False),
the front and back are guaranteed to be zero.
Each
LayoutObject
consists of several different layout values that are specified in
The following symbols are used in the proposed grammar for layout modifier strings:
Character | Description |
---|---|
, | Comma |
- | Hyphen |
/ | Solidus (Slash) |
; | Semi-colon |
= | Equal sign |
_ | Low line (Underscore) |
The following strings are used as prefixes within the grammar definition to mean:
The proposed grammar is as follows:
LSmodifier_string : '@ls' layout
layout : layout ',' layout_values
| layout_values
;
layout_values : orientation
| context
| typeoftext
| implicitalg
| swapping
| numerals
| shaping
| checkmode
| shapcharset
;
orientation : 'orientation=' inout_orient_value
| 'orientation=' in_orient_value ':' out_orient_value
;
inout_orient_value : orient_value
;
in_orient_value : orient_value
;
out_orient_value : orient_value
;
orient_value : 'ltr' | 'rtl' | 'ttblr' | 'ttbrl' | 'contextual'
;
context : 'context=' inout_context_value
| 'context=' in_context_value ':' out_context_value
;
inout_context_value: context_value
;
in_context_value : context_value
;
out_context_value : context_value
;
context_value : 'ltr' | 'rtl'
;
typeoftext : 'typeoftext=' inout_text_value
| 'typeoftext=' in_text_value ':' out_text_value
;
inout_text_value : text_value
;
in_text_value : text_value
;
out_text_value : text_value
;
text_value : 'visual' | 'implicit' | 'explicit'
;
implicitalg : 'implicitalg=' inout_algor_value
| 'implicitalg=' in_algor_value ':' out_algor_value
;
inout_algor_value : algor_value
;
in_algor_value : algor_value
;
out_algor_value : algor_value
;
algor_value : 'basic' | 'implicit'
;
swapping : 'swapping=' inout_swap_value
| 'swapping=' in_swap_value ':' out_swap_value
;
inout_swap_value : swap_value
;
in_swap_value : swap_value
;
out_swap_value : swap_value
;
swap_value : 'yes' | 'no'
;
numerals : 'numerals=' inout_num_value
| 'numerals=' in_num_value ':' out_num_value
;
inout_num_value : num_value
;
in_num_value : num_value
;
out_num_value : num_value
;
num_value : 'nominal' | 'national' | 'contextual'
;
shaping : 'shaping=' inout_shap_value
| 'shaping=' in_shap_value ':' out_shap_value
;
inout_shap_value : shap_value
;
in_shap_value : shap_value
;
out_shap_value : shap_value
;
shap_value : 'shaped' | 'nominal' | 'shform1' | 'shform2'
| 'shform3' | 'shform4'
;
checkmode : 'checkmode=' mode_value
;
mode_value : 'stream'| 'edit'
;
shapcharset : 'shapcharset=' charset_name
;
charset_name : char_list number
| number char_list
| char_list
| number
;
char_list : char_list char
| char
;
char : 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'G' | 'H'
| 'I' | 'J' | 'K' | 'L' | 'M' | 'N' | 'O' | 'P'
| 'Q' | 'R' | 'S' | 'T' | 'U' | 'V' | 'W' | 'X'
| 'Y' | 'Z'
| 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g' | 'h'
| 'i' | 'j' | 'k' | 'l' | 'm' | 'n' | 'o' | 'p'
| 'q' | 'r' | 's' | 't' | 'u' | 'v' | 'w' | 'x'
| 'y' | 'z'
| '!' | '%' | '(' | ')' | '*' | '+' | '-' | '.'
| '_' | '?' |
;
number : number digit
| digit
;
digit : '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7'
| '8' | '9'
;
The grammar can be adapted by the implementations to suit their particular needs and their possible extensions to the layout values.
It is expected that higher-level services will use the grammar above to provide users with customisation when running applications.
layoutDirection : right_to_left @ls swapping=yes, numerals=national
The key is that the Motif resource value says that right_to_left is the
orientation but says nothing about swapping or numerals. The @ls modifier
clarifies this.
@ls typeoftext=visual, orientation=rtl, swapping=no,
numerals=nominal, shapecharset=iso8859-8
Note that while this helps speed up presentation of the help text, searches of the help text cannot be made using logical-ordered text (which is the default when entered in an input field). This is because the text (type=visual) has been previously shaped and reordered and thus any text searches need some other processing to account for this.
[??] Some characters or strings that appear in the printed document are not easily representable using HTML.
Contents | Next section | Index |