Display Simple Graphics library  v0.5
Library containing shape, text, and bitmap drawing functions called by various display drivers
Functions
setText.c File Reference
#include "simplegfx.h"

Functions

void setCursor (screen_t *dev, int x, int y, char size)
 Sets the cursor position based on the size parameter. More...
 
void setTextSize (screen_t *dev, char s)
 Sets the size of the font to be used. Range is from 1 to 3. Size (1) is 5x7 (6x8 spacing) pixels, size (2) is 11x15 (12x16 spacing) pixels and size (3) is 15x23 (16x24 spacing) pixels. More...
 
void setTextColor (screen_t *dev, int c)
 Sets the color of the font and the color of the background (highlighting) to be used. Setting the text color and text background to the same color will make the background color transparent. More...
 
void setBgColor (screen_t *dev, int c)
 Sets the color of the font and the color of the background (highlighting) to be used. Setting the text color and text background to the same color will make the background color transparent. More...
 
void setTextWrap (screen_t *dev, char w)
 Toggles automatic wrapping of text printed to the screen. More...
 

Function Documentation

◆ setBgColor()

void setBgColor ( screen_t dev,
int  color 
)

Sets the color of the font and the color of the background (highlighting) to be used. Setting the text color and text background to the same color will make the background color transparent.

Parameters
devPointer to the display's device structure returned by the initialization function.
colorColor of the font, in the format native to the display.

◆ setCursor()

void setCursor ( screen_t dev,
int  x,
int  y,
char  size 
)

Sets the cursor position based on the size parameter.

Parameters
devPointer to the display's device structure returned by the initialization function.
xHorizontal position of the cursor, counted from the left side of the screen.
yVertical position of the cursor, counted down from the top of the screen.
sizeThe size of the cursor. Correlated to font size: (0) moves the cursor in 1 pixel increments, (1) moves the cursor in font size 1 character increments, (2) moves the cursor in font size 2 increments and (3) moves the cursor in font size 3 increments

◆ setTextColor()

void setTextColor ( screen_t dev,
int  color 
)

Sets the color of the font and the color of the background (highlighting) to be used. Setting the text color and text background to the same color will make the background color transparent.

Parameters
devPointer to the display's device structure returned by the initialization function.
colorColor of the font, in the format native to the display.

◆ setTextSize()

void setTextSize ( screen_t dev,
char  s 
)

Sets the size of the font to be used. Range is from 1 to 3. Size (1) is 5x7 (6x8 spacing) pixels, size (2) is 11x15 (12x16 spacing) pixels and size (3) is 15x23 (16x24 spacing) pixels.

Parameters
devPointer to the display's device structure returned by the initialization function.
sSize of text to draw. 1 = small (5x7) font, 2 = medium (11x15) font, 3 = large (17x23) font.

◆ setTextWrap()

void setTextWrap ( screen_t dev,
char  w 
)

Toggles automatic wrapping of text printed to the screen.

Parameters
devPointer to the display's device structure returned by the initialization function.
wWrapping (0) off -OR- (1) on.