MocrCopyFont()函数

Synopsis

Copy a font character to or from an image buffer.

Format

void MocrCopyFont(ImageBufId, FontId, Operation, CharListString)

MIL_ID ImageBufId; Image buffer identifier
MIL_ID FontId; Font buffer identifier
long Operation; Operation flag
char *CharListString; String containing the list of characters to copy

Description

This function copies a grayscale representation of one, or many, font characters to/from the specified image buffer. It can be used to initialize a font, to change a font, or to obtain a visual representation of the font’s characters.

The ImageBufId parameter specifies the identifier of the image buffer to/from which characters are copied. If the image buffer is being copied to, it must be large enough to hold the representations of all the specified characters. You can use MocrInquire to determine the number of characters in the font and the size of each character.

The FontId parameter specifies the identifier of the font to/from which the characters are copied.

The Operation parameter specifies the direction of the copy operation. It can take one of the following values:

M_COPY_TO_FONT Copy character(s) from an image buffer to a font buffer.
M_COPY_FROM_FONT Copy character(s) from a font buffer to an image buffer

If the M_ALL_CHAR suffix is added to M_COPY_TO_FONT or to M_COPY_FROM_FONT, the CharListString parameter is ignored (it should be set to M_NULL) and all font characters are copied to/from the image buffer, stacked from left to right and from top to bottom.

The CharListString parameter specifies a string containing the list of characters to be copied. This string must be null-terminated.

If M_COPY_TO_FONT is specified and a character exists in both the list and the font, the font character grayscale representation will be overwritten with the data of the character from the list. New characters will be added to the font provided that there are sufficient free entries.

If M_COPY_FROM_FONT is specified, CharListString must point to the list of characters to be copied from the font. The grayscale representation of font characters specified in this list will be copied to the specified image buffer.

The CharListString parameter must be set to M_NULL if M_ALL_CHAR is added to the Operation parameter.

See also

MocrAllocFont, MocrSaveFont, MocrInquire, MocrImportFont

《MocrCopyFont()函数》上有1条评论

评论已关闭。