Bare Metal Programming Tool Kit
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | Public Attributes | List of all members
bmptk::graphics::inline_font Class Reference

a font stored as inline constant data (in ROM) More...

#include <graphics.h>

Inheritance diagram for bmptk::graphics::inline_font:
bmptk::graphics::font bmptk::graphics::inline_bw_photo bmptk::graphics::image_pixels bmptk::graphics::image

Public Member Functions

 inline_font (bool fixed, const vector char_size, const int *start, const vector size, const unsigned char *data)
 instantiate an inline font
 
bool has (char c) const
 report whether the font has a photo for char c
 
vector char_size (char c) const
 report the size of the photo for char c
 
bool read (char c, const vector p) const
 read one pixel, return true iff it is foreground
 
- Public Member Functions inherited from bmptk::graphics::font
 font (bool fixed, const vector char_size)
 create a font, specify its fixedness and character size
 
- Public Member Functions inherited from bmptk::graphics::inline_bw_photo
bool bool_read (const vector p) const
 read one pixel, return bool
 
 inline_bw_photo (const vector size, const unsigned char *data)
 create an inline_bw_photo object
 
- Public Member Functions inherited from bmptk::graphics::image_pixels
 image_pixels (vector size)
 constructor, specify the size
 
vector size_get () const
 get the size of the picture
 
bool is_valid (const vector p) const
 report whether p is within the image
 
virtual void draw (frame &frame, const vector position=vector::origin()) const
 
color read (const vector p) const
 read one pixel, address specified by vector
 
- Public Member Functions inherited from bmptk::graphics::image
 image ()
 default constructor
 

Public Attributes

const int * start
 x offset within the photo of all ASCII characters
 
- Public Attributes inherited from bmptk::graphics::font
bool const fixed
 true iff the font is fixed-width (all characters are the same width)
 
bool const proportional
 true iif the font is proportional (width of the characters varies)
 
const vector font_char_size
 the size of one character, x is valid for fixed fonts only
 

Additional Inherited Members

- Protected Attributes inherited from bmptk::graphics::image_pixels
vector size
 the size of the (rectangular) block occupied by the objecy
 

Detailed Description

a font stored as inline constant data (in ROM)

An inline_font is a photo of a line of characters, stored in in-line data (in ROM). As it is a photo, you can draw it in a frame to see how the characters look.

The common way to use a font is to use it to construct a text object, which can subsequently be drawn.

The inline.py tool can be used to convert a .jpg or .bmp file into the .h and .cpp file for an inline_font. This is likely to be the only way you will instantiate this class.

Definition at line 1779 of file graphics.h.

Constructor & Destructor Documentation

bmptk::graphics::inline_font::inline_font ( bool  fixed,
const vector  char_size,
const int *  start,
const vector  size,
const unsigned char *  data 
)
inline

instantiate an inline font

Parameters
fixedtrue iif the font has the same size for each character
char_sizethe size of a character, x is valid for fixed fonts only
startthe x offset in the photo of each char, -1 for missing chars
sizethe size of the photo
datathe photo pixels, see inline_bw_photo

Definition at line 1786 of file graphics.h.


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