From f314041b6b37bb9274d9fc79946858341befa0f2 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Wed, 8 Apr 2015 08:40:05 -0600 Subject: Added image goo + font support. --- src/font.h | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 src/font.h (limited to 'src/font.h') diff --git a/src/font.h b/src/font.h new file mode 100644 index 0000000..802de9d --- /dev/null +++ b/src/font.h @@ -0,0 +1,65 @@ +#ifndef FONT_H +#define FONT_H + +#include + +class Font +{ +public: + class Point + { + public: + int32_t x, y; + }; + + class Glyph + { + public: + Glyph() : + pData( NULL ) + { } + ~Glyph() + { delete[] pData; } + Point pBox; + Point pOff; + Point pDevOff; + + int iRowBytes; + uint8_t *pData; + }; + +public: + Font( const char *sSrcFile ); + virtual ~Font(); + + Glyph *get( char c ) { return pTable[(int32_t)c]; } + +private: + Point pDefBox; + Point pDefOff; + int32_t iTableTop; + Glyph **pTable; + +private: // Parser + class Parser + { + public: + Parser( const char *sSrcFile, Font &rFont ); + ~Parser(); + + void parse(); + void getLine(); + void header(); + void properties(); + void characters(); + void character(); + + private: + Font &rFont; + void *rawfh; + char *sLine; + bool bDone; + }; +}; + +#endif -- cgit v1.2.3