Sfairadora

  • Reference Guide

Rich_cformat_def

The definition type corresponding to the Rich_cformat type. It is a sequence of Rich_cformat_element_def elements. Every element optionally specifies a name of a character style and a structure with the character format attributes or a reference to a character style. Format attributes include font name, font size, color, etc. Individual elements of a format typically do not define all attributes of the format – a style may define only some of the attributes; similarly, a structure with the character format attributes does not necessarily need to define all attributes. The resulting set of attributes is obtained by going through the sequence of elements, and the value of each attribute is determined from the first element in which the value of the searched attributed is specified, either in a style referenced by name or directly in the attribute structure. If the value is specified both in the attribute structure and in the style, the value from the attribute structure takes precedence.
For example, if you wish to format a text by the Heading style and use bold font on top, a format containing one element is created, for which style is set to “Heading” and the only specified attribute is bold. On the other hand, if you wish to format a text by the Heading style and use blue color unless otherwise specified by the applied style, a format containing two elements is created: the first element contains only style, set to “Heading”, whereas the other element has no style assigned and the only specified attribute is font color, set to blue.

Type definition

Seq(Rich_cformat_element_def)

Rich_cformat_element_def

The structure that is the element type of the sequence Rich_cformat_def.
Type
Name
Description
String
style
The name of a character style. The attributes of the style are used when an attribute is not specified by the component char_attr.
Char_attr_struct
(see below)
char_attr
The attributes of the character format.

Char_attr_struct

Char_attr_struct is the structure containing the attributes of a character format. All the components are optional. If a component’s value is not present, the value of the corresponding attribute is left unspecified.
If a physical dimension is to be specified, it is expressed in twips (twentieths of point).
Type
Name
Description
Data_type optional
extension_type
The type of the extension data pertaining to the style. (E.g. for the hyperlink style, it contains the Url type – a named version of the type String).
Union optional
extension
An extension of the style. If the style is hyperlink, it contains a URL of the link target.
When present, it must be of the type extension_type defined above.
Int optional
language
The language of the text.
One of the language constants.
String optional
font_name
Font name.
Int optional
font_family
A general look of the font. One of the the font family constants.
Bool optional
font_proportional
TRUE, if the characters of the font have variable widths (i.e. FALSE for fonts like Courier).
Int optional
font_code_page
Code page.
(E.g.: 1252 – West Europe, 1250 – Central Europe…)
Int optional
font_size
The font size in half-points. Therefore, if the common font size 12 is to be used, the value 24 must be specified.
Color optional
fcolor
Text color.
Color optional
bcolor
Background color.
Int optional
uline
Underline style. One of the underline style constants.
Int optional
supersub
Superscript or subscript specification. One of the superscript and subscript constants.
Int optional
vpos
Vertical base line shift. Negative values shift the base line down, the positive up.
Int optional
expand
Increase (positive value) or decrease (negative values) of the character pitch.
Int optional
kerning
Minimum font size for using kerning pairs. The value is specified in half-points. The term kerning pair refers to selected pairs of characters (e.g. VA) that are to be shifted horizontally based on their shape, in order to maintain the same visual appearance of characters distance. This option will be used when drawing characters above the specified size.
Int optional
caps
Draw all characters in upper-case.
Values:
0
normal script (e.g.: John Smith)
1
all caps (e.g.: John Smith)
2
small caps (e.g.: John Smith)
Bool optional
bold
Bold
Bool optional
italic
Italic
Bool optional
outline
Outline characters
(Currently not implemented)
Bool optional
shadow
Characters drawn with shadow.
(Currently not implemented)
Bool optional
strike
Stricken characters
Bool optional
underline
Underlined characters. The underline style is determined by the attribute uline.
Bool optional
hidden
Hidden characters. Normally not drawn; however, a text editor can be configured to display even hidden text.
For instance, Enkidu language commands are marked with the hidden attribute.