This function activates certain rules/restrictions that are respected when the Typesetter makes decisions on whether to store glyph images in the bitmap cache. These rules/restrictions are designed to help utilize the bitmap cache more effectively. For example, application developers may instruct the Typesetter not to cache glyph images that exceed certain size.
When D-Type Engine is initialized, the bitmap cache policy is not set. Consequently, no restrictions are set either. This means that any and all glyph images that fit in the bitmap cache will be cached.
Therefore, call this function if you wish to set your own, more restrictive, bitmap cache policy.
Note that the Typesetter can render glyph images regardless of whether they are cached or not. The bitmap cache merely improves the rendering speed when the same glyph image is rendered more than once.
Parameter | Description |
---|---|
max_bitmap_bytes |
|
reserved1 |
Reserved for future use. Must be set to -1. |
reserved2 |
Reserved for future use. Must be set to -1. |
reserved3 |
Reserved for future use. Must be set to -1. |
reserved4 |
Reserved for future use. Must be set to -1. |
flag |
Specifies action with respect to the Typesetter's bitmap cache. Currently supported values are:
|
If successful, the return value is 1. Otherwise, the function returns 0.
Currently the only supported restriction is the restriction on the size of a glyph image. However, in the future additional restrictions may be added.
Note that TypesetterSetSubpixels can completely disable the bitmap cache. Obviously, when the bitmap cache is disabled no glyph images can be cached either (regardless of how you set the bitmap cache policy by calling this function).
dtTypesetterSetCachePolicy(engine, 0, -1, -1, -1, -1, 0);
No glyph images will be stored in the bitmap cache (since any valid 8-bpp image will exceed 0 bytes in size).
dtTypesetterSetCachePolicy(engine, 10000, -1, -1, -1, -1, 0);
Only glyph images that are 10,000 bytes or less will be stored in the bitmap cache. This means, for example, that a 90x90 pixel 8-bpp glyph image (or smaller) will be stored in the bitmap cache (as long as it fits in it and the bitmap cache is not disabled), while a 110x110 pixel image (or larger) will never be stored in the cache.
dtTypesetterSetCachePolicy(engine, -1, -1, -1, -1, -1, 0);
All glyph images that fit in the bitmap cache will be stored there.