Next: Components, Previous: Pictures, Up: Core object functions [Contents][Index]
Text fulfils two roles, as straightforward labels and notes on
schematics and symbols, and as attached or floating attributes
(see Attributes). A text object
can be aligned in
different ways relative to its anchor position, and can be displayed
in different font sizes.
Any text can be set to be visible or invisible on printed output (and
lepton-schematic provides ways to preview invisible text). When a text
object
is an attribute (i.e. its string is in a
‘name=value’ format) then the visibility settings are
more fine-grained: the text can be set to display just the attribute
name, just the attribute value, or both.
See Attributes.
Returns ‘#t’ if and only if object is a text object
.
Creates and returns a new text object
. anchor is the
position of the anchor of the new text in the form (x . y)
, and
align is a symbol determining how the text should be aligned
relative to the anchor. align must be one of the following
symbols:
For example, if align is ‘upper-center’, the anchor will be located at the top center of the rendered text block.
angle should be an integer multiple of 90 degrees, determining
the angle which the text should be displayed at. string is the
string contents for the text
object, and must not contain any
null characters (‘#\0’ in Scheme, Unicode
‘U+0000’). size is the font size to use. If visible
is ‘#f’, the text will be invisible; otherwise, it will be
visible.
When the string is in an attribute format (see Attributes), the show argument determines which parts of the string will be displayed. It must be one of the following symbols:
If color is specified, it should be the integer color map index of the color with which to draw the text. If color is not specified, the default text color is used.
Sets the parameters of text. The arguments are the same as to
make-text
. Returns text.
Returns the parameters of text as a list in the form:
((anchor-x . anchor-y) align angle string size visible show color)
See make-text
for a description of all of these parameters.
Returns the position of the anchor of text in the form
(x . y)
.
Returns the alignment of text as one of the following symbols:
Returns the angle that text is displayed at as an integer multiple of 90 degrees.
Returns the string content of text.
Set the string content of text to str. str must not contain any null characters (‘#\0’ in Scheme, Unicode ‘U+0000’).
Return the font size of text as an integer.
Returns ‘#t’ if and only if text is set to be visible.
If visible? is ‘#f’, sets text to be invisible; otherwise, sets it to be visible.
Returns a symbol indicating which parts of text will be displayed when text is a valid attribute. The returned value will be one of the following symbols:
Next: Components, Previous: Pictures, Up: Core object functions [Contents][Index]