The Display library is a library for controlling font setting and acquisition, and screen drawing.

The outline of the Display library is as follows.

Character set

With the OPH-5000i English version, you can use one of the following character sets.
CP437_ose
This is default character set of the OPH-5000i English version.
CP1252
You can use the CP1252 library to change the character set to CP1252. (System E7.0 or later)

With the OPH-5000i Japanese version, you can use SJIS.

Set font type

Set or get the font type to display with the following functions.
SetFont function
GetFont function
The currently set font size can be obtained with the following function.
GetFontSize function

You can specify the following font types.
Font type Description
TINY_FONT Font with 6 dots wide x 6 dots high.
ASCII characters:
 
SMALL_FONT Font with 8 dots wide x 8 dots high.
ASCII characters:
 
MEDIUM_FONT Font with 6 dots wide x 12 dots high. (Default font type)
In the Japanese version, if you specify a SJIS Kanji code, a Kanji character with 12 dots wide x 12 dots high will be displayed.
ASCII characters: Kanji characters:
   
LARGE_FONT Font with 8 dots wide x 16 dots high.
In the Japanese version, if you specify a SJIS Kanji code, a Kanji character with 16 dots wide x 16 dots high will be displayed.
ASCII characters: Kanji characters:
   
LARGE_FONT2 This font type is only supported in the Japanese version.
Font with 8 dots wide x 16 dots high.
If you specify a SJIS Kanji code, a Kanji character with 16 dots wide x 16 dots high will be displayed.
Displays ASCII characters with lighter weights than LARGE_FONT.
ASCII characters: Kanji characters:
   
HUGE_FONT Font with 12 dots wide x 24 dots high.
In the Japanese version, if you specify a SJIS Kanji code, a Kanji character with 24 dots wide x 24 dots high will be displayed.
ASCII characters: Kanji characters:
   


Screen coordinates

The screen coordinates of this product are as follows.

You can use the following macros.
Macro name Value Description
DISP_WIDTH 128 Width of the screen
DISP_HEIGHT 160 Height of the screen


Character coodinates

The character coordinates for each font type and the macros that represent them are as follows.

Font type Character coordinates Macro name Value
TINY_FONT TINY_FONT_X_MAX
TINY_FONT_Y_MAX
21
26
SMALL_FONT SMALL_FONT_X_MAX
SMALL_FONT_Y_MAX
16
20
MEDIUM_FONT MEDIUM_FONT_X_MAX
MEDIUM_FONT_Y_MAX
21
13
LARGE_FONT
LARGE_FONT2
LARGE_FONT_X_MAX
LARGE_FONT_Y_MAX
16
10
HUGE_FONT HUGE_FONT_X_MAX
HUGE_FONT_Y_MAX
10
6


Move cursor position

The character is displayed at the cursor position represented by the character coordinates.

When the screen is cleared, the cursor position is initialized to the upper left corner (0, 0) of the screen.

When you display a character, the cursor moves to the position next to the last displayed character.

You can move the cursor position by specifying the character coordinates with the following function.
GotoXY function

You can get the character coordinates of the current cursor position with the following function.
WhereX function
WhereY function


Set cursor behavior

Set the cursor behavior with the following function.
Cursor function

You can specify the following:
  • Specify the cursor display method from {No cursor display, cursor display, blinking cursor display}.
  • Specifies whether to wrap around to the next line when the end of a line is reached.


Set line spacing for character display

By setting the line spacing, you can leave a specified number of pixels between each line.

You can set or get the line spacing with the following function. The initial value of the line spacing is 0.
SetLineSpacing function

You can get the line height by adding the line spacing to the character height with the following function.
GetLineHeight function

The Screen coordinate Y of the characters to be displayed is calculated by the following formula.

Screen coordinate Y = (Character height + Line spacing) × Character coordinate Y + Offset Y



Set offset for character display

By setting an offset, you can move the display position of characters in pixel units.

You can set or get the offset with the following functions. The initial value of the offset is 0.
SetOffset function
GetOffset function

The Screen coordinates of the characters to be displayed are calculated by the following formula.

Screen coordinate X = Character width × Character coordinate X + Offset X
Screen coordinate Y = (Character height + Line spacing) × Character coordinate Y + Offset Y



Set display color

Set or get the display color with the following functions.
SetTextColor function
SetBackColor function
SetCursorColor function


Display characters

Display the characters with the following functions.
printf function (stdio.h)
vprintf function (stdio.h)
putchar function (stdio.h)
puts function (stdio.h)
PrintSymbol function


Display image

Display the image with the following functions.
ShowBMP function
ShowGIF function
ShowJPG function
ShowJPG_File function
ShowPicture function


Draw a shape

Draw a shape with the following functions.
DrawCircle function
DrawEllipse function
DrawLine function
FillCirclee function
FillEllipse function
FillScreen function
SetPixel function


Clear the screen

Clear the screen with the following function.
ClearDisplay function

You can also clear the screen by displaying the special character '\f'.


Save/restore the screen

You can save and restore the current screen display as an image with the following functions.
SaveDisplay function
LoadDisplayy function
GetScreen function
SetScreen function


Scroll the screen

The following function scrolls the current screen display.
ScrollUp function


Show status bar

Set the status bar display with the following function.
OsStatust function

The status bar is displayed in the area with a height of 16 dots at the bottom of the screen.



Control LCD backlight

The following function turns the LCD backlight on and off.
BackLight function

Set the brightness of the LCD backlight with the following function.
BackLightLvl function



Last updated: 2023/01/16