All Manuals > CAPI User Guide and Reference Manual > 22 GRAPHICS-PORTS Reference Entries

draw-string Function

Summary

Draws a string with the baseline positioned at a given point.

Package

graphics-ports

Signature

draw-string port string x y &rest args &key start end block

Arguments
port
A graphics port.
string
A string.
A real number.
A real number.
args
graphics-state parameters passed as keyword arguments.
start
A real number.
end
A real number.
block
A boolean.
Description

The function draw-string draws the string string with the baseline starting at (x y). The transform, foreground, background, operation, stipple, pattern, mask, mask-transform, font, text-mode and compositing-mode from port's graphics-state are all used, unless overridden in args.

start and end specify which elements of string to draw. The default value of start is 0.

block, if true, causes each character to be drawn in a character cell filled with the background of port's graphics-state.

You can draw with the system highlight by setting graphics-state parameter foreground :color_highlighttext and background :color_highlight.

Notes

The graphics-state parameter operation is not supported for drawing text on Microsoft Windows.

Examples
(let ((op (capi:contain 
           (make-instance 'capi:output-pane
                          :background :red))))
  (gp:draw-string op "highlighted"
                  10 10
                  :graphics-args 
                  (list :foreground 
                        :color_highlighttext)))
See also

graphics-state
13 Drawing - Graphics Ports


CAPI User Guide and Reference Manual (Unix version) - 01 Dec 2021 19:33:02