Font service
Circle provides a simple display font service, which allows to convert ISO-8859-1 (Latin1) character codes into pixel information for displaying characters on dot-matrix displays.
System fonts
#include <circle/font.h>
-
struct TFont
This structure is the basic descriptor for a defined system font. The following fonts are available:
Font
Width
Height
Extra height
Total height
Remarks
Font6x7
6
7
1
8
Font8x8
8
8
2
10
Font8x10
8
10
2
12
Font8x12
8
12
3
15
Font8x14
8
14
3
17
Font8x16
8
16
3
19
Font12x22
12
22
4
26
ASCII only
Widths and heights are given in number of pixels. Extra height is the room reserved for the underline (cursor).
-
DEFAULT_FONT
This macro defines the default system font, which is normally
Font8x16. The default setting can be overwritten with the system optionDEFAULT_FONT.
CCharGenerator
#include <circle/chargenerator.h>
-
class CCharGenerator
This class provides easy access to system fonts.
-
CCharGenerator::CCharGenerator(const TFont &rFont = DEFAULT_FONT, TFontFlags Flags = FontFlagsNone)
Creates an instance of CCharGenerator.
rFontis the font descriptor of the font to be used.Flagsmodifies the font with the following possible options:
-
enum CCharGenerator::TFontFlags
FontFlagsNone
FontFlagsDoubleWidth
FontFlagsDoubleHeight
FontFlagsDoubleBoth
-
static CCharGenerator::TFontFlags CCharGenerator::MakeFlags(boolean bDoubleWidth, boolean bDoubleHeight)
Makes font flags from separate options.
-
unsigned CCharGenerator::GetCharWidth(void) const
Returns the horizontal number of pixels per character.
-
unsigned CCharGenerator::GetCharHeight(void) const
Returns the vertical number of pixels per character including the underline space.
-
unsigned CCharGenerator::GetUnderline(void) const
Returns the vertical pixel start line of the underline space.
-
CCharGenerator::TPixelLine CCharGenerator::GetPixelLine(char chAscii, unsigned nPosY) const
Returns the horizontal pixel information for character code (normally ISO-8859-1)
chAsciifor the pixel linenPosYinside the character (0-based) as the following type:
-
type CCharGenerator::TPixelLine
-
boolean CCharGenerator::GetPixel(unsigned nPosX, TPixelLine Line) const
Returns
TRUE, if the pixel at the horizontal positionnPosX(left is 0) is set inside the pixel lineLine, which has been fetched usingCCharGenerator::GetPixelLine().
-
boolean CCharGenerator::GetPixel(char chAscii, unsigned nPosX, unsigned nPosY) const
Returns
TRUE, if the pixel at the horizontal positionnPosX(left is 0) and vertical positionnPosY(0-based) is set for character code (normally ISO-8859-1)chAscii.