Index

PowerDoc Objects

Char

Overview

This object represents a single character. In Power Engine API, a character is simply an encoded glyph (or a glyph with a universal and font independent code).

Designated Rendering Function: pdDrawChar (16)

pdTypographyPtr (1018)

Also appears in: Text Fragment, Text Line, Text Arc, Text Area, Text Design, Glyph, 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.

Properties

pdID (1017)   PD_LONG_UNSIGNED

Also appears in: Glyph, PowerGlyph, Library Polyline, Library Shape, Library Bitmap Image

A unique identifier that, depending on the context, represent one of the following:

a) code of a character (or PowerChar);
b) index of a glyph (or PowerGlyph);
c) index of a library shape or library polyline (see the Library of Shapes and Polylines section in the manual for details)
d) index of a library bitmap image

Example

C/C++

DT_ID_SLONG obj[7];

obj[0] = pdObjAdd(pd, 0, "Char Outline Style");
obj[1] = pdObjAdd(pd, 0, "Char Body Style");
obj[2] = pdObjAdd(pd, 0, "Char Shadow Style");
obj[3] = pdObjAdd(pd, 0, "Char Outline");
obj[4] = pdObjAdd(pd, 0, "Char Shadow");
obj[5] = pdObjAdd(pd, 0, "Char Typography");
obj[6] = pdObjAdd(pd, 0, "Char");

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

/* Properties for object 1 */
pdPropAdd(pd, obj[1], pdRGBT, "B4961400", PD_HEX);
pdPropAdd(pd, obj[1], pdEP, "030A", PD_HEX);

/* Properties for object 2 */
pdPropAdd(pd, obj[2], pdRGBT, "80808078", PD_HEX);
pdPropAdd(pd, obj[2], pdEP, "030A", PD_HEX);

/* Properties for object 3 */
pdLinkAdd(pd, obj[3], pdStylePtr, obj[0]);
pdPropAdd(pd, obj[3], pdLineThickness, "240", PD_WORD_SIGNED);

/* Properties for object 4 */
pdLinkAdd(pd, obj[4], pdStylePtr, obj[2]);
pdPropAdd(pd, obj[4], pdShadowDx, "5", PD_WORD_SIGNED);
pdPropAdd(pd, obj[4], pdShadowDy, "5", PD_WORD_SIGNED);

/* Properties for object 5 */
pdLinkAdd(pd, obj[5], pdBodyPtr, obj[1]);
pdLinkAdd(pd, obj[5], pdShadowPtr, obj[4]);
pdLinkAdd(pd, obj[5], pdOutlinePtr, obj[3]);
pdPropAdd(pd, obj[5], pdFontIndex, "0", PD_WORD_SIGNED);
pdPropAdd(pd, obj[5], pdFontDw, "190", PD_WORD_SIGNED);
pdPropAdd(pd, obj[5], pdFontDh, "190", PD_WORD_SIGNED);

/* Properties for object 6 */
pdLinkAdd(pd, obj[6], pdTypographyPtr, obj[5]);
pdPropAdd(pd, obj[6], pdID, "66", PD_WORD_UNSIGNED);


/* Image placement */
pdImgAdd(pd, obj[6], 0, 50, 250, 0, 0, 0, pdDrawChar, 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("Char Outline Style");
local obj_1 = o("Char Body Style");
local obj_2 = o("Char Shadow Style");
local obj_3 = o("Char Outline");
local obj_4 = o("Char Shadow");
local obj_5 = o("Char Typography");
local obj_6 = o("Char");

/* Object Properties */

obj_0 + s(pdRGBT, "50641400");

obj_1 + s(pdRGBT, "B4961400");
obj_1 + s(pdEP, "030A");

obj_2 + s(pdRGBT, "80808078");
obj_2 + s(pdEP, "030A");

obj_3 + l(pdStylePtr, obj_0);
obj_3 + i(pdLineThickness, 240);

obj_4 + l(pdStylePtr, obj_2);
obj_4 + i(pdShadowDx, 5);
obj_4 + i(pdShadowDy, 5);

obj_5 + l(pdBodyPtr, obj_1);
obj_5 + l(pdShadowPtr, obj_4);
obj_5 + l(pdOutlinePtr, obj_3);
obj_5 + i(pdFontIndex, 0);
obj_5 + i(pdFontDw, 190);
obj_5 + i(pdFontDh, 190);

obj_6 + l(pdTypographyPtr, obj_5);
obj_6 + i(pdID, 'B');

/* Image Pinning */

obj_6.Pin(0, 50, 250, pdDrawChar);
 

Index