Package: cairo

Function cairo:line-width

Lambda List

cairo:line-width (cr)

Syntax

(cairo:line-width cr) => width
(setf (cairo:line-width cr) width)

Arguments

cr -- a cairo:context-t instance
width -- a number coerced to a double float for the line width

Details

The cairo:line-width function returns the current line width value within the Cairo context. The (setf cairo:line-width) function sets the current line width. Note that the value is unchanged even if the current transformation matrix (CTM) has changed between the calls to the cairo:line-width and (setf cairo:line-width) functions.

The line width value specifies the diameter of a pen that is circular in user space, though device-space pen may be an ellipse in general due to scaling/shear/rotation of the current transformation matrix (CTM).

As with the other stroke parameters, the current line width is examined by the cairo:stroke and cairo:stroke-extents functions, but does not have any effect during path construction.

The default line width value is 2.0.

Notes

When the description above refers to user space and CTM it refers to the user space and CTM in effect at the time of the stroking operation, not the user space and CTM in effect at the time of the call to the (setf cairo:line-width) function. The simplest usage makes both of these spaces identical. That is, if there is no change to the CTM between a call to the (setf cairo:line-width) function and the stroking operation, then one can just pass user-space values to the (setf cairo:line-width) function and ignore this note.
 

See also

2025-1-2