gpi12.hlp (Table of Contents; Topic list)
GpiSetCharAngle (1.2)
Function Group  Overview                          Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_GPIPRIMITIVES
 
BOOL GpiSetCharAngle(hps, pgradlAngle)
HPS hps;                   /* presentation-space handle                */
PGRADIENTL pgradlAngle;    /* address of structure with baseline angle */
 
The GpiSetCharAngle function sets the character angle. The character angle
specifies the angle at which characters are drawn, relative to the x-axis.
The function uses the point specified by the pgradlAngle parameter to
compute the character angle. Any characters drawn are set on a baseline that
is parallel to a line drawn through the specified point and the origin.
 
If the attribute mode is AM_PRESERVE, the function saves the previous
character angle on the attribute stack when it sets the new angle. The
previous character angle can be retrieved by using the GpiPop function.
 
Parameter    Description
────────────────────────────────────────────────────────────────────────────
 
hps          Identifies the presentation space.
 
pgradlAngle  Points to the GRADIENTL structure that contains a point that
             defines the character angle. If both fields in the structure
             are zero, the function sets the character angle to the default
             value.
 
Return Value
 
The return value is GPI_OK if the function is successful or GPI_ERROR if an
error occurred.
 
Errors
 
Use the WinGetLastError function to retrieve the error value, which may be
one of the following:
 
     PMERR_INV_CHAR_ANGLE_ATTR
     PMERR_INV_HPS
     PMERR_PS_BUSY
 
Comments
 
The character angle is used only when the character mode is CM_MODE2 or
CM_MODE3, as set by the GpiSetCharMode function. In CM_MODE2, the system
uses the character angle to compute the position of each character along the
baseline. However, when the system draws a character, it places only the
lower-left corner of the character box at the computed position. The
orientation of the character box remains relative to the x-axis instead of
the baseline. In CH_MODE3, the character boxes are rotated to be
perpendicular to the character baseline. If the world-coordinate system is
such that one x-axis unit is not physically equal to one y-axis unit, a
rotated character string appears to be sheared.
 
See Also
 
GpiQueryCharAngle, GpiSetAttrMode, GpiSetAttrs, GpiSetCharMode,
WinGetLastError, GRADIENTL