
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)
Links
Properties
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");
pdPropAdd(pd, obj[0], pdRGBT, "B4961400", PD_HEX);
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);
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);
pdLinkAdd(pd, obj[3], pdTypographyPtr, obj[1]);
pdLinkAdd(pd, obj[3], pdTextLayoutPtr, obj[2]);
pdPropAdd(pd, obj[3], pdTextString_08, "Positioned", PD_ASC);
pdLinkAdd(pd, obj[4], pdTextFragmentPtr, obj[3]);
pdImgAdd(pd, obj[4], 0, 124, 425, 0, 0, 0, pdDrawRichTextDesign, DV_NULL);
INTEGRAL DSL
local o = @(label = "") CDTObj(::my.doc, label);
local p = @(id, str, len = PD_DEFAULT) CDTProp(id, str, len);
local s = @(id, str) CDTPropStr(id, str);
local i = @(id, num) CDTPropInt(id, num);
local l = @(id, obj) CDTLink(id, obj);
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");
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);
obj_4.Pin(0, 124, 425, pdDrawRichTextDesign);
