Atmel Software Framework

gfx_text.h File Reference

Graphic library API header file.

Copyright (c) 2012 Atmel Corporation. All rights reserved.

#include <stdint.h>
#include "compiler.h"

Data Structures

struct  font
 Storage structure for font meta data. More...
 

Enumerations

enum  font_data_type { FONT_LOC_PROGMEM }
 Valid storage locations for font data. More...
 
enum  gfx_text_alignment {
  TEXT_ALIGN_LEFT,
  TEXT_ALIGN_RIGHT,
  TEXT_ALIGN_CENTER
}
 Text alignment options for text lines within a paragraph. More...
 
enum  gfx_text_position {
  TEXT_POS_TOP = (1 << 0),
  TEXT_POS_CENTER_Y = (1 << 1),
  TEXT_POS_BOTTOM = (1 << 2),
  TEXT_POS_LEFT = (1 << 3),
  TEXT_POS_CENTER_X = (1 << 4),
  TEXT_POS_RIGHT = (1 << 5),
  TEXT_POS_TOP_LEFT = TEXT_POS_TOP | TEXT_POS_LEFT,
  TEXT_POS_TOP_CENTER = TEXT_POS_TOP | TEXT_POS_CENTER_X,
  TEXT_POS_TOP_RIGHT = TEXT_POS_TOP | TEXT_POS_RIGHT,
  TEXT_POS_CENTER_LEFT = TEXT_POS_CENTER_Y | TEXT_POS_LEFT,
  TEXT_POS_CENTER = TEXT_POS_CENTER_Y | TEXT_POS_CENTER_X,
  TEXT_POS_CENTER_RIGHT = TEXT_POS_CENTER_Y | TEXT_POS_RIGHT,
  TEXT_POS_BOTTOM_LEFT = TEXT_POS_BOTTOM | TEXT_POS_LEFT,
  TEXT_POS_BOTTOM_CENTER = TEXT_POS_BOTTOM | TEXT_POS_CENTER_X,
  TEXT_POS_BOTTOM_RIGHT = TEXT_POS_BOTTOM | TEXT_POS_RIGHT
}
 Text paraphraph positioning options. More...
 

Functions

Strings and characters located in RAM
void gfx_draw_char (const char c, const gfx_coord_t x, const gfx_coord_t y, const struct font *font, const gfx_color_t bg_color, const gfx_color_t text_color)
 Draws a character to the display. More...
 
void gfx_draw_string (const char *str, const gfx_coord_t x, const gfx_coord_t y, const struct font *font, const gfx_color_t bg_color, const gfx_color_t text_color)
 Draws a string to the display. More...
 
void gfx_draw_string_aligned (const char *str, gfx_coord_t x, gfx_coord_t y, const struct font *font, const gfx_color_t bg_color, const gfx_color_t text_color, enum gfx_text_position text_pos, enum gfx_text_alignment text_align)
 Draws an aligned string to the display. More...
 
void gfx_get_string_bounding_box (char const *str, const struct font *font, gfx_coord_t *width, gfx_coord_t *height)
 Computes the bounding box of a string. More...
 
Strings located in flash
void gfx_draw_progmem_string (char PROGMEM_PTR_T str, gfx_coord_t x, gfx_coord_t y, const struct font *font, const gfx_color_t bg_color, const gfx_color_t text_color)
 Draws a string located in program memory to the display. More...
 
void gfx_draw_progmem_string_aligned (char PROGMEM_PTR_T str, gfx_coord_t x, gfx_coord_t y, const struct font *font, const gfx_color_t bg_color, const gfx_color_t text_color, enum gfx_text_position text_pos, enum gfx_text_alignment text_align)
 Draws an aligned string located in program memory to the display. More...
 
void gfx_get_progmem_string_bounding_box (char PROGMEM_PTR_T str, const struct font *font, gfx_coord_t *width, gfx_coord_t *height)
 Computes the bounding box of a string located in program memory. More...