C++
int acedTextBox( const struct resbuf * args, ads_point pt1, ads_point pt2 );
File
acedads.h
Description
Finds the coordinates of a box that encloses a text entity. Assumes that the origin is (0,0) and the rotation is 0 (or 270 if the text is vertical). If the text is located at a different point or is rotated, your program must handle these values explicitly.
If the text is horizontal and is not rotated, p1 (the bottom-left corner) and p2 (the top-right corner) describe the bounding box of the text. The coordinates are expressed in the ECS of ent, with the origin (0,0) at the left endpoint of the baseline. (The origin is not the bottom-left corner if the text contains letters with descenders, such as g and p.) If the text is vertical or rotated, p1 and p2 still observe the left-to-right, bottom-to-top order; the offsets are negative, if necessary.
If the result-buffer list passed in ent begins with a -1 (entity name) group, this group must name an existing text, attdef, or attrib entity. No further groups need to be present, but if the list contains further groups, these override the entity's actual attributes.
If the result-buffer list doesn't begin with a -1 group, it must begin with a 0 (entity type) group, and it must contain a group that contains the string itself. This is a 1 (value) group for a text or attrib entity, or a 2 (tag string) group for an attdef entity. Other values are assumed to be the default values unless they are explicitly specified. The defaults are as follows:
- Style (group 7)--Defaults to the current text style
- Size (group 40)--Defaults to the size of the style if that is fixed; otherwise, defaults to the current default size of the style
- Width factor (group 41)--Defaults to the default width of the style
- Obliquing angle (group 51)--Defaults to the default angle of the style
If acedTextBox() succeeds, it returns RTNORM; it returns RTERROR if ent does not correctly specify a text entity. If acedTextBox() fails, it sets the system variable ERRNO to a value that indicates the reason for the failure.
Note This function does not work with paragraph text (MText) or MText formatting characters.
Parameters
Parameters | Description |
---|---|
args | Definition of the text entity in the form of a result-buffer list (of the kind returned by acdbEntGet()) |
pt1 | Minimum (X,Y) coordinates of the box |
pt2 | Maximum (X,Y) coordinates of the box |