Index

PowerDoc Objects

Rich Text Design

Overview

This objects represents a rich text design. In Power Engine API, a rich text design is an array of manually positioned text fragments. Functionally, the Rich Text Design object is similar to the Text Design object but is more complex. This is because a typical rich text design usually consists of many text fragments, while each fragment is formatted using a different set of typographic and layout attributes.

Designated Rendering Function: pdDrawRichTextDesign (27)

pdTextFragmentPtr (1038)

Also appears in: Text Fragment, Rich Text Line, Rich Text Arc, Rich Text Area, Rich Text Path, Rich Text Box, Rich Button, Rich List Box

Link to the Text Fragment object.

This link in used to establish a link to the next text fragment. This can be the first text fragment or the fragment that follows the current one.

Properties

pdAngleRotation (1034)   PD_WORD_UNSIGNED

Also appears in: Text Line, Text Design, Rich Text Line

Angle in degrees. Must be between 0 and 360.

Example

C/C++

DT_ID_SLONG obj[5];

obj[0] = pdObjAdd(pd, 0, "Text Fragment Body Style");
obj[1] = pdObjAdd(pd, 0, "Text Fragment Typography");
obj[2] = pdObjAdd(pd, 0, "Text Fragment Layout");
obj[3] = pdObjAdd(pd, 0, "Text Fragment");
obj[4] = pdObjAdd(pd, 0, "RichTextDesign");

/* Properties for object 0 */
pdPropAdd(pd, obj[0], pdRGBT, "B4961400", PD_HEX);

/* Properties for object 1 */
pdLinkAdd(pd, obj[1], pdBodyPtr, obj[0]);
pdPropAdd(pd, obj[1], pdFontIndex, "2", PD_WORD_SIGNED);
pdPropAdd(pd, obj[1], pdFontDw, "90", PD_WORD_SIGNED);
pdPropAdd(pd, obj[1], pdFontDh, "90", PD_WORD_SIGNED);

/* Properties for object 2 */
pdPropAdd(pd, obj[2], pdPosArrX_32, "15600, 22600, 18600, 15600, 10000, 11000, 8000, 10000, 4100, 3000", PD_ARR_LONG_SIGNED);
pdPropAdd(pd, obj[2], pdPosArrY_32, "0, -1000, -1000, -1000, -1000, -3000, -5000, -11000, -14000, -15000", PD_ARR_LONG_SIGNED);
pdPropAdd(pd, obj[2], pdHinting, "1", PD_BYTE_UNSIGNED);
pdPropAdd(pd, obj[2], pdPositioning, "1", PD_BYTE_UNSIGNED);

/* Properties for object 3 */
pdLinkAdd(pd, obj[3], pdTypographyPtr, obj[1]);
pdLinkAdd(pd, obj[3], pdTextLayoutPtr, obj[2]);
pdPropAdd(pd, obj[3], pdTextString_08, "Positioned", PD_ASC);

/* Properties for object 4 */
pdLinkAdd(pd, obj[4], pdTextFragmentPtr, obj[3]);

/* Image placement */
pdImgAdd(pd, obj[4], 0, 124, 425, 0, 0, 0, pdDrawRichTextDesign, DV_NULL);

INTEGRAL DSL

/* Lambda shortcuts */

local o = @(label = "") CDTObj(::my.doc, label); /* to make object */
local p = @(id, str, len = PD_DEFAULT) CDTProp(id, str, len); /* to add property - general */
local s = @(id, str) CDTPropStr(id, str); /* to add property - string */
local i = @(id, num) CDTPropInt(id, num); /* to add property - integer */
local l = @(id, obj) CDTLink(id, obj); /* to add link */

/* Objects */

local obj_0 = o("Text Fragment Body Style");
local obj_1 = o("Text Fragment Typography");
local obj_2 = o("Text Fragment Layout");
local obj_3 = o("Text Fragment");
local obj_4 = o("RichTextDesign");

/* Object Properties */

obj_0 + s(pdRGBT, "B4961400");

obj_1 + l(pdBodyPtr, obj_0);
obj_1 + i(pdFontIndex, 2);
obj_1 + i(pdFontDw, 90);
obj_1 + i(pdFontDh, 90);

obj_2 + p(pdPosArrX_32, "15600, 22600, 18600, 15600, 10000, 11000, 8000, 10000, 4100, 3000");
obj_2 + p(pdPosArrY_32, "0, -1000, -1000, -1000, -1000, -3000, -5000, -11000, -14000, -15000");
obj_2 + i(pdHinting, 1);
obj_2 + i(pdPositioning, 1);

obj_3 + l(pdTypographyPtr, obj_1);
obj_3 + l(pdTextLayoutPtr, obj_2);
obj_3 + s(pdTextString_08, "Positioned");

obj_4 + l(pdTextFragmentPtr, obj_3);

/* Image Pinning */

obj_4.Pin(0, 124, 425, pdDrawRichTextDesign);
 

Index