Platform SDK: International Features

SCRIPT_CACHE

SCRIPT_CACHE is an opaque pointer to a Uniscribe font metric cache structure.

typedef void *SCRIPT_CACHE; 

Remarks

The client must allocate and retain one SCRIPT_CACHE variable for each character style used. It must be initialized by the client to NULL.

Many script functions take a combination of HDC and SCRIPT_CACHE. Uniscribe will first attempt to access font data by using the SCRIPT_CACHE and will only inspect the HDC if the required data is not already cached.

The HDC may be passed as NULL. If data required by Uniscribe is already cached, the HDC won't be accessed, and the operation continues normally.

If the HDC is passed as NULL, and Uniscribe needs to access it for any reason, Uniscribe will return E_PENDING.

E_PENDING is returned quickly, allowing the client to avoid time-consuming SelectObject calls. The following example applies to all functions that take a SCRIPT_CACHE and an optional HDC.

hr = ScriptShape(NULL, &sc, ..);
if (hr == E_PENDING) {
    ... select font into hdc ...
    hr = ScriptShape(hdc, &sc, ...);
}

Requirements

  Windows NT/2000: Requires Windows 2000.
  Header: Declared in Usp10.h.

See Also

Uniscribe Overview, Uniscribe Structures, SelectObject