A basic graphics package for the LPC4088 Display Module.

Dependents:   lpc4088_displaymodule_demo_sphere sampleGUI sampleEmptyGUI lpc4088_displaymodule_fs_aid ... more

Fork of DMBasicGUI by EmbeddedArtists AB

Embed: (wiki syntax)

« Back to documentation index

SWIM font manager

SWIM font manager

This package provides basic SWIM font management capabilities such as font selection, text positioning, newline and window scrolling, and text display with multiple, selectable fonts. More...

Functions

void swim_put_text_xy (SWIM_WINDOW_T *win, const CHAR *text, int32_t x, int32_t y)
 Put text at x, y (char) position on screen.
void swim_put_text_centered_win (SWIM_WINDOW_T *win, const CHAR *text, int32_t y)
 Put text horizontally centered at y position on screen.
void swim_put_text_centered (SWIM_WINDOW_T *win, const CHAR *text, int32_t x0, int32_t x1, int32_t y)
 Put text horizontally centered between x0 and x1 at y position on screen.
void swim_set_xy (SWIM_WINDOW_T *win, int32_t x, int32_t y)
 Sets the X, Y pixel coordinates for the next text operation.
void swim_get_xy (SWIM_WINDOW_T *win, int32_t *x, int32_t *y)
 Returns the X, Y pixel coordinates for the next text operation.
void swim_put_text (SWIM_WINDOW_T *win, const CHAR *text)
 Puts a string of text in a window.
void swim_put_ltext (SWIM_WINDOW_T *win, const CHAR *text)
 Puts a string of text in a window with breaks.
void swim_window_scroll (SWIM_WINDOW_T *win, int32_t lines)
 Scrolls the window up one line.
void swim_put_char (SWIM_WINDOW_T *win, const CHAR textchar)
 Puts a single character in the window.
void swim_put_newline (SWIM_WINDOW_T *win)
 Puts a newline in the window.
void swim_set_font (SWIM_WINDOW_T *win, FONT_T *font)
 Sets the active font.
int16_t swim_get_font_height (SWIM_WINDOW_T *win)
 Returns the active font's height in pixels.
void swim_get_string_bounds (SWIM_WINDOW_T *win, const CHAR *text, int *width, int *height)
 Returns the width and height of the string rendered with the active font.
void swim_set_title (SWIM_WINDOW_T *win, const CHAR *title, COLOR_T ttlbkcolor)
 Creates a title bar for the window.
void swim_set_font_transparency (SWIM_WINDOW_T *win, int32_t trans)
 Enables and disables font backgrounds.

Detailed Description

This package provides basic SWIM font management capabilities such as font selection, text positioning, newline and window scrolling, and text display with multiple, selectable fonts.


Function Documentation

int16_t swim_get_font_height ( SWIM_WINDOW_T win )

Returns the active font's height in pixels.

Parameters:
win: Pointer to window data structure
Returns:
The height of the current font in pixels

Definition at line 372 of file lpc_swim_font.c.

void swim_get_string_bounds ( SWIM_WINDOW_T win,
const CHAR text,
int *  width,
int *  height 
)

Returns the width and height of the string rendered with the active font.

Parameters:
win: Pointer to window data structure
text: Text to render
width: Width of text in pixels
height: Height of text in pixels
Returns:
Nothing

Definition at line 377 of file lpc_swim_font.c.

void swim_get_xy ( SWIM_WINDOW_T win,
int32_t *  x,
int32_t *  y 
)

Returns the X, Y pixel coordinates for the next text operation.

Parameters:
win: Pointer to window data structure
x: Address of where to return virtual X value
y: Address of where to return virtual X value
Returns:
Nothing
Note:
The logical X and Y positions are computed by subtracting the physical text position values by the physical minimum window limits.

Definition at line 157 of file lpc_swim_font.c.

void swim_put_char ( SWIM_WINDOW_T win,
const CHAR  textchar 
)

Puts a single character in the window.

Parameters:
win: Pointer to window data structure
textchar: Character to print
Returns:
Nothing
Note:
The character is placed at the end of the last text operation or the current text X, Y position.

Definition at line 268 of file lpc_swim_font.c.

void swim_put_ltext ( SWIM_WINDOW_T win,
const CHAR text 
)

