Index

CDTEngineV8

TypesetterSetCacheCompression

This function enables or disables compression of glyph images in Typesetter's bitmap cache. Prior to D-Type Engine version 4.0.4.2, glyph images were always stored in the bitmap cache as non-compressed 8-bpp grayscale bitmaps. Starting with version 4.0.4.2, glyph images can also be stored in a highly compact (compressed) format. This function makes it possible to enable or disable this compression.

Parameters

ParameterDescription

bitmap_compress

A flag which specifies whether bitmap compression should be enabled or disabled.

  • If 0 (DV_COMPRESSION_OFF), all glyph images in the bitmap cache are stored as non-compressed 8-bpp grayscale bitmaps.

  • If 1 (DV_COMPRESSION_ON), all glyph images in the bitmap cache are stored in a compressed format. This format is particularly suitable for compressing 8-bpp grayscale bitmaps.

reserved

Reserved for future use. Must be set to 0.

Return Value

If successful, the return value is 1. Otherwise, the function returns 0.

Comments

Bitmap cache compression is extremely fast and effective. If enabled, bitmaps will be cached in a compressed format and will consume 3-10 times less space in the bitmap cache than non-compressed bitmaps. This is highly recommended when the size of the bitmap cache is small (e.g. in memory constrained environments) or when the Typesetter's quality level is set to one of the LCD quality levels (since bitmaps optimized for LCD screens consume three times more storage space than regular bitmaps).

Note 1: When the bitmap cache compression is enabled and your application attempts to obtain a pointer to a memory location in the bitmap cache at which the grayscale memory bitmap data begins (e.g. using the GlyphDoOutput function), please remember that in this case the bitmap data will be compressed. You will not be able to read this data without first decompressing it. You can use the BitmapDecompress function to decompress compressed grayscale bitmap data.

Note 2: Bitmap cache compression can also be enabled or disabled during the initialization of D-Type Engine. For details, please review the structure of the dtype.inf file in the Initialization Files section of this document.

Example

A plain 8-bpp grayscale bitmap of the glyph S      A plain 8-bpp grayscale bitmap of the glyph "S". The dimensions of this bitmap are 84 x 108 pixels. Thus, this bitmap will consume 9072 bytes of storage space in the bitmap cache (if stored non-compressed). Note that if this bitmap was optimized for LCD screens, it would consume even more space in the bitmap cache (three times as much).
 
A representation of the compressed grayscale bitmap of the glyph S      A representation of the compressed grayscale bitmap of the same glyph "S". This compressed bitmap will consume only 1395 bytes of storage space in the bitmap cache which is about 15% of the original non-compressed size. Thus, by using the bitmap compression we were able to reduce this bitmap's storage requirements by more than 6.5 times!

 


 

Index