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.
Fork of SimpleGUI by
Diff: Font/FastFont/FastFont.h
- Revision:
- 8:a460cabc85ac
- Parent:
- 7:303850a4b30c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Font/FastFont/FastFont.h Mon Apr 11 16:54:02 2016 +0000
@@ -0,0 +1,52 @@
+#ifndef SIMPLEGUI_FAST_FONT_H
+#define SIMPLEGUI_FAST_FONT_H
+
+#include "mbed.h" // types
+#include "Font.h"
+
+#define FAST_FONT_HEIGHT 0
+#define FAST_FONT_DATA_BYTES_PER_GLYPH 1
+#define FAST_FONT_FIRST_ASCII 2
+#define FAST_FONT_LAST_ASCII 3
+#define FAST_FONT_PROPORTIONAL 4
+#define FAST_FONT_DATA 5
+
+class FastFont : public Font
+{
+
+public:
+
+ FastFont(uint8_t* fastFont);
+
+ virtual uint8_t firstAscii();
+ virtual uint8_t lastAscii();
+ /**
+ * The unzoomed width of the character
+ **/
+ virtual uint8_t widthOf(char c);
+ virtual uint8_t zoomedWidthOf(char c);
+ /**
+ * The unzoomed height of a character
+ **/
+ virtual uint8_t height();
+ virtual uint8_t zoomedHeight();
+ virtual bool isProportional();
+
+ /*********************************
+ * Methods specific to this class
+ *********************************/
+ uint8_t totalBytesPerGlyph();
+ uint8_t dataBytesPerGlyph();
+ uint8_t bytesPerRow();
+ uint8_t* glyph(char c);
+
+
+private:
+
+ uint8_t* _font;
+ uint8_t _totalBytesPerGlyph;
+ uint8_t _bytesPerRow;
+};
+
+
+#endif
\ No newline at end of file
