GrGetGCTextSize()

Name

GrGetGCTextSize() -- Calculate size of a text drawing

Synopsis

void GrGetGCTextSize ( GR_GC_ID gc , void * str , int count , int flags , GR_SIZE * retwidth , GR_SIZE * retheight , GR_SIZE * retbase );

Description

This function calculates the dimensions of the specified text string, if the string were to be drawn with the graphics context gc.

Parameters

TypeNameDescription
GR_GC_IDgcThe ID of the graphics context to use when calculating the string dimensions.
void*strThe input string. If the string is NOT zero terminated, then the length of the string must be specified in the count parameter.
intcountThe length of the string. This parameter can be set to -1 if the string is zero terminated andflags contains GR_TFASCII.
intflagsText rendering flags, can be a combination of the flags listed below.
GR_SIZE*retwidthPoints to the variable that the text width will be returned in.
GR_SIZE*retheightPoints to the variable that the text height will be returned in.
GR_SIZE*retbasePoints to the variable that the text baseline height will be returned in.

The flags parameter is a combination of flags from the following three groups. The combination can include one encoding flag, one alignment flag and multiple attribute flags.

String encoding flags:

GR_TFASCIIGR_TFUTF8
GR_TFUC16GR_TFUC32

Text alignment flags:

GR_TFTOPGR_TFBASELINEGR_TFBOTTOM

Text attribute flags:

GR_TFKERNINGGR_TFANTIALIASGR_TFUNDERLINE

See Also

GrText(), GrSetGCFont().