These functions process a single glyph represented by a Unicode character code (or font dependent glyph index) and retrieve its transformed (scaled) bitmap and/or outline description in pixels units. The glyph is processed by the Typesetter which provides type (e.g. font, transformation, outline expansion), hinting and positioning attributes to the glyph.
The Typesetter processes the outline curve in precisely the same way as in GlyphDoOutput or CharDoOutput. This means that hinting and outline transformations are preserved. Also, if the retrieved outline description is passed back to D-Type Rasterizer via the ShapeDoOutput function (and without applying any additional transformations), the resulting 8-bit grayscale bitmap image will look the same as if the glyph was rendered by a direct call to GlyphDoOutput or CharDoOutput*.
GlyphDoTransformFrac is identical to GlyphDoTransform except that some of its parameters are 24.8 signed fractional values. Similarly, CharDoTransformFrac is identical to CharDoTransform except that some of its parameters are 24.8 signed fractional values. For more details on fractional units, see the D-Type Units section of this document.
*Exception: Font outline thickness and expansion are ignored in this case!
Parameter | Description |
---|---|
char_code |
Unicode character code of the glyph to be processed. |
glyph_index |
Font dependent index of the glyph to be processed. |
x |
Glyph's X coordinate in pixels. |
y |
Glyph's Y coordinate in pixels. |
flag |
Type of processing to perform. Presently, this can be one of the following:
|
max_points |
Specifies the size of the 3-dimensional array into which the function copies the glyph's transformed outline description. |
i_arr, x_arr, y_arr |
A 3-dimensional array into which the function copies the glyph's transformed outline description. |
memory_bitmap |
Either a valid pointer to the DT_BMP structure or DV_NULL. If memory_bitmap is a valid pointer to the DT_BMP structure, then the engine will attempt to return information about the glyph's extent (and in the future its plain 8-bit grayscale memory bitmap). If successful, the structure's members will hold the following information:
If you do not wish to retrieve information about the glyph's extent, simply set memory_bitmap to DV_NULL. |
If successful, the function returns the actual number of points needed for the outline description. Otherwise, the return value is -1.
If the 3-dimensional array is not large enough to accept all the outline points (i.e. max_points is less than the return value, the function copies only the first max_points elements into the 3-dimensional array (i.e. the array will be truncated). In this case, your application can increase the size of the 3-dimensional array and call this function again with the updated value for max_points.
Note: Recommended value for max_points is 500.
The i_arr array contains instructions that describe the corresponding pair of coordinates in the x_arr and y_arr arrays. Possible values for i_arr are:
The following table describes how the 3-dimensional array should be interpreted. Please note that Quadratic B-Spline curves require two consecutive rows in the 3-dimensional array while Bézier curves require three consecutive rows.
i_arr | x_arr | y_arr |
---|---|---|
New Contour | ||
16 | X1 in pixels | Y1 in pixels |
Line | ||
20 | X1 in pixels | Y1 in pixels |
Quadratic B-Spline Curve | ||
25 | X1 in pixels | Y1 in pixels |
n | X2 in pixels | Y2 in pixels |
Bézier Curve | ||
24 | X1 in pixels | Y1 in pixels |
n | X2 in pixels | Y2 in pixels |
0 | X3 in pixels | Y3 in pixels |
Note: n = recommended number of curve segments