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::font Class Referenceabstract

the photo's (bitmaps) of characters More...

#include <graphics.h>

Inheritance diagram for bmptk::graphics::font:
bmptk::graphics::inline_font

Public Member Functions

 font (bool fixed, const vector char_size)
 create a font, specify its fixedness and character size
 
virtual bool has (char c) const =0
 reports whether the font has the char
 
virtual bool read (char c, const vector p) const =0
 read pixel p of characters c
 
virtual vector char_size (char c) const =0
 reports te size of character c
 

Public Attributes

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
 

Detailed Description

the photo's (bitmaps) of characters

A font is an abstract class that holds the pixel-level black and white representation of a set of characters, according to some font rules. You can read the pixels for a specific character.

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

A concrete font class must provide the has() and read() functions.

Definition at line 1657 of file graphics.h.

Member Function Documentation

virtual vector bmptk::graphics::font::char_size ( char  c) const
pure virtual

reports te size of character c

This function must report (0,0) for a character that is not in the set (for which has is false).

Implemented in bmptk::graphics::inline_font.

virtual bool bmptk::graphics::font::has ( char  c) const
pure virtual

reports whether the font has the char

To reduce ROM size, a font can contain a subset of the ASCII characters.

Implemented in bmptk::graphics::inline_font.


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