beautypg.com

2 writing text to the display, 3 text commands – Matrix Orbital GLK12232-25-WBL User Manual

Page 13

background image

3.2

Writing Text to the Display

When the display receives a character, it displays that character at the position currently defined. The next

character sent to the module then advances to the following position on the display. Characters are drawn
using the currently selected font, and only characters defined in the current font are actually processed.
Characters which are not defined by the current font are ignored, and the positioning is not advanced for the
next character.

The position where text is to be displayed is a single pixel location stored in the display’s volatile memory

and maintained internally by the display’s firmware. It can be manually manipulated with two commands;

1. Set current text position (254 71 [col] [row]) positions the characters using a text oriented coordinate

system, dividing the display into character cells.

2. Set text cursor - pixel values (254 121 [x][y]) Sets text cursor to position (x,y), where x and y are in

pixels. Value is top left corner of next text character. This positions the character at a specific pixel,
allowing more ’fine grained’ control when needed.

3.3

Text Commands

In this section commands are identified by their names and decimal values. Hex and ASCII equivalents

are given in the summary.

3.3.1

Auto scroll on (254 81)

When auto scrolling is on, it causes the display to shift the entire display’s contents up to make room for

a new line of text when the text reaches the scroll position defined by the "Set font metrics" command in the
display memory (normally the bottom right character position - default value for the GLK12232-25-WBL is
64).

3.3.2

Auto scroll off (254 82)

When auto scrolling is disabled, text will wrap to the top left corner of the display area. Existing graphics

or text in the display area are not erased before text is placed. When using proportional fonts without auto
scrolling, care should be taken to clear areas where text is being written, particularly when wrapping occurs.
This may be done using the "Draw solid rectangle" command with the colour set to white.

3.3.3

Set text insertion point (254 71 [col] [row])

This command sets the insertion point to the [column] and [row] specified. The insertion point is posi-

tioned using the base size of the current font (this command does not position the insertion point at a specific
pixel). The pixel column used is determined by multiplying the width of the widest character in the font
by [column]. The pixel row used is determined by multiplying the height of the font by [row + interline
spacing].

Matrix Orbital

GLK12232-25-WBL

9