Puts a string of text in a window with breaks.

Parameters:
win: Pointer to window data structure
text: Text string to output in window
Returns:
Nothing
Note:
Puts a string of text in a window, but will adjust the position of a word if the word length exceeds the edge of the display.

Definition at line 187 of file lpc_swim_font.c.

void swim_put_newline ( SWIM_WINDOW_T win )

Puts a newline in the window.

Parameters:
win: Pointer to window data structure
Returns:
Nothing

Definition at line 333 of file lpc_swim_font.c.

void swim_put_text ( SWIM_WINDOW_T win,
const CHAR text 
)

Puts a string of text in a window.

Parameters:
win: Pointer to window data structure
text: Text string to output in window
Returns:
Nothing
Note:
Each character will be routed to the swim_put_char function until a string terminator is reached. For newline characters, a newline will occur instead of a character output.

Definition at line 166 of file lpc_swim_font.c.

void swim_put_text_centered ( SWIM_WINDOW_T win,
const CHAR text,
int32_t  x0,
int32_t  x1,
int32_t  y 
)

Put text horizontally centered between x0 and x1 at y position on screen.

Parameters:
win: Pointer to window data structure
text: Text string to output in window
x0: Virtual X left position
x1: Virtual X right position
y: Virtual Y position of start of text
Returns:
Nothing
Note:
Sets the virtual (upper left) text position in the window and render the text string at this position.

Definition at line 103 of file lpc_swim_font.c.

void swim_put_text_centered_win ( SWIM_WINDOW_T win,
const CHAR text,
int32_t  y 
)

Put text horizontally centered at y position on screen.

Parameters:
win: Pointer to window data structure
text: Text string to output in window
x: Virtual X position of start of text
y: Virtual Y position of start of text
Returns:
Nothing
Note:
Sets the virtual (upper left) text position in the window and render the text string at this position.

Definition at line 95 of file lpc_swim_font.c.

void swim_put_text_xy ( SWIM_WINDOW_T win,
const CHAR text,
int32_t  x,
int32_t  y 
)

Put text at x, y (char) position on screen.

Parameters:
win: Pointer to window data structure
text: Text string to output in window
x: Virtual X position of start of text
y: Virtual Y position of start of text
Returns:
Nothing
Note:
Sets the virtual (upper left) text position in the window and render the text string at this position.

Definition at line 120 of file lpc_swim_font.c.

void swim_set_font ( SWIM_WINDOW_T win,
FONT_T font 
)

Sets the active font.

Parameters:
win: Pointer to window data structure
font: Pointer to font data structure to use for font
Returns:
Nothing

Definition at line 354 of file lpc_swim_font.c.

void swim_set_font_transparency ( SWIM_WINDOW_T win,
int32_t  trans 
)

Enables and disables font backgrounds.

Parameters:
win: Pointer to window data structure
trans: 1 for transparent backgrounds, 0 for solid color
Returns:
Nothing
Note:
Enables and disables font backgrounds. When set, the font background will not be drawn in the background color (useful for painting text over pictures).

Definition at line 472 of file lpc_swim_font.c.

void swim_set_title ( SWIM_WINDOW_T win,
const CHAR title,
COLOR_T  ttlbkcolor 
)

Creates a title bar for the window.

Parameters:
win: Pointer to window data structure
title: Text for title bard
ttlbkcolor: Totle bar backgorund color
Returns:
Nothing
Note:
Creates a title bar in the window and adjusts the client area to be outside the title bar area.

Definition at line 408 of file lpc_swim_font.c.

void swim_set_xy ( SWIM_WINDOW_T win,
int32_t  x,
int32_t  y 
)

Sets the X, Y pixel coordinates for the next text operation.

Parameters:
win: Pointer to window data structure
x: Virtual X position of start of text
y: Virtual Y position of start of text
Returns:
Nothing

Definition at line 133 of file lpc_swim_font.c.

void swim_window_scroll ( SWIM_WINDOW_T win,
int32_t  lines 
)

Scrolls the window up one line.

Parameters:
win: Pointer to window data structure
lines: Number of lines to scroll up
Returns:
Nothing

Definition at line 219 of file lpc_swim_font.c.