The txTextMakeViaPowerDocAndStream function embeds a Unicode text flow into an existing Power Engine document (i.e. a document created using D-Type Power Engine and its API functions) by reading a plain text file stored in a stream. This function optionally performs Unicode's implicit bidirectional reordering algorithm (BiDi) and auto-detects Unicode scripts (such as Latin, Arabic, Thai etc.) so that complex scripts can be shaped properly.
This function must be called once per text document instance, and only after a successful call to txTextIni. Applications that wish to embed another Unicode text flow using this function must first destroy the existing text document instance by calling txTextExt and then create a new one by calling txTextIni.
Note: txTextMakeViaPowerDocAndStream is an advanced and specialized function. Its primary users are developers who wish to use D-Type Unicode Text Module to embed text flows into their D-Type Power Engine documents. In this use case scenario, the associated text document instance (text_doc) is usually short-lived while the Power Engine document (power_doc) is long-lived. With that in mind, the txTextMakeViaPowerDocAndStream function is rather different from, and should not be confused with txTextMakeViaStream, txTextMakeViaBuffer and txTextMakeViaPowerDoc.
Parameter | Description |
---|---|
text_doc |
Handle of the associated text document instance. |
power_doc | |
text_type |
See txTextMakeViaStream. |
text_sd |
See txTextMakeViaStream. |
unicode_flags |
See txTextMakeViaStream. |
area |
See txTextMakeViaStream. |
attribs |
/* Text default parameters */
typedef struct
{
const DT_CHAR* RGBT;
const DT_CHAR* FontWidth;
const DT_CHAR* FontHeight;
const DT_CHAR* SkewHor;
const DT_CHAR* SkewVer;
const DT_CHAR* SpacingRow;
const DT_CHAR* SpacingLetter;
const DT_CHAR* Align;
const DT_CHAR* AlignEnd;
const DT_CHAR* Hinting;
const DT_CHAR* FontIndex;
const DT_CHAR* Reserved;
} DT_TX_DEFAULT_ATTRIBS;
|
fontmap_sd |
See txTextMakeViaStream. |
flags |
A set of bit values that control the behavior of this function.
|
If the Unicode text flow was embedded successfully, the return value depends on the flags parameter described above:
If the text flow could not be embedded successfully, the function returns -1.
See txTextMakeViaStream.
See How To Use D-Type Streams And Stream Macros.
See our notes regarding file based streams.
See the txMakeCachedFontmap function.
txTextMakeViaStream, txTextMakeViaPowerDoc