C++
void explodeFragments( AcDbMTextEnum, void *, AcGiWorldDraw * ctxt = NULL ) const;
Description
This function runs through the MText object's text string breaking it up into fragments, calling the fragment elaboration function func for each fragment. If the default of NULL is used for the ctxt argument, the current AcGiWorldDraw object is used.
The fragment elaboration function's prototype is:
int (*AcDbMTextEnum)(AcDbMTextFragment *frag, void *param)
The elaboration function is called once for each fragment. frag points to an AcDbMTextFragment structure that's passed into the elaboration function. frag provides all the information about the text fragment for which the elaboration function is being called. param contains the value (which is just a void* address) of the param argument passed into the explodeFragments() member function. param can point to anything desired--it is only passed on to the elaboration function func. param provides a means to pass application-specific data into the elaboration function.
The elaboration function should return 1 to continue the elaboration operation, or 0 to terminate the operation.
In the context of this function, a fragment is a piece of text that lies on the same "word-wrapped" line and has a specific set of characteristics (that is, font, color, height, width, etc.). So, each word-wrap newline and each change in text characteristics starts a new fragment.
If there is a hard return (an embedded ^M) in the text, an empty or NULL text fragment will be returned.
The AcDbMTextFragment structure is used to describe a fragment of text as extracted by the explodeFragments() member function.
struct AcDbMTextFragment { // position data AcGePoint3d location; AcGeVector3d normal; AcGeVector3d direction; // text characters char *text; // font names char *font; char *bigfont; // metrics AcGePoint2d extents; double capsHeight; double widthFactor; double obliqueAngle; double trackingFactor; Adesk::UInt16 colorIndex; // stack flags unsigned stackTop:1; unsigned stackBottom:1; // underline/overline data unsigned underlined:1; unsigned overlined:1; AcGePoint3d underPoints[2]; AcGePoint3d overPoints[2]; };
Parameters
Parameters | Description |
---|---|
ctxt | Input optional AcGiWorldDraw object |
unnamed1 | Input pointer to a fragment elaboration callback function |
unnamed2 | Input void* that can point to anything desired to pass into func |