SCRIPT_CACHE

Defines a Uniscribe font metric cache.


typedef void* SCRIPT_CACHE;

Remarks

This is an opaque structure. The application must allocate and retain one SCRIPT_CACHE variable for each character style used. The variable must be initialized to NULL.

Many script functions take a combination of a hardware device context handle and a SCRIPT_CACHE variable. Uniscribe first attempts to access font data by using the SCRIPT_CACHE variable. It only inspects the hardware device context if the required data is not already cached.

The hardware device context handle can be passed to Uniscribe as NULL. If data required by Uniscribe is already cached, the device context is not accessed, and the operation continues normally.

If the device context is passed as NULL and Uniscribe needs to access it for any reason, Uniscribe returns the error code E_PENDING. This code is returned quickly, allowing the application to avoid time-consuming SelectObject calls.

Examples

The following example applies to all functions that take a SCRIPT_CACHE variable and an optional handle to a hardware device context.


hr = ScriptShape(NULL, &sc,
                 pwcChars, cChars, cMaxGlyphs, psa, pwOutGlyphs, pwLogClust, psva, pcGlyphs);
if (hr == E_PENDING)
{
    // ... select font into hdc ...
    hr = ScriptShape(hdc, &sc,
                 pwcChars, cChars, cMaxGlyphs, psa, pwOutGlyphs, pwLogClust, psva, pcGlyphs);
}


Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Usp10.h

See also

Uniscribe
Uniscribe Structures
Caching

 

 

Show: