Index

CDTEngineV8

Init

1 bool Init(const DT_STREAM_DESC* sd_init, const DT_STREAM_DESC* sd_fontmap = DV_NULL, DT_INIT_INFO* init_info = DV_NULL)

2 bool Init(const DT_STREAM_DESC& sd_init, const DT_STREAM_DESC& sd_fontmap, DT_INIT_INFO* init_info = DV_NULL)

3 bool Init(const DT_STREAM_DESC& sd_init, DT_INIT_INFO* init_info = DV_NULL)

This method fully initializes the CDTEngineV8 object using a set of external initialization streams. Depending on the value of the DEF_ENGINE_LEVEL macro variable, the initialization is performed as follows:

If the initialization was successful, applications can subsequently call other CDTEngineV8 methods. Applications that wish to use the CDTEngineV8 class to create PowerDoc documents should see the CDTDocV8 class.

Parameters

ParameterDescription

sd_init

References the DT_STREAM_DESC structure which supplies the location of the main D-Type initialization file. Typically, this is dtype.inf. When appropriate, applications can provide their own (altered) version of the dtype.inf file. Also, it is possible for each CDTEngineV8 object to be initialized via its own unique initialization file, meaning that different CDTEngineV8 objects can be initialized using a different set of initialization parameters.

sd_fontmap

References the DT_STREAM_DESC structure which supplies the location of the default font map file. Typically, this is fontmap.inf. When appropriate, applications can provide their own (altered) version of the fontmap.inf file.

The default font map file tells CDTEngineV8 what default fonts to use for different Unicode scripts in the absence of any other more specific instructions.

This paramater is respected ony when DEF_ENGINE_LEVEL is 4.

init_info

References the DT_INIT_INFO structure that provides additional initialization information to CDTEngineV8 and receives additional initialization information from CDTEngineV8. If you do not wish to make use of this parameter, simply set it to DV_NULL.

The members of this structure have the following meaning:

init_key — this parameter is reserved for future and must be set to 0:

init_flag — this parameter is reserved for future and must be set to 0:

init_status — this parameter provides extended initialization information and is set by CDTEngineV8. One of the following values will be returned:

  • init_status = 0 — OK — The engine did not detect any critical errors during the initialization, or they were automatically corrected or ignored. The engine initialized successfully.
  • init_status = -1 — Warning — At least one initialization path is invalid. The engine initialized in a degraded mode.
  • init_status = 1 — Error — At least one initialization path is invalid. The engine could not be initialized.
  • init_status = -2 — Warning — There was not enough memory for full initialization. The engine initialized in a degraded mode.
  • init_status = 2 — Error — There was not enough memory for full initialization. The engine could not be initialized.
  • init_status = -3 or any other negative value indicates that an unspecified or unknown warning was encountered during the initialization and the engine initialized in a degraded mode.
  • init_status = 3 or any other positive value indicates that an unspecified or unknown error was encountered during the initialization and the engine could not be initialized.

reserved1 — reserved for future and must be set to 0.

reserved2 — reserved for future and must be set to 0.

reserved3 — reserved for future and must be set to DV_NULL.

reserved4 — reserved for future and must be set to DV_NULL.

Return Value

If the initialization was successful, the return value is true. Otherwise, the method returns false.

Note 1

To ensure that the initialization is successful, the location that sd_init holds must point to the main D-Type initialization file. For more information on the structure of the main D-Type initialization file, see the Initialization Files section of this document. In addition, any other stream descriptors that the main D-Type initialization file may contain (e.g. locations of the initial font list, pattern catalog, etc.) must be valid and should stay valid until the corresponding CDTEngineV8 object is destroyed. Remember that various CDTEngineV8 methods might attempt to open some of these streams later during the execution of your application so it is important to ensure that they remain accessible to CDTEngineV8 even after the Init method returns.

Note 2

See How To Use D-Type Streams And Stream Macros.

Note 3

See our notes regarding file based streams.

Note 4

Please note that any stream descriptors that are part of the Optional Secondary Initialization Files section of dtype.inf are optional. If not needed, they can be specified as NONE streams (Stream ID = -1, Stream Locator = NONE). Otherwise they must be valid or your initialization could fail.

Note 5

Char Translation and Alignment stream descriptors (the .ccv file paths) that are specified within the Font Factories section of dtype.inf are highly recommended because those files allow your application to create custom character encodings and, additionally, contain instruction designed to improve font rendering. Therefore, we do not recommend you specify them as NONE streams.



 

Index