You've already seen plenty of examples of text entry. The most common command is the .text command that allows you to enter text that will appear in a diagram to tell the user what's going on.
Like other primitives, text can be restricted to certain layers, and it can be drawn in various colors. To draw a line of red text that appears only on layer 3, the following will work:
.text("Text only on layer 3 in red.", .l3, .red);
The .text command can extend to more than one line, and if a newline character appears in the text, a new line is started on the screen. For example, the following lines:
.text{"Here is a line of text. Here is the second linewill draw four lines of red text, where the third line is blank. In general, the text is displayed on the screen in the order it appears in the file. Thus, the following strange collection of lines in your file:Here is the fourth line.", .red);
.text("Line 1 in red", .red, .l0); .text("Line 1 in green", .green, .l1); .text("Line 2 in yellow", .yellow, .l0);would display first a red and then a yellow line on layer 0, and on layer 1, it would draw a single line in green. Clearly, it's a good idea to keep lines of adjacent text adjacent in the file, but Geometer doesn't require it.
Geometer recognizes certain escape sequences in the text stream that are interpreted to refer to special characters. For example, the line:
.text("The \angleABC is called \alpha.");would display the following on the screen:
The ∠ABC is called α.
Geometer recognizes the following control sequences that generate special characters:
Geometer text | Character | Character Name |
---|---|---|
\triangle | Δ | triangle symbol |
\angle | ∠ | angle symbol |
\congruent | ≅ | congruent symbol |
\similar | ∼ | similar symbol |
\dotmath or \cdot | · | centered dot |
\multiply | × | multiply symbol |
\fraction | / | fraction symbol |
\degrees | ° | degrees symbol |
\circlemultiply | ⊗ | circled multiply |
\circleplus | ⊕ | circled plus |
\greaterequal | ≥ | greater than or equal |
\lessequal | ≤ | less than or equal |
\perp | ⊥ | perpendicular symbol |
\sqrt | √ | square root symbol |
\therefore | ∴ | therefore symbol |
\alpha | α | Greek alpha (lc) |
\beta | β | Greek beta (lc) |
\gamma | γ | Greek gamma (lc) |
\delta | δ | Greek delta (lc) |
\epsilon | ε | Greek epsilon (lc) |
\zeta | ζ | Greek zeta (lc) |
\eta | η | Greek eta (lc) |
\theta | θ | Greek theta (lc) |
\iota | ι | Greek iota (lc) |
\kappa | κ | Greek kappa (lc) |
\lambda | λ | Greek lambda (lc) |
\mu | μ | Greek mu (lc) |
\nu | ν | Greek nu (lc) |
\xi | ξ | Greek xi (lc) |
\omicron | ο | Greek omicron (lc) |
\pi | π | Greek pi (lc) |
\rho | ρ | Greek rho (lc) |
\sigma | σ | Greek sigma (lc) |
\tau | τ | Greek tau (lc) |
\upsilon | υ | Greek upsilon (lc) |
\phi | φ | Greek phi (lc) |
\chi | χ | Greek chi (lc) |
\psi | ψ | Greek psi (lc) |
\omega | ω | Greek omega (lc) |
\Gamma | Γ | Greek Gamma (uc) |
\Delta | Δ | Greek Delta (uc) |
\Theta | Θ | Greek Theta (uc) |
\Lambda | Λ | Greek Lambda (uc) |
\Xi | Ξ | Greek Xi (uc) |
\Pi | Π | Greek Pi (uc) |
\Sigma | Σ | Greek Sigma (uc) |
\Upsilon | Υ | Greek Upsilon (uc) |
\Phi | Φ | Greek Phi (uc) |
\Psi | Ψ | Greek Psi (uc) |
\Omega | Ω | Greek Omega (uc) |
If there are any special characters in the standard PostScript symbol font that you need that are not included in the set above, you can enter them using the character \ followed by the three-digit octal character. For example:
.text("Here is a copyright symbol: \323");will yield:
Here is a copyright symbol: ©
Geometer can also display superscripts and subscripts as follows. The line:
.text("a\sup{2}=b\sub{3}");will yield an "a" with a superscript of 2 = "b" with a subscript of 3.
To get a symbol for a line segment, for example, where a line is drawn over the characters "AB" use this:
.text("\overline{AB)");To get an arc symbol, for example, a curved "arc" symbol over the characters "AB", use this:
.text("\overarc{AB}");
For now, don't try to put special characters in superscripts, subscripts, or with overlines or arcs. Geometer will just get confused and put some sort of garbage on the screen.