Next Previous Up Top Contents Index

6.6 DUIM-Graphics Module

draw-text

Generic function

Summary

Draws text at the specified point, in a specified direction.

Signature

draw-text drawable text x y #key start end align-x align-y towards-point transform-glyphs? => ()
draw-text* drawable text point #key start end align-x align-y towards-point transform-glyphs? => ()

Arguments

drawable
An instance of type type-union(<sheet>, <medium>).

text
An instance of type type-union(<string>, <character>).

start
An instance of type <integer>. Default value: 0.

end
An instance of type <integer>. Default value: size(text).

align-x
An instance of type one-of(#"left", #"right", #"center"). Default value: #"left".

align-y
An instance of type one-of(#"top", #"bottom", #"baseline"). Default value: #"baseline".

transform-glyphs?
An instance of type <boolean>. Default value: #f.

do-tabs?
An instance of type <boolean>. Default value: #f

The following arguments are specific to draw-text.

towards-x
An instance of type <real>.

towards-y
An instance of type <real>.

x
An instance of type <real>.

y
An instance of type <real>.

The following arguments are specific to draw-text*.

towards-point
An instance of type <transform>.

point
An instance of type <transform>.

Values

None.

Library

duim-graphics

Module

duim-graphics

Description

Draws text from text on drawable at (x,y). Text is drawn in the direction of the point (towards-x,towards-y).

If start and end are specified, then only a section of text is drawn, starting at character start, and ending with character end. By default, the whole of text is drawn.

The align-x and align-y arguments let you specify the left-right alignment and the top-bottom alignment (respectively) of the text that is written to drawable.

For align-x, the whole of the distance between (x,y) and (towards-x,towards-y) is used to align text. Thus, if align-x is #"right", the text will appear closer to (towards-x,towards-y) than to (x,y), assuming text occupies less space than the distance between these two points.

The argument transform-glyphs? controls whether the text is reversed in cases when towards-x is less than x. If transform-glyphs? is #t, then text is reversed in these cases, that is, the last character of text to be written is still closest to the point (towards-x,towards-y), and the text appears reversed. If transform-glyphs? is #f, then the first character of text to be written is closest to the point (towards-x,towards-y), and the text does not appear reversed.

If do-tabs? is #t, then any tab characters in text are honored, and are drawn as tabs. If do-tabs? is #f, then tab characters are replaced by spaces.

The function draw-text* is identical to draw-text, except that it passes composite objects, rather than separate coordinates, in its arguments. You should be aware that using this function may lead to a loss of performance.

See also

draw-image, page 420

draw-pixmap, page 425


Functional Developer Library Reference: DUIM - 3 Dec 1998

Next Previous Up Top Contents Index