COSA
An Object-Oriented Platform for Arduino Programming
Font Class Reference

#include <Font.hh>

Inheritance diagram for Font:
Inheritance graph
Collaboration diagram for Font:
Collaboration graph

Classes

class  Glyph
 

Public Member Functions

 Font (uint8_t width, uint8_t height, uint8_t first, uint8_t last, const uint8_t *bitmap, uint8_t compression_type=0, uint8_t spacing=1, uint8_t line_spacing=1)
 
bool available (char c)
 
virtual void draw (Canvas *canvas, char c, uint16_t x, uint16_t y, uint8_t scale)
 

Public Attributes

const uint8_t WIDTH
 
const uint8_t HEIGHT
 
const uint8_t SPACING
 
uint8_t LINE_SPACING
 
const uint8_t FIRST
 
const uint8_t LAST
 

Protected Attributes

const uint8_t * m_bitmap
 
const uint8_t m_compression_type
 

Detailed Description

Definition at line 30 of file Font.hh.

Constructor & Destructor Documentation

Font::Font ( uint8_t  width,
uint8_t  height,
uint8_t  first,
uint8_t  last,
const uint8_t *  bitmap,
uint8_t  compression_type = 0,
uint8_t  spacing = 1,
uint8_t  line_spacing = 1 
)
inline

Construct font descriptor.

Parameters
[in]widthcharacter width.
[in]heightcharacter height.
[in]firstcharacter available.
[in]lastcharacter available.
[in]bitmapfont storage.
[in]compression_type.
[in]spacingrecommended character spacing.
[in]line_spacingrecommended line spacing.

Definition at line 57 of file Font.hh.

Member Function Documentation

bool Font::available ( char  c)
inline

Determine if character is available in font.

Parameters
[in]ccharacter.
Returns
true if available.

Definition at line 79 of file Font.hh.

void Font::draw ( Canvas canvas,
char  c,
uint16_t  x,
uint16_t  y,
uint8_t  scale 
)
virtual

Draw character on given canvas.

Parameters
[in]canvas.
[in]ccharacter.
[in]xposition.
[in]yposition.
[in]scale.

Definition at line 24 of file Font.cpp.

Member Data Documentation

const uint8_t Font::FIRST

Font range.

Definition at line 43 of file Font.hh.

const uint8_t Font::HEIGHT

Definition at line 36 of file Font.hh.

const uint8_t Font::LAST

Definition at line 44 of file Font.hh.

uint8_t Font::LINE_SPACING

Definition at line 38 of file Font.hh.

const uint8_t* Font::m_bitmap
protected

Font bitmap.

Definition at line 143 of file Font.hh.

const uint8_t Font::m_compression_type
protected

Compression type.

Definition at line 146 of file Font.hh.

const uint8_t Font::SPACING

Definition at line 37 of file Font.hh.

const uint8_t Font::WIDTH

Font size; width/height and character/line spacing.

Definition at line 35 of file Font.hh.


The documentation for this class was generated from the following files: