DR GET TEXT ATTRIBUTES

4D - Documentation   Français   English   German   4D Draw 2004, Command Theme List   4D Draw 2004, Command Alphabetical List   Back   Previous   Next

version 6.0


DR GET TEXT ATTRIBUTES (area; scope; font; size; style; justification; frame; expansion)

ParameterTypeDescription
areaLongint4D Draw area
scopeLongint-3=Selected characters
-2=Default
-1=All
0=Selected objects
>0=Object ID
fontIntegerFont number
sizeIntegerFont size in points
styleInteger Font style
justificationIntegerFont justification
frameInteger0=Variable
1=Fixed
expansionInteger0=Down
1=Up

Description

The command DR GET TEXT ATTRIBUTES returns into the integer variables font, size, style, justification, frame, and expansion the text attributes for the text object(s) in area described by scope.

If scope equals -3, the command returns the text attributes for the highlighted text of the selected object. If the insertion point is between characters, DR GET TEXT ATTRIBUTES returns the attributes for the character to the left of the pointer.

If scope equals -2, the command returns the default text attributes.

If scope equals -1, the command returns the text attributes for all objects in the document.

If scope equals 0, the command returns the text attributes for the selected objects.

If scope is greater than 0, it must be equal to a specific object's ID; the command returns that object's attributes. If the object does not exist, DR GET TEXT ATTRIBUTES returns -32000 for each attribute, and DR Error returns error number 2.

font is the ID of the font in your system. This is the same value that is returned by the DR Font number function. You can use DR Font name to determine the name of the font (i.e., Arial, Chicago, and so on).

size is the size in points of the highlighted text or text objects.

style is a composite number that results from the addition of several style numbers. The following table lists style numbers:

ValueStyle
0Plain
1Bold
2Italic
4Underline
8Outlined
16Shadowed

justification is the alignment of the text within the text block. The following table lists the possible values for justification:

ValueJustification
0Left
1Center
2Right

If any of the attributes are not the same for all of the text objects described by scope, DR GET TEXT ATTRIBUTES returns -32000 for that attribute.

frame describes whether the text object has a fixed size.

If frame equals 0, 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.

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.

Example

The following example gets the text attributes for the selected objects and then displays an alert that tells the user the font name.

   DR GET TEXT ATTRIBUTES (Area;0;vFont;vSize;vStyle;vJust;vFrame;vFlow)
   If (vFont # -32000)
      ALERT ("You are using the font: " + DR Font name (vFont))
   End if

See Also

DR SET TEXT ATTRIBUTES.


4D - Documentation   Français   English   German   4D Draw 2004, Command Theme List   4D Draw 2004, Command Alphabetical List   Back   Previous   Next