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: Core/UGFont.h
- Revision:
- 7:303850a4b30c
- Parent:
- 3:cb004f59b715
diff -r b1ddfe0eb88e -r 303850a4b30c Core/UGFont.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Core/UGFont.h Sun Apr 10 16:48:44 2016 +0000
@@ -0,0 +1,41 @@
+#ifndef SIMPLEGUI_UNIGRAPHIC_FONT_H
+#define SIMPLEGUI_UNIGRAPHIC_FONT_H
+
+#include "Font.h"
+
+// Offset to the first glyph data
+#define UNIGRAPHIC_FONT_DATA_OFFSET 4
+
+/**
+* A Font implementation based on the bitmap format used by the Unigraphic library
+**/
+class UGFont : public Font
+{
+
+public:
+
+ UGFont(uint8_t* font, const uint8_t firstAsciiCode=32, const uint8_t lastAsciiCode=127, const bool proportional = true);
+
+ virtual uint8_t firstAscii();
+ virtual uint8_t lastAscii();
+ virtual uint8_t widthOf(char c);
+ virtual uint8_t zoomedWidthOf(char c);
+ virtual uint8_t height();
+ virtual uint8_t zoomedHeight();
+ virtual bool isProportional();
+
+ /**
+ * Return the data part of the glyph - excluding the widht byte
+ **/
+ uint8_t* getGlyphData(char c);
+ uint8_t bytesPerCol();
+ uint8_t bytesPerGlyph();
+
+private:
+
+ uint8_t* _font;
+ uint8_t _width, _height, _bytesPerCol, _bytesPerGlyph;
+ uint8_t _firstAscii, _lastAscii, _proportional;
+
+};
+#endif
\ No newline at end of file
