Expand/Shrink

cdCanvasSetTextAlignment

Definition: include pGUI.e

cdCanvasSetTextAlignment(cdCanvas canvas, integer alignment)
-- or --
integer alignment = cdCanvasGetTextAlignment(cdCanvas canvas)
Description: Defines the vertical and horizontal alignment of text.

alignment: one of  
CD_NORTH, CD_SOUTH, CD_EAST, CD_WEST,
CD_NORTH_EAST, CD_NORTH_WEST, CD_SOUTH_EAST, CD_SOUTH_WEST,
CD_CENTER, CD_BASE_RIGHT, CD_BASE_LEFT, CD_BASE_CENTER.
Default value: CD_BASE_LEFT (==CD_SOUTH_WEST).
pwa/p2js: Supported. However note the (minor) discrepancy detailed in the technicalia.
Replaced by the align parameter of gCanvasText() in xpGUI (and/or one day perhaps a TEXTALIGN attribute).
Description: The following diagram illustrates for all 12 settings (or technically 9 as per the dropdown below) where the text will be drawn relative to a specified x,y position as indicated by the six asterisks:


When translating C code, cdCanvasTextAlignment() must have Set/Get inserted.
The old school cdTextAlignment() routine that did not need an explicit canvas is apparently no longer operational (as of IUP version 3.25, not my call or decision, and not that it bothers me much).
Expand/Shrink