el h / SimpleGUI

Fork of SimpleGUI by Duncan McIntyre

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers UGFont.h Source File

UGFont.h

00001 #ifndef SIMPLEGUI_UNIGRAPHIC_FONT_H
00002 #define SIMPLEGUI_UNIGRAPHIC_FONT_H
00003 
00004 #include "Font.h"
00005 
00006 // Offset to the first glyph data
00007 #define UNIGRAPHIC_FONT_DATA_OFFSET 4
00008 
00009 /**
00010 * A Font implementation based on the bitmap format used by the Unigraphic library
00011 **/
00012 class UGFont : public Font
00013 {
00014 
00015 public:
00016 
00017     UGFont(uint8_t* font, const uint8_t firstAsciiCode=32, const uint8_t lastAsciiCode=127, const bool proportional = true);
00018 
00019     virtual uint8_t firstAscii();
00020     virtual uint8_t lastAscii();
00021     virtual uint8_t widthOf(char c);
00022     virtual uint8_t zoomedWidthOf(char c);
00023     virtual uint8_t height();
00024     virtual uint8_t zoomedHeight();
00025     virtual bool isProportional();
00026     
00027     /**
00028     * Return the data part of the glyph - excluding the widht byte
00029     **/
00030     uint8_t* getGlyphData(char c);
00031     uint8_t bytesPerCol();
00032     uint8_t bytesPerGlyph();
00033     
00034 private:
00035 
00036     uint8_t* _font;
00037     uint8_t _width, _height, _bytesPerCol, _bytesPerGlyph;
00038     uint8_t _firstAscii, _lastAscii, _proportional;
00039 
00040 };
00041 #endif