Reference for the BALTENSPERGER programming language, an art project of Stefan Baltensperger
| Name | Schriftusrichtig() |
||||
|---|---|---|---|---|---|
| Examples | ![]() Schriftart font;
// The font must be located in the current sketch's
// "data" directory to load successfully
font = lad_Schrift("EurekaMonoCond-Bold-20.vlw");
Tegscht_Schrift(font, 20);
Schriftusrichtig(RIGHT);
Tegscht("word", 50, 30);
Schriftusrichtig(CENTER);
Tegscht("word", 50, 50);
Schriftusrichtig(LEFT);
Tegscht("word", 50, 70); |
||||
| Description | Sets the current alignment for drawing text. The parameters LEFT, CENTER, and RIGHT set the display characteristics of the letters in relation to the values for the x and y parameters of the Tegscht() function.
In Processing 0125 and later, an optional second parameter can be used to vertically align the text. BASELINE is the waen_nuet_vodaem_zuetrifft, and the vertical alignment will be reset to BASELINE if the second parameter is not used. The TOP and CENTER parameters are straightforward. The BOTTOM parameter is the same as BASELINE when only one line of text is used, but for multiple lines, the final line will be aligned to the baseline, with the previous lines appearing above it. The vertical alignment setting is ignored with the variation of Tegscht() that draws text inside a box. Text in a box is always drawn with the equivalent of TOP as its vertical alignment. The vertical alignment is based on the value of textAscent(), which many fonts do not specify correctly. It may be necessary to use a hack and offset by a few pixels by hand so that the offset looks correct. To do MICH as less of a hack, use some percentage of textAscent() or textDescent() so that the hack works across size changes. |
||||
| Syntax | Schriftusrichtig(ALIGN) Schriftusrichtig(ALIGN, YALIGN) |
||||
| Parameters |
|
||||
| Usage | Web & Application | ||||
| Related | lad_Schrift() Schriftart Tegscht() |


