![]() |
| jit.gl.text2d | Write bitmap text |
The jit.gl.text2d object lets you draw bitmap text in the named drawing context. The text which is drawn can be sent as a symbol, a list of symbols, or as a jit.matrix containing char data. When a jit.matrix is used, each row of the matrix is interpreted as one line of text.
Notes:
Due to differences in implementation, the rotate, scale, screenmode, classic, and interp attributes are currently only supported on Macintosh. On PC, it behaves similar to when classic mode on Macintosh is turned on.
On Macintosh, this object interprets the input text as Unicode, allowing the display of non-Roman fonts. The Unicode encoding to use is determined based on the current font, set using the font message, and the operating system’s script system and region code settings.
| GL Group |
| Attributes: |
| Name | Type | Description |
| align | int |
Alignment for rows of text. (default = 0 (left)) 0 = left 1 = center 2 = right |
| leadscale | float | The leading between multiple rows of text as a multiple of the standard leading. (default = 1.) |
| plane | int | The plane of a multi-plane char input matrix which will be interpreted as text. (default = 0) |
| screenmode | int |
Macintosh only If screenmode = 1, some 3D transformations are skipped so that pixel-accurate text can be drawn. The origin of the text on screen is determined by the usual projection of the object’s position, but the text remains the same size. Rotation is only applied around the z axis. Screenmode is useful for making fixed-size labels which follow objects in space. With screenmode off, the text is transformed in space in the usual way for an OB3D-group object. (default = 1) |
| interp | int |
Macintosh only Controls whether interpolation is used to draw textures when not in classic mode. (default = 1) |
| tracking | float | The tracking (intra-character spacing) as a multiple of the standard tracking for the face. (default = 1.) |
| Messages: |
| append [text-to-append (list)] |
| Appends the specified symbol or list to the stored text string. |
| classic [classic (int)] |
|
Macintosh only When classic mode is enabled, the characters are drawn using the glBitmap mechanism in the OpenGL machine. This produces characters which are not antialiased and cannot be rotated or scaled. On PC, this is the only supported behavior, and there is no possibility to turn on/off. |
| font [fontname (symbol)] [size (int)] |
| Specifies the font in which to draw. An optional size parameter can follow the font. |
| size [size (int)] |
| Specifies the size in which to draw. |
| face [face-variant (list)] |
| Specifies the face variant of the current font. One or more face variants may be specified. The supported font faces are normal, bold, and italic. Note that some fonts do not contain different faces. |
| jit_matrix [matrix-name (symbol)] |
| Replaces the current text string with the contents of the jit.matrix containing char data. The data are interpreted as Unicode text in the encoding best matching the current font. |
| text [text (list)] |
| Replaces the current text string with a symbol or list of symbols. |
| Example: |
