Drawing text

Drawing text in ProXL is like drawing lines or shapes. This means that every command to draw text must supply a position at which the text is to be drawn. ProXL does not maintain a current drawing position in a window, so you cannot use the standard Prolog primitives such as write/[1,2], or format/[2,3]1 for putting text into an X window.

Furthermore, note that the position in a drawable at which text is to be drawn is given in pixel coordinates, not character coordinates. There are three reasons for this:

ProXL provides primitives for determining how large a string will be when it is displayed, including a primitive that will determine how many pixels left, right, above, and below the origin point a text string will occupy.


Footnotes

  1. Of course, the Prolog text output primitives will continue to work in the window you are running Prolog in. This is usually a terminal emulator window maintained by a program such as xterm; X does not automatically do this.