version 6.0
DR SET TEXT ATTRIBUTES (area; scope; font; size; style; just{; frame{; expansion}})
| Parameter | Type | Description | |
| area | Longint | 4D Draw area | |
| scope | Longint | -3 = Selected characters, -2 = Default, -1 = All, | |
| 0 = Selected objects, >0 = Object ID | |||
| font | Integer | Font number (-1 = No change) | |
| size | Integer | Font size in points (-1 = No change) | |
| style | Integer | Font style (-1 = No change) | |
| just | Integer | Font justification (-1 = No change) | |
| frame | Integer | -1 = No change, 0 = Variable, 1 = Fixed | |
| expansion | Integer | -1 = No change, 0 = Down, 1 = Up |
Description
The command DR SET TEXT ATTRIBUTES changes the text attributes for the text or objects in area described by scope.
If scope equals -3, the command affects the text attributes for the highlighted text of the selected object.
If scope equals -2, the command sets the default text attributes.
If scope equals -1, the command sets the text attributes for all objects in the document.
If scope equals 0, the command sets the text attributes for the selected objects.
If scope is greater than 0, it must be equal to the ID of a specific text object; DR SET TEXT ATTRIBUTES sets that object's attributes. If the object does not exist, DR SET TEXT ATTRIBUTES does nothing, and DR Error returns error code 2.
The following table summarizes the possible values for scope:
| Scope | Affected text/objects |
| -3 | Highlighted text of selected object |
| -2 | Default text attributes |
| -1 | Text attributes for all objects |
| 0 | Text attributes for selected objects |
| >0 | Text attributes for a specific object |
font is the ID of the font in your system. You can determine the font ID by passing the font name to the DR Font number function.
size is the size in points of the highlighted text or text objects.
style is a number that is obtained by adding several style numbers. Style numbers are presented in the following list:
| Value | Style |
| 0 | Plain |
| 1 | Bold |
| 2 | Italic |
| 4 | Underline |
| 8 | Outlined |
| 16 | Shadowed |
just is the alignment of the text within the text block. The following table summarizes the possible values for just:
| Value | Justification |
| 0 | Left |
| 1 | Center |
| 2 | Right |
The optional frame parameter controls whether the text object has a fixed size. If frame equals 0 or is not specified, the height of the object is variable and is determined by the amount of text and the width of the text object. If frame equals 1, the height of the object is fixed and any text that does not fit within the text object is truncated. If frame is omitted, flow must also be omitted.
expansion describes which direction text will flow within the object when it wraps to the next line.
If expansion equals 0, the text object expands down the page to accommodate a new line of text.
If expansion equals 1, the text object expands up the page when a line of text is added.
frame and expansion are especially useful when working with text objects that contain references. As references can insert any amount of text, having control over the size and flow direction of text objects during printing can be useful.
Passing -1 for each of the last six parameters (font, size, style, just, frame, and expansion) will leave that attribute unchanged.
Example
The following example sets the text attributes for all text objects in the document. It leaves the same font but makes all text 12-point, plain, and left justified.
DR SET TEXT ATTRIBUTES (Area;-1;-1;12;0;0;-1;-1)
See Also