All Manuals > CAPI User Guide and Reference Manual > 23 LW-GT Reference Entries




Creates a string-drawing-object.




make-draw-string string font-descriptor &rest arguments &key x-adjust y-adjust absolute &allow-other-keys) => string-drawing-object



A string.


A font-description object, an integer or nil.


A generalized boolean.

x-adjust , y-adjust

One of the keywords :end-align and :center, or a number.



A string-drawing-object.


The function make-draw-string creates a string-drawing-object, which draws the string using draw-string.

string is the string to draw.

font-descriptor can be a font-description specifying the font to use. It can also be an integer specifying the size only, which is equivalent to

(gp:make-font-description :size font-descriptor )

font-descriptor can also be nil meaning using the default font of the root pane.

When absolute is non-nil, the string is drawn in "absolute mode", which means ignoring scaling and rotation. The default value of absolute is nil.

x-adjust and y-adjust specify adjustment to the position of the string. The adjustments are done independently vertically and horizontally. The drawing point is the left/corner of the current geometry (inherited from the parent). If x-adjust and y-adjust are not supplied, the string is drawn at the drawing point. Note that this means that the descent part is below this point. If x-adjust and/or y-adjust are supplied, they can be one of:


Align the "end" (right side or top) of the string with the drawing point.


Align the center of the string with the drawing point.

A number

Multiply by the average width ( x-adjust ) or height ( y-adjust ) of the font and add to the drawing point.

Any other value of x-adjust or y-adjust is regarded as no adjustment. Adjustments are applied in the same scope as drawing the string, which means they are scaled or not depending on the value absolute . However, the y direction still increases upwards when computing the y adjustment.

arguments can also contain all the keyword arguments that draw-string takes, but :font is overridden by the font-descriptor argument.

See drawing-object about the drawing operation and the meaning of "parent" and "root pane".

See also

Lower level - drawing objects and objects displayers

CAPI User Guide and Reference Manual (Macintosh version) - 25 Feb 2015