Index

PowerDoc Objects

Text Ruler (Horizontal)

Overview

The Text Ruler (Horizontal) object supplies indents and tab stops to be respected during the text layout process. The text layout engine uses tab stops to advance to the next tab stop position when processing tab characters. As such, the Text Ruler (Horizontal) object can be used to build the following higher-level text objects: Text Path, Text Area, Rich Text Path, Rich Text Area.

Designated Rendering Function: NONE

None

Properties

pdTabStopPositions (1082)   PD_ARR_WORD_UNSIGNED

An array of tab stop positions. Depending on the flags in the corresponding pdTabStopFlags array, these positions can be left, center or right tab stop positions. All tab stop positions are quantities in the 0 - 65,535 range. These quantities should be understood as percentages of the width of the current text area (or the length of the current text path); therefore 0 means 0% of the text area width (or text path length) while 65,535 means 100% of the text area width (or text path length). The quantities must be entered in an increasing order.

Sample values:

"9830" = One tab stop position at 15% of the width of the current text area (or the length of the current text path)
"13107, 32768, 52428" = Three tab stop positions; the first one at 20%, the second one at 50% and the third one at 80% of the width of the current text area (or the length of the current text path)

pdTabStopFlags (1083)   PD_ARR_BYTE_UNSIGNED

An optional array of tab stop flags. Each tab stop flag corresponds to and describes one tab stop position in the pdTabStopPositions array.

Supported flag values:

0 = Left Tab Stop
1 = Center Tab Stop
2 = Right Tab Stop

Tab stop positions without explicitly associated tab stop flags are interpreted as left tab stops.

Sample values:

"1"
"0, 2, 1"

pdIndentLeft (1106)   PD_WORD_UNSIGNED

The amount of left indent, in the 0 - 65,535 range. This amount should be understood as a percentage of the width of the current text area (or the length of the current text path); therefore 0 means 0% of the text area width (or text path length) while 65,535 means 100% of the text area width (or text path length).

Sample values:

"13107" = 20% of the width of the current text area (or the length of the current text path)

pdIndentRight (1107)   PD_WORD_UNSIGNED

The amount of right indent, in the 0 - 65,535 range. This amount should be understood as a percentage of the width of the current text area (or the length of the current text path); therefore 0 means 0% of the text area width (or text path length) while 65,535 means 100% of the text area width (or text path length).

Sample values:

"52428" = 80% of the width of the current text area (or the length of the current text path)

pdMarginLeft (1159)   PD_LONG_SIGNED

Also appears in: Baseline, Row Boundary

Left margin, in document units. Positive values mean "inside", negative values mean "outside".

Sample values:

"100" = Left margin of 100 document units

pdMarginRight (1160)   PD_LONG_SIGNED

Also appears in: Baseline, Row Boundary

Right margin, in document units. Positive values mean "inside", negative values mean "outside".

Sample values:

"100" = Right margin of 100 document units

Example

C/C++

DT_ID_SLONG obj[1];

obj[0] = pdObjAdd(pd, 0, "Text Ruler");

/* Properties for object 0 */
pdPropAdd(pd, obj[0], pdTabStopPositions, "12240, 20400, 38250, 56100", PD_ARR_WORD_UNSIGNED);
pdPropAdd(pd, obj[0], pdTabStopFlags, "1, 0, 0, 2", PD_ARR_BYTE_UNSIGNED);

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 Ruler");

/* Object Properties */

obj_0 + p(pdTabStopPositions, "12240, 20400, 38250, 56100");
obj_0 + p(pdTabStopFlags, "1, 0, 0, 2");
 

Index