All Manuals > CLIM 2.0 User Guide > 3 The CLIM Drawing Environment

3.3 CLIM Line Styles

A line is a one-dimensional object. In order to be visible, however, the rendering of a line must occupy some non-zero area on the display hardware. CLIM uses a line style object to represent the advice supplied to the rendering substrate on how to perform the rendering.

It is often useful to create a line style object that represents a style you wish to use frequently, rather than continually specifying the corresponding line style suboptions.

line-style Protocol Class

Summary: The protocol class for line styles. If you want to create a new class that behaves like a line style, it should be a subclass of line-style. Subclasses of line-style must obey the line style protocol.

line-style-p Function

line-style-p object

Summary: Returns t if object is a line style; otherwise, it returns nil.

standard-line-style Class

Summary: An instantiable class that implements line styles. A subclass of line-style, this is the class that make-line-style instantiates. Members of this class are immutable.

make-line-style Function

make-line-style &key unit thickness joint-shape cap-shape dashes

Summary: Returns an object of class standard-line-style with the supplied characteristics. The arguments and their default values are described in 3.3 CLIM Line Styles.

Each of the following suboptions has a corresponding reader that can be used to extract a particular component from a line style. The following generic functions comprise the line style protocol; all subclasses of line-style implement methods for these generic functions.

:line-unit Option

line-style-unit Generic Function

line-style-unit line-style

Summary: Gives the unit used for measuring line thickness and dash pattern length for the line style. Possible values are as follows:

:line-thickness Option

line-style-thickness Generic Function

line-style-thickness line-style

Summary: The thickness, in the units indicated by line-style-unit, of the lines or arcs drawn by a drawing function. The thickness must be a real number. The default is 1, which, when combined with the default unit of :normal, means that the default line drawn is the "comfortably visible thin line".

:line-joint-shape Option

line-style-joint-shape Generic Function

line-style-joint-shape line-style

Summary: Specifies the shape of joints between segments of unfilled figures. The possible shapes are :miter, :bevel, :round, and :none; the default is :miter. Note that the joint shape is implemented by the host window system, so not all platforms will necessarily fully support it.

Line Joint Shapes

:line-cap-shape Option

line-style-cap-shape Generic Function

line-style-cap-shape line-style

Summary: Specifies the shape for the ends of lines and arcs drawn by a drawing function, one of :butt, :square, :round, or :no-end-point; the default is :butt. Note that the cap shape is implemented by the host window system, so not all platforms will necessarily fully support it.

Line Cap Shapes

:line-dashes Option

line-style-dashes Generic Function

line-style-dashes line-style

Summary: Controls whether lines or arcs are drawn as dashed figures, and if so, what the dashing pattern is. Possible values are:

make-contrasting-dash-patterns Function

make-contrasting-dash-patterns n &optional k

Summary: If k is not supplied, this returns a vector of n dash patterns with recognizably different appearance. Elements of the vector are guaranteed to be acceptable values for :dashes, and do not include nil, but their class is not otherwise specified. The vector is a fresh object that may be modified.

If k is supplied, it must be an integer between 0 and n–1 (inclusive), in which case make-contrasting-dash-patterns returns the kth dash-pattern rather than returning a vector of dash-patterns.

CLIM has at least 8 different contrasting dash patterns. If n is greater than 8, make-contrasting-dash-patterns signals an error.

contrasting-dash-pattern-limit Generic Function

contrasting-dash-pattern-limit port

Summary: Returns the number of contrasting dash patterns that can be rendered on any medium on the port port. It is at least 8. All classes that obey the port protocol implement a method for this generic function.


CLIM 2.0 User Guide - 01 Dec 2021 19:38:56