BlitFontChar

Blits character pixels from font data area into memory buffer.

Synopsis

int32 BlitFontChar(FontDescriptor *fDesc,uint32 theChar, void *blitInfo, void *dstBuf,int32 dstX,int32 dstY,int32 dstBPR,int32 dstColorIndex,int32 dstBPP)

Description

Blits character pixels from the font data area into a memory buffer, performing any font format specific data decompression as needed.

BlitFontChar() supports the internals of the text library; it should never be necessary to call this function directly from an application program. If you are implementing your own replacement text library, use BlitFontChar() to render the font character pixels into your own memory buffer. You can use the standard text library source code as a guide in creating your own text library.

BlitFontChar() currently supports only 8-bit-per-pixel destination format, and always creates pixels suitable for an 8-bit coded cel with AMV (alternate multiplier value) used to scale pixels already in the cell for anti-aliasing.

Arguments

fDesc
Pointer to a FontDescriptor structure.
theChar
The specific character you want to blit to the buffer.
blitInfo
Value returned from GetFontCharInfo() via its **blitInfo parameter, or NULL. If you pass NULL, an internal call to GetFontCharInfo() is made. If you are already calling GetFontCharInfo() before blitting each character, you can eliminate this potentially expensive internal call by saving the blitInfo from your call and passing it to this function.
destBuf
Pointer to the cel buffer into which you want to blit the character pixels.
dstX
X coordinate within the destBuf.
dstY
Y coordinate within the destBuf.
dstBPR
Bytes-per-row of the destBuf.
dstColorIndex
For 8-bit-per-pixel destination buffers, the color index to OR into each pixel as the character pixels are placed into the buffer. The value must be in the range of 0 through 3 inclusive.
dstBPP
Bits-per-pixel of the destination buffer.

Return Value

Width of the character, in pixels. Zero indicates no pixels were placed in the destination buffer because the character is not within the range of characters stored in the font.

Associated Files

lib3do.lib, fontlib.h

See Also

GetFontCharInfo