Index

PowerDoc Objects

PowerGlyph

Overview

This object represents a single PowerGlyph. In Power Engine API, the term PowerGlyph means a reference to a specific PowerGlyph design which is stored inside a PowerFont. This reference is PowerFont dependent and is also called PowerGlyph index or PowerGlyph code.

PowerGlyphs are like regular glyphs found in outline fonts, but are constructed using PowerDoc objects.

Designated Rendering Function: pdDrawPowerGlyph (23)

pdTypographyPtr (1018)

Also appears in: Text Fragment, Text Line, Text Arc, Text Area, Text Design, Glyph, Char, 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, Char, 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[17];

obj[0] = pdObjAdd(pd, 0, "Surface Style");
obj[1] = pdObjAdd(pd, 0, "Outline Style");
obj[2] = pdObjAdd(pd, 0, "TextLine Body Style");
obj[3] = pdObjAdd(pd, 0, "Line Definition");
obj[4] = pdObjAdd(pd, 0, "LibShape");
obj[5] = pdObjAdd(pd, 0, "LibShape");
obj[6] = pdObjAdd(pd, 0, "TextLine Typography");
obj[7] = pdObjAdd(pd, 0, "Text Layout");
obj[8] = pdObjAdd(pd, 0, "TextLine");
obj[9] = pdObjAdd(pd, 0, "Group Member #0");
obj[10] = pdObjAdd(pd, 0, "Group Member #1");
obj[11] = pdObjAdd(pd, 0, "Group Member #2");
obj[12] = pdObjAdd(pd, 0, "Group");
obj[13] = pdObjAdd(pd, 0, "PowerFont Record #0");
obj[14] = pdObjAdd(pd, 0, "PowerFont");
obj[15] = pdObjAdd(pd, 0, "Typography");
obj[16] = pdObjAdd(pd, 0, "PowerGlyph");

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

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

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

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

/* Properties for object 4 */
pdLinkAdd(pd, obj[4], pdOutlinePtr, obj[3]);
pdPropAdd(pd, obj[4], pdID, "56", PD_WORD_UNSIGNED);
pdPropAdd(pd, obj[4], pdDw, "300", PD_LONG_SIGNED);
pdPropAdd(pd, obj[4], pdDh, "300", PD_LONG_SIGNED);

/* Properties for object 5 */
pdLinkAdd(pd, obj[5], pdBodyPtr, obj[0]);
pdPropAdd(pd, obj[5], pdID, "56", PD_WORD_UNSIGNED);
pdPropAdd(pd, obj[5], pdDw, "270", PD_LONG_SIGNED);
pdPropAdd(pd, obj[5], pdDh, "270", PD_LONG_SIGNED);

/* Properties for object 6 */
pdLinkAdd(pd, obj[6], pdBodyPtr, obj[2]);
pdPropAdd(pd, obj[6], pdFontIndex, "0", PD_WORD_SIGNED);
pdPropAdd(pd, obj[6], pdFontDw, "95", PD_WORD_SIGNED);
pdPropAdd(pd, obj[6], pdFontDh, "130", PD_WORD_SIGNED);
pdPropAdd(pd, obj[6], pdSkewHor, "0", PD_WORD_SIGNED);
pdPropAdd(pd, obj[6], pdSkewVer, "0", PD_WORD_SIGNED);
pdPropAdd(pd, obj[6], pdRotation, "0", PD_WORD_SIGNED);

/* Properties for object 7 */
pdPropAdd(pd, obj[7], pdKerning, "1", PD_BYTE_UNSIGNED);
pdPropAdd(pd, obj[7], pdAlign, "0", PD_BYTE_UNSIGNED);
pdPropAdd(pd, obj[7], pdAlignEnd, "0", PD_BYTE_UNSIGNED);
pdPropAdd(pd, obj[7], pdRelativeDirection, "0", PD_BYTE_UNSIGNED);

/* Properties for object 8 */
pdLinkAdd(pd, obj[8], pdTypographyPtr, obj[6]);
pdLinkAdd(pd, obj[8], pdTextLayoutPtr, obj[7]);
pdPropAdd(pd, obj[8], pdTextString_08, "STOP", PD_ASC);

/* Properties for object 9 */
pdLinkAdd(pd, obj[9], pdGroupMemberPtr, obj[10]);
pdLinkAdd(pd, obj[9], pdFnDrawObjectPtr, obj[4]);
pdPropAdd(pd, obj[9], pdFnDraw, "18", PD_WORD_SIGNED);
pdPropAdd(pd, obj[9], pdDx, "0", PD_LONG_SIGNED);
pdPropAdd(pd, obj[9], pdDy, "-300", PD_LONG_SIGNED);

/* Properties for object 10 */
pdLinkAdd(pd, obj[10], pdGroupMemberPtr, obj[11]);
pdLinkAdd(pd, obj[10], pdFnDrawObjectPtr, obj[5]);
pdPropAdd(pd, obj[10], pdFnDraw, "18", PD_WORD_SIGNED);
pdPropAdd(pd, obj[10], pdDx, "15", PD_LONG_SIGNED);
pdPropAdd(pd, obj[10], pdDy, "-285", PD_LONG_SIGNED);

/* Properties for object 11 */
pdLinkAdd(pd, obj[11], pdFnDrawObjectPtr, obj[8]);
pdPropAdd(pd, obj[11], pdFnDraw, "1", PD_WORD_SIGNED);
pdPropAdd(pd, obj[11], pdDx, "19", PD_LONG_SIGNED);
pdPropAdd(pd, obj[11], pdDy, "-102", PD_LONG_SIGNED);

