D-Type Unicode Text Module also defines and utilizes the following advanced structure types. These structure types are utilized only in certain situations:
This structure can be used by applications to implement cursor movement, text selection and hit testing. The structure is defined as follows:
/* The Frame structure - Format 2 (arbitrary 4-point polygon with 24.8 fractional pixel coordinates) */ typedef struct { DT_SLONG Idx; /* Frame's Logical ID */ DT_SLONG Row; /* Frame's Row */ DT_SFRAC_L X1, Y1, X2, Y2, X3, Y3, X4, Y4; /* Frame's corner points in 24.8 fractional pixels (4-point polygon) */ DT_UBYTE Misc, Rsvd; } DT_PD_FRAME_FORMAT2;
This structure holds information about a single letter (character, glyph, PowerGlyph) rendered by D-Type Power Engine. This structure is referred to as the letter's frame. Idx is the index of the letter within its text flow and Row is its row in that text flow. X1, Y1, X2, Y2, X3, Y3, X4 and Y4 represent the coordinates of the letter's bounding quadrilateral in 24.8 fractional pixels.
Misc describes the letter's writing direction (left-to-right or right-to-left) and, in the future, other attributes. It consists of the following bits:
Rsvd is contains some special bits that might be of use in certain situations.
For more information on using frames, please see the Text Flows and Frames document in the Workshop section.
This is another structure that can be used by applications to implement cursor movement, text selection and hit testing. This structure type is similar to DT_PD_FRAME_FORMAT2, but more limited. This is because it can only describe the letter's frame as a parallelogram and not an arbitrary quadrilateral. Also, the precision that this structure offers is more limited since the pixel coordinates are expressed in whole pixel units rather than 24.8 fractional pixels. This structure type is still in use today but, due to these limitations, may be deprecated in the future.
/* The Frame structure - Format 1 (parallelogram) */ typedef struct { DT_SLONG Idx; /* Frame's Logical ID */ DT_SLONG Row; /* Frame's Row */ DT_SRAST_L XMin, YMin, XMax, YMax, XMid, YMid; /* Frame's corner points in pixels (parallelogram) */ DT_UBYTE Misc, Rsvd; } DT_PD_FRAME_FORMAT1;
As with DT_PD_FRAME_FORMAT2, Idx is the index of the letter within its text flow and Row is its row in that text flow. XMin, YMin, XMax, YMax, XMid and YMid represent the coordinates of the letter's bounding parallelogram in pixels and should be interpreted as follows:
Misc describes the letter's writing direction (left-to-right or right-to-left) and, in the future, other attributes. It consists of the following bits:
Rsvd is contains some special bits that might be of use in certain situations.
For more information on using frames, please see the Text Flows and Frames document in the Workshop section.
This is a union type that represents a pointer to either DT_PD_FRAME_FORMAT1 or DT_PD_FRAME_FORMAT2. It is defined as follows:
/* The Frames union */ typedef union { DT_PD_FRAME_FORMAT1* Format1Ptr; /* Frames in Format 1 */ DT_PD_FRAME_FORMAT2* Format2Ptr; /* Frames in Format 2 */ } DT_PD_FRAMES;
This structure is used by applications that implement cursor movement, text selection and hit testing. This structure provides essential information about a single text flow and its array of frames. The structure is defined as follows:
/* The Text Flow structure */ typedef struct { DT_SLONG ParentFlow; /* Flow's parent Flow index */ DT_SLONG ParentFrame; /* Flow's parent Frame index */ DT_SLONG LocalNumber; /* Flow's local identifier */ DT_SLONG Img; /* Flow's PowerDoc Image */ DT_ID_SLONG ParentObj; /* Flow's parent PowerDoc Object */ DT_PD_FRAMES Frames; /* Flow's array of Frames (named union) */ DT_SLONG FramesLen; /* Number of Frames in the array */ } DT_PD_FLOW;
This structure holds information about a single text flow rendered by D-Type Power Engine. ParentFlow and ParentFrame link this text flow to its parent text flow and frame, if any. This hierarchical organization makes it possible to describe nested text flows. LocalNumber is the text flow's local identifying number. Although this number is not unique globally, it uniquely describes the text flow within its current nesting level. Img links the text flow to its associated PowerDoc Image, while Obj links the text flow to its parent PowerDoc object. Finally, Frames provides the text flow's array of frames (which can be in either DT_PD_FRAME_FORMAT1 or DT_PD_FRAME_FORMAT2 format), while FramesLen tells how many frames there are in this array.
For more information on using text flows, please see the Text Flows and Frames document in the Workshop section.
This structure contains additional and optional parameters for advanced rendering, which can be specified when calling the pdDocDraw function.
/* Optional parameters for rendering */ typedef struct { DT_SWORD Flags; /* Bit 0: If unset, perform text layout operations only for text objects and characters that are within the visible portion of the page. If set, perform text layout operations for any and all text objects and characters on the page, even if they are outside the visible portion of the page. Bit 1: If unset, disable processing of critical object-specific errors. If set, enable processing of critical object-specific errors. */ DT_SWORD Origins; /* -1 = Never draw origins 0 = Draw origins only for selected PowerDoc objects 1 = Draw origins for all PowerDoc objects */ DT_SWORD Boundaries; /* -1 = Never draw boundaries 0 = Draw boundaries only for selected PowerDoc objects (not all PowerDoc objects have boundaries) 1 = Draw boundaries for all PowerDoc objects (not all PowerDoc objects have boundaries) */ DT_SWORD Background; /* 0 = Do not clear surface's background 1 = Clear surface's background using the R, G, B, A values below */ DT_SWORD Flows; /* 0 = Do not return text flows and frames resulting from text layout operations and do not pass them to the text callback function. 1 = Return text flows and frames resulting from text layout operations via the FlowsPtr and FlowsLen structure members and also pass them to the glyph callback function. Use DT_PD_FRAME_FORMAT1 for all frames. 2 = Return text flows and frames resulting from text layout operations via the FlowsPtr and FlowsLen structure members and also pass them to the glyph callback function. Use DT_PD_FRAME_FORMAT2 for all frames. 10 = Only pass text flows and frames resulting from text layout operations to the glyph callback function. Use DT_PD_FRAME_FORMAT1 for all frames. 20 = Only pass text flows and frames resulting from text layout operations to the glyph callback function. Use DT_PD_FRAME_FORMAT2 for all frames. */ DT_SWORD Reserved; /* Reserved for future use. Must be set to 0. */ DT_UBYTE R, G, B, A; /* R, G, B, A values of the surface's background */ DT_PD_FLOWS FlowsArr; /* Text flows generated during text layout operations (this is an input/output variable) */ DT_SLONG FlowsLen; /* The number of text flows (this is an input/output variable) */ void* UserData; /* User supplied data (will be passed to DT_PD_DOCDRAW_CANVAS) */ } DT_PD_DOCDRAW_PARAMS;
where DT_PD_FLOWS is defined as follows:
/* An array of Text Flows */ typedef struct { DT_PD_FLOW* Ptr; /* Points to the first Flow in the array */ DT_SLONG Len; /* Number of Flows in the array */ } DT_PD_FLOWS;
For more information on advanced rendering, please see the description of the pdDocDraw and txTextDraw functions and the Text Flows and Frames document in the Workshop section.