MGL_vecFontEngine

Generates the commands to draw a vectored font.

Declaration

ibool MGLAPI MGL_vecFontEngine(
int x,
int y,
const char *str,
void (MGLAPIP move)(int x,int y),
void (MGLAPIP draw)(int x,int y))

Prototype In

mgraph.h

Parameters

x | x coordinate to start drawing text at
y | y coordinate to start drawing text at
str | Character string to draw
move | Routine to call to perform a move operation
draw | Routine to call to perform a draw operation

Return Value

True if the string is correctly rasterized, false if font is not a vector font.

Description

This function calls a set of user supplied routines to rasterize the characters in a vector font. This allows the vector fonts to be drawn in 2D or 3D floating point coordinate systems by transforming each of the coordinates required to draw each character by any arbitrary transformation, or in any coordinate system that the users desires.

The move routine is called to move the cursor to a new location, and the draw routine is used to perform a draw operation from the current location to the specified location. Each character in the vector font is started with a move operation.

Note that the coordinates passed to the move and draw routines will be offset from the point (x,y), where the point (x,y) is the origin of the first character (i.e. it lies on its baseline). Note also that the coordinates will be relative to the origin with the origin at the lower left corner of each character (i.e. inverse of normal device coordinate y-axis values).

This routine does not honor the standard scaling factors, but simply draws the characters with a size of (1,1,1,1) (because scaling will be done by the user supplied move and draw routines).

If the passed font is not a valid vector font, this routine returns false.

See Also

MGL_drawStr, MGL_useFont

Copyright © 2002 SciTech Software, Inc. Visit our web site at http://www.scitechsoft.com