Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
fonts/EAFont.h@7:6cf21b018420, 2010-11-01 (annotated)
- Committer:
- richardparker
- Date:
- Mon Nov 01 13:07:40 2010 +0000
- Revision:
- 7:6cf21b018420
Embedded Artists LCD panel:- Version 0.7
Who changed what in which revision?
| User | Revision | Line number | New contents of line | 
|---|---|---|---|
| richardparker | 7:6cf21b018420 | 1 | // Copyright 2010 Richard Parker | 
| richardparker | 7:6cf21b018420 | 2 | |
| richardparker | 7:6cf21b018420 | 3 | #ifndef MBED_EAFONT_H | 
| richardparker | 7:6cf21b018420 | 4 | #define MBED_EAFONT_H | 
| richardparker | 7:6cf21b018420 | 5 | |
| richardparker | 7:6cf21b018420 | 6 | #include "mbed.h" | 
| richardparker | 7:6cf21b018420 | 7 | |
| richardparker | 7:6cf21b018420 | 8 | #include <string> | 
| richardparker | 7:6cf21b018420 | 9 | |
| richardparker | 7:6cf21b018420 | 10 | class EALCD; | 
| richardparker | 7:6cf21b018420 | 11 | class EAFontCacheEntry; | 
| richardparker | 7:6cf21b018420 | 12 | class EAImage; | 
| richardparker | 7:6cf21b018420 | 13 | |
| richardparker | 7:6cf21b018420 | 14 | /** | 
| richardparker | 7:6cf21b018420 | 15 | * Class to handle the font for the EA LCD. | 
| richardparker | 7:6cf21b018420 | 16 | * @author Richard Parker | 
| richardparker | 7:6cf21b018420 | 17 | */ | 
| richardparker | 7:6cf21b018420 | 18 | class EAFont | 
| richardparker | 7:6cf21b018420 | 19 | { | 
| richardparker | 7:6cf21b018420 | 20 | public: | 
| richardparker | 7:6cf21b018420 | 21 | friend EALCD; | 
| richardparker | 7:6cf21b018420 | 22 | |
| richardparker | 7:6cf21b018420 | 23 | struct EACharacter | 
| richardparker | 7:6cf21b018420 | 24 | { | 
| richardparker | 7:6cf21b018420 | 25 | unsigned char id; | 
| richardparker | 7:6cf21b018420 | 26 | unsigned char x; | 
| richardparker | 7:6cf21b018420 | 27 | unsigned char y; | 
| richardparker | 7:6cf21b018420 | 28 | unsigned char width; | 
| richardparker | 7:6cf21b018420 | 29 | unsigned char height; | 
| richardparker | 7:6cf21b018420 | 30 | unsigned char xOffset; | 
| richardparker | 7:6cf21b018420 | 31 | unsigned char yOffset; | 
| richardparker | 7:6cf21b018420 | 32 | unsigned char xAdvance; | 
| richardparker | 7:6cf21b018420 | 33 | }; | 
| richardparker | 7:6cf21b018420 | 34 | |
| richardparker | 7:6cf21b018420 | 35 | EAFont(); | 
| richardparker | 7:6cf21b018420 | 36 | ~EAFont(); | 
| richardparker | 7:6cf21b018420 | 37 | |
| richardparker | 7:6cf21b018420 | 38 | EAFont(const EAFont& font); | 
| richardparker | 7:6cf21b018420 | 39 | EAFont& operator=(const EAFont& font); | 
| richardparker | 7:6cf21b018420 | 40 | |
| richardparker | 7:6cf21b018420 | 41 | bool isValid() const; | 
| richardparker | 7:6cf21b018420 | 42 | bool load(const std::string& path); | 
| richardparker | 7:6cf21b018420 | 43 | |
| richardparker | 7:6cf21b018420 | 44 | //private: | 
| richardparker | 7:6cf21b018420 | 45 | EAFontCacheEntry* _entry; | 
| richardparker | 7:6cf21b018420 | 46 | |
| richardparker | 7:6cf21b018420 | 47 | bool _getCharacter(char c, EACharacter& detail); | 
| richardparker | 7:6cf21b018420 | 48 | bool _data(EAImage& image); | 
| richardparker | 7:6cf21b018420 | 49 | |
| richardparker | 7:6cf21b018420 | 50 | }; | 
| richardparker | 7:6cf21b018420 | 51 | |
| richardparker | 7:6cf21b018420 | 52 | #endif |