/* Properties for object 12 */
pdLinkAdd(pd, obj[12], pdGroupMemberPtr, obj[9]);

/* Properties for object 13 */
pdLinkAdd(pd, obj[13], pdFnDrawObjectPtr, obj[12]);
pdPropAdd(pd, obj[13], pdDw, "350", PD_LONG_SIGNED);

/* Properties for object 14 */
pdLinkAdd(pd, obj[14], pdPowerFontRecordPtr, obj[13]);
pdPropAdd(pd, obj[14], pdBoundingBox, "-50, -50, 350, 350", PD_ARR_LONG_SIGNED);
pdPropAdd(pd, obj[14], pdDw, "300", PD_LONG_SIGNED);
pdPropAdd(pd, obj[14], pdDh, "300", PD_LONG_SIGNED);

/* Properties for object 15 */
pdLinkAdd(pd, obj[15], pdPowerFontPtr, obj[14]);
pdPropAdd(pd, obj[15], pdFontDw, "200", PD_WORD_SIGNED);
pdPropAdd(pd, obj[15], pdFontDh, "200", PD_WORD_SIGNED);
pdPropAdd(pd, obj[15], pdSkewHor, "-12", PD_WORD_SIGNED);

/* Properties for object 16 */
pdLinkAdd(pd, obj[16], pdTypographyPtr, obj[15]);
pdPropAdd(pd, obj[16], pdID, "0", PD_WORD_UNSIGNED);


/* Image placement */
pdImgAdd(pd, obj[16], 0, 50, 250, 0, 0, 0, pdDrawPowerGlyph, 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("Surface Style");
local obj_1 = o("Outline Style");
local obj_2 = o("TextLine Body Style");
local obj_3 = o("Line Definition");
local obj_4 = o("LibShape");
local obj_5 = o("LibShape");
local obj_6 = o("TextLine Typography");
local obj_7 = o("Text Layout");
local obj_8 = o("TextLine");
local obj_9 = o("Group Member #0");
local obj_10 = o("Group Member #1");
local obj_11 = o("Group Member #2");
local obj_12 = o("Group");
local obj_13 = o("PowerFont Record #0");
local obj_14 = o("PowerFont");
local obj_15 = o("Typography");
local obj_16 = o("PowerGlyph");

/* Object Properties */

obj_0 + s(pdRGBT, "FF004000");

obj_1 + s(pdRGBT, "00000000");

obj_2 + s(pdRGBT, "FFFFFF00");

obj_3 + l(pdStylePtr, obj_1);
obj_3 + i(pdLineThickness, 400);

obj_4 + l(pdOutlinePtr, obj_3);
obj_4 + i(pdID, 56);
obj_4 + i(pdDw, 300);
obj_4 + i(pdDh, 300);

obj_5 + l(pdBodyPtr, obj_0);
obj_5 + i(pdID, 56);
obj_5 + i(pdDw, 270);
obj_5 + i(pdDh, 270);

obj_6 + l(pdBodyPtr, obj_2);
obj_6 + i(pdFontIndex, 0);
obj_6 + i(pdFontDw, 95);
obj_6 + i(pdFontDh, 130);
obj_6 + i(pdSkewHor, 0);
obj_6 + i(pdSkewVer, 0);
obj_6 + i(pdRotation, 0);

obj_7 + i(pdKerning, 1);
obj_7 + i(pdAlign, 0);
obj_7 + i(pdAlignEnd, 0);
obj_7 + i(pdRelativeDirection, 0);

obj_8 + l(pdTypographyPtr, obj_6);
obj_8 + l(pdTextLayoutPtr, obj_7);
obj_8 + s(pdTextString_08, "STOP");

obj_9 + l(pdGroupMemberPtr, obj_10);
obj_9 + l(pdFnDrawObjectPtr, obj_4);
obj_9 + i(pdFnDraw, 18);
obj_9 + i(pdDx, 0);
obj_9 + i(pdDy, -300);

obj_10 + l(pdGroupMemberPtr, obj_11);
obj_10 + l(pdFnDrawObjectPtr, obj_5);
obj_10 + i(pdFnDraw, 18);
obj_10 + i(pdDx, 15);
obj_10 + i(pdDy, -285);

obj_11 + l(pdFnDrawObjectPtr, obj_8);
obj_11 + i(pdFnDraw, 1);
obj_11 + i(pdDx, 19);
obj_11 + i(pdDy, -102);

obj_12 + l(pdGroupMemberPtr, obj_9);

obj_13 + l(pdFnDrawObjectPtr, obj_12);
obj_13 + i(pdDw, 350);

obj_14 + l(pdPowerFontRecordPtr, obj_13);
obj_14 + p(pdBoundingBox, "-50, -50, 350, 350");
obj_14 + i(pdDw, 300);
obj_14 + i(pdDh, 300);

obj_15 + l(pdPowerFontPtr, obj_14);
obj_15 + i(pdFontDw, 200);
obj_15 + i(pdFontDh, 200);
obj_15 + i(pdSkewHor, -12);

obj_16 + l(pdTypographyPtr, obj_15);
obj_16 + i(pdID, 0);

/* Image Pinning */

obj_16.Pin(0, 50, 250, pdDrawPowerGlyph);
 

Index