drivers/gfx/gfx_text.c File Reference

Font and text drawing routines. More...

#include <stddef.h>
#include <assert.h>
#include <gfx/gfx.h>

Go to the source code of this file.

Functions

static void gfx_draw_char_hugemem (char ch, gfx_coord_t x, gfx_coord_t y, struct font *font, gfx_color_t color, gfx_color_t background_color)
 Helper function that draws a character from a font in hugemem to the display.
static void gfx_draw_char_progmem (char ch, gfx_coord_t x, gfx_coord_t y, struct font *font, gfx_color_t color, gfx_color_t background_color)
 Helper function that draws a character from a font in progmem to the display.
void gfx_draw_char (char c, gfx_coord_t x, gfx_coord_t y, struct font *font, gfx_color_t color, gfx_color_t background_color)
 Draws a character to the display.
void gfx_draw_string (char *str, gfx_coord_t x, gfx_coord_t y, struct font *font, gfx_color_t color, gfx_color_t background_color)
 Draws a string to the display.
void gfx_draw_progmem_string (const char __progmem_arg *str, gfx_coord_t x, gfx_coord_t y, struct font *font, gfx_color_t color, gfx_color_t background_color)
void gfx_get_string_bounding_box (char const *str, struct font *font, gfx_coord_t *width, gfx_coord_t *height)
 Computes the bounding box of a string.
void gfx_get_progmem_string_bounding_box (const char __progmem_arg *str, struct font *font, gfx_coord_t *width, gfx_coord_t *height)
 Computes the bounding box of a string stored in progmem.

Detailed Description

Font and text drawing routines.

Copyright (C) 2010 Atmel Corporation. All rights reserved.

Definition in file gfx_text.c.


Function Documentation

static void gfx_draw_char_hugemem ( char  ch,
gfx_coord_t  x,
gfx_coord_t  y,
struct font font,
gfx_color_t  color,
gfx_color_t  background_color 
) [static]

Helper function that draws a character from a font in hugemem to the display.

If background_color is set to GFX_COLOR_TRANSPARENT, no background is drawn.

Parameters:
ch Character to be drawn
x X coordinate on screen.
y Y coordinate on screen.
font Font to draw character in
color Foreground color of character
background_color Background color of character

Definition at line 67 of file gfx_text.c.

References font::first_char, gfx_draw_filled_rect, gfx_draw_pixel(), font::height, font::hugemem, hugemem_read_block(), font::scale, and font::width.

Referenced by gfx_draw_char().

static void gfx_draw_char_progmem ( char  ch,
gfx_coord_t  x,
gfx_coord_t  y,
struct font font,
gfx_color_t  color,
gfx_color_t  background_color 
) [static]

Helper function that draws a character from a font in progmem to the display.

If background_color is set to GFX_COLOR_TRANSPARENT, no background is drawn.

Parameters:
ch Character to be drawn
x X coordinate on screen.
y Y coordinate on screen.
font Font to draw character in
color Foreground color of character
background_color Background color of character

Definition at line 149 of file gfx_text.c.

References __progmem_arg, font::first_char, gfx_draw_filled_rect, gfx_draw_pixel(), font::height, progmem_read8(), font::scale, and font::width.

Referenced by gfx_draw_char().

Generated on Thu Apr 29 15:18:22 2010 for display-training by  doxygen 1.6.3