Based on the supplied script and font, these functions return a layout instance from the layout cache.
Parameter | Description |
---|---|
layout_cache |
Handle of the previously created layout cache instance. |
font_index |
Font index of the font or font instance in the Font Catalog (associated with the Standard Engine instance that was used to create the layout cache) for which the text layout instance is to be obtained. |
script_code |
Script code that identifies the script for which the text layout instance is to be obtained. Must be a code from the list of defined scripts. |
language_code |
Language code that identifies the language for which the text layout instance is to be obtained. Must be a code from the list of defined languages. |
typo_flags |
Typographic control flags. Use 0 for no specific typographic features, 1 for kerning, 2 for ligature formation, and 3 for kerning and ligature formation. Others values are reserved for future. |
layout |
Pointer to the handle of the returned layout instance. |
If the functions were successful, the return value is 1 and layout holds a handle of the layout instance in the layout cache. Otherwise, the functions return 0 and layout holds DV_NULL.
Before calling these functions, the assumption is that you have obtained a valid font index from the Font Catalog associated with the Standard Engine instance that was used to create the layout cache.
These functions are usually very quick, because if the requested text layout instance is already in the layout cache, that instance will be returned (and the corresponding font file will not be accessed). The font file will be accessed (and a new text layout instance created) only if the requested text layout instance is not found in the layout cache.
Keep in mind that the returned text layout instance is under exclusive control of the layout cache; your application does not own the returned text layout instance and must not attempt to destroy it. Also, you must remember that this instance is valid only until the next call to lxCacheObtainLayout / lxCacheObtainLayoutPlus (or lxCacheClear / lxCacheClearPlus). This is because subsequent requests for additional text layout instances might empty the layout cache and invalidate your text layout instance. Therefore, use the lxCacheObtainLayout / lxCacheObtainLayoutPlus functions just before laying out a run of text.