22.03.2015 Views

DLI Implementation and Reference Guide - Datalogics

DLI Implementation and Reference Guide - Datalogics

DLI Implementation and Reference Guide - Datalogics

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

5.8 <strong>DLI</strong> <strong>Implementation</strong> <strong>and</strong> <strong>Reference</strong> <strong>Guide</strong><br />

dlpdftextadvance<br />

The most common use for making new text areas from portions of a DLPDFTEXT area<br />

Concepts <strong>and</strong> Facilities: <strong>Guide</strong> to the DL Pager Composition System<br />

is to copyfit text to composed lines. The dlpdftextadvance function call is used to<br />

supply the width <strong>and</strong> height change for a string of text, <strong>and</strong> accounts for character<br />

shaping <strong>and</strong> combining, as well as horizontal reading direction. The<br />

dlpdfcontentwidetextwidth function call may be used to get a rough estimate<br />

of the width or height change for a string. The dlpdfcontentwidetextwidth call<br />

does not take character shaping or combining into account, <strong>and</strong> assumes a left-toright<br />

line data orientation. The dlpdftextadvance call looks much like the<br />

dlpdfcontentwidetextwidth calls, but with some enhancements.<br />

void dlpdftextadvance (DLPDFTEXT *, DLPDFFONT *,<br />

PDEGraphicState *,<br />

PDETextState *,<br />

ASFixed, ASFixed,<br />

dlpdftext_X,<br />

ASFixed, ASFixedPoint *)<br />

• The first argument is a DLPDFTEXT area that contains text to be set...<br />

• ...in the indicated DLPDFFONT...<br />

• ...using the supplied graphics of PDEGraphicState...<br />

• ...<strong>and</strong> text states of PDETextState.<br />

• The fifth argument describes the point size of the font;<br />

• the sixth argument describes the set width of the font;<br />

• the seventh argument, the dlpdftext_X parameter, is one of<br />

DLPDFTEXT_X_LEFT or DLPDFTEXT_X_RIGHT, used to indicate whether the<br />

starting location is the left or right end (respectively) of the text, distinguishing a<br />

left-to-right line order (e.g. English) from a right-to-left line order (e.g. Arabic);<br />

• the eighth argument indicates the angle of text (in counterclockwise degrees),<br />

supplied as an ASFixed value;<br />

• the ninth argument is a pointer to an ASFixedPoint; the X <strong>and</strong> Y position change<br />

resulting from this call is returned in ASFixed units in this ASFixedPoint.<br />

An exception will be raised for invalid parameters, or if the text advance could not be<br />

calculated.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!