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
gschem 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.
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:
- ‘lower-left’
- ‘middle-left’
- ‘upper-left’
- ‘lower-center’
- ‘middle-center’
- ‘upper-center’
- ‘lower-right’
- ‘middle-right’
- ‘upper-right’
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:
- ‘name’
- ‘value’
- ‘both’
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 arc 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 alignment of text as one of the following symbols:
- ‘lower-left’
- ‘middle-left’
- ‘upper-left’
- ‘lower-center’
- ‘middle-center’
- ‘upper-center’
- ‘lower-right’
- ‘middle-right’
- ‘upper-right’
Returns the angle that text is displayed at as an integer multiple of 90 degrees.
Set the string content of text to str. str must not contain any null characters (‘#\0’ in Scheme, Unicode ‘U+0000’).