Index

PowerDoc Objects

Text Design

Overview

This objects represents a text design. In Power Engine API, a text design is an array of manually positioned characters or glyphs. As such, text designs are very suitable for drawing arbitrary text compositions (i.e. text compositions in which the (x, y) location of each glyph/character on the page is manually specified by the user rather than automatically calculated by the text layout engine).

Designated Rendering Function: pdDrawTextDesign (26)

Note: pdTextString_08, pdTextString_16, pdTextString_24 and pdTextString_32 cannot be used at the same time. pdTextString_32 takes precedence over pdTextString_24. pdTextString_24 takes precedence over pdTextString_16. Finally, pdTextString_16 takes precedence over pdTextString_08.

pdTypographyPtr (1018)

Also appears in: Text Fragment, Text Line, Text Arc, Text Area, Glyph, Char, PowerGlyph, Text Path

Link to the Typography object. When standard glyphs or characters are used, this should be a link to the Typography (For Outline Fonts) object. When PowerGlyphs (or PowerChars in the future) are used, this should be a link to the Typography (For PowerFonts) object.

In either case, this link supplies typographic parameters.

pdTextLayoutPtr (1084)

Also appears in: Text Fragment, Text Line, Text Arc, Text Area, Text Path

This link supplies text layout attributes. When building the Text Design or Rich Text Design object, this is a link to the Text Layout (Manual) object. When building any other text object, this is a link to the Text Layout (Automatic) object.

Text Design and Rich Text Design utilize a manual text layout algorithm which means that the (x, y) position of each glyph/character must be supplied explicitly by the user. All other text objects utilize an automatic text layout algorithm which means that the position of their glyphs/characters is calculated automatically by the text layout engine while the user only supplies higher-level layout attributes such as direction, alignment, kerning, letter/row spacing etc.

Properties

pdTextString_08 (1023)   PD_ASC

Supported Compression Methods: 006

Also appears in: Text Fragment, Text Line, Text Arc, Text Area, Text Path

Text string, i.e. an array of character or glyph codes (variable length, 1 byte per code).

Sample values:

"Test"
"D-Type"

pdTextString_16 (1024)   PD_HEX

Supported Compression Methods: 004

Also appears in: Text Fragment, Text Line, Text Arc, Text Area, Text Path

Text string, i.e. an array of character or glyph codes (variable length, 2 bytes per code).

Sample values:

"54 00 65 00 73 00 74 00" ('T', 'e', 's', 't')
"44 00 2D 00 54 00 79 00 70 00 65 00" ('D', '-', 'T', 'y', 'p', 'e')

pdTextString_24 (1118)   PD_HEX

Supported Compression Methods: 002

Also appears in: Text Fragment, Text Line, Text Arc, Text Area, Text Path

Text string, i.e. an array of character or glyph codes (variable length, 3 bytes per code).

Sample values:

"54 00 00 65 00 00 73 00 00 74 00 00" ('T', 'e', 's', 't')
"44 00 00 2D 00 00 54 00 00 79 00 00 70 00 00 65 00 00" ('D', '-', 'T', 'y', 'p', 'e')

pdTextString_32 (1119)   PD_HEX

Supported Compression Methods: 000

Also appears in: Text Fragment, Text Line, Text Arc, Text Area, Text Path

Text string, i.e. an array of character or glyph codes (variable length, 4 bytes per code).

Sample values:

"54 00 00 00 65 00 00 00 73 00 00 00 74 00 00 00" ('T', 'e', 's', 't')
"44 00 00 00 2D 00 00 00 54 00 00 00 79 00 00 00 70 00 00 00 65 00 00 00" ('D', '-', 'T', 'y', 'p', 'e')

pdUserSpecificContent (1120)   PD_HEX

Also appears in: Text Fragment, Text Line, Text Arc, Text Area, Text Path

User-specific content (variable length)

This property allows end-user applications to store their own (i.e. user-specific) content with each text fragment. This property is suitable for user-specific content of variable length (e.g. strings, custom structures etc). D-Type Engine does not use or interpret this content in any way; the interpretation of the user-specific content is entirely up to the end-user application.

Note: Additional technical information about this property is available to customers with a support contract.

pdTextEncoding (1079)   PD_BYTE_UNSIGNED

Also appears in: Text Fragment, Text Line, Text Arc, Text Area, Text Path

Text encoding format. If this property is not specified, then the value 0 (Unicode character codes) is assumed.

Supported values:

0 = Unicode character codes
1 = Glyph codes (font dependent)
2 = Unicode PowerChar codes - reserved for future use
3 = PowerGlyph codes (font dependent)

pdAngleRotation (1034)   PD_WORD_UNSIGNED

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

Angle in degrees. Must be between 0 and 360.

Example

C/C++

DT_ID_SLONG obj[4];

obj[0] = pdObjAdd(pd, 0, "TextDesign Body Style");
obj[1] = pdObjAdd(pd, 0, "TextDesign Typography");
obj[2] = pdObjAdd(pd, 0, "TextDesign Layout");
obj[3] = pdObjAdd(pd, 0, "TextDesign");

/* 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, "0", 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], pdPosArrI, "0, 0, 0, 1, 0, 0, 0, 0, 7", PD_ARR_BYTE_UNSIGNED);
pdPropAdd(pd, obj[2], pdPosArrY_32, "0, 6400, -6400, 30600, 0, 0, 0, 0, 55600, 0, -1000, -1000, -1000, -1000, -3000, -5000, -11000, -14000, -15000", PD_ARR_LONG_SIGNED);
pdPropAdd(pd, obj[2], pdPosArrX_32, "2000, 21800, 15600, -16000, 15360, 15360, 5360, 9360, 1360, 15600, 22600, 18600, 15600, 10000, 11000, 8000, 10000, 4100, 3000", 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, "Manually Positioned", PD_ASC);


/* Image placement */
pdImgAdd(pd, obj[3], 0, 41, 110, 0, 0, 0, pdDrawTextDesign, 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("TextDesign Body Style");
local obj_1 = o("TextDesign Typography");
local obj_2 = o("TextDesign Layout");
local obj_3 = o("TextDesign");

/* Object Properties */

obj_0 + s(pdRGBT, "B4961400");

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

obj_2 + p(pdPosArrI, "0, 0, 0, 1, 0, 0, 0, 0, 7");
obj_2 + p(pdPosArrY_32, "0, 6400, -6400, 30600, 0, 0, 0, 0, 55600, 0, -1000, -1000, -1000, -1000, -3000, -5000, -11000, -14000, -15000");
obj_2 + p(pdPosArrX_32, "2000, 21800, 15600, -16000, 15360, 15360, 5360, 9360, 1360, 15600, 22600, 18600, 15600, 10000, 11000, 8000, 10000, 4100, 3000");
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, "Manually Positioned");

/* Image Pinning */

obj_3.Pin(0, 41, 110, pdDrawTextDesign);
 

Index