- Main Page
- Classes
- Files

- File List

# C:/Documents and Settings/Administrator/Desktop/woopsi-src-0.39/Woopsi/woopsi/fixedwidthfontbase.h

    00001 #ifndef _FIXED_WIDTH_FONT_BASE_H_
    00002 #define _FIXED_WIDTH_FONT_BASE_H_
    00003
    00004 #include <nds.h>
    00005 #include <string.h>
    00006 #include "fontbase.h"
    00007
    00008 namespace WoopsiUI {
    00009
    00014         class FixedWidthFontBase : public FontBase {
    00015
    00016         public:
    00017
    00027                 FixedWidthFontBase(const u16 bitmapWidth, const u16 bitmapHeight, const u8 width, const u8 height, const u16 transparentColour = 0);
    00028
    00032                 virtual inline ~FixedWidthFontBase() { };
    00033
    00038                 inline const u16 getBitmapWidth() const { return _bitmapWidth; };
    00039
    00044                 inline const u16 getBitmapHeight() const { return _bitmapHeight; };
    00045
    00052                 virtual const u16 getPixel(const u32 position) const = 0;
    00053
    00060                 inline const u16 getPixel(const u16 x, const u16 y) const { return getPixel(x + (y * _width)); };
    00061
    00066                 inline const u8 getWidth() const { return _width; };
    00067
    00073                 inline u16 getStringWidth(const char* text) const { return strlen(text) * getWidth(); };
    00074
    00083                 inline u16 getStringWidth(const char* text, u16 length) const { return length * getWidth(); };
    00084
    00090                 inline u16 getCharWidth(char letter) const { return getWidth(); };
    00091
    00098                 virtual inline const bool isCharBlank(const char letter) const { return !(_glyphMap[letter >> 3] & (1 << (letter % 8))); };
    00099
    00100         protected:
    00107                 virtual void createGlyphMap();
    00108
    00116                 virtual const bool scanGlyph(const u16 x, const u16 y) const = 0;
    00117
    00118         protected:
    00119
    00124                 void initGlyphMap();
    00125
    00126                 u8 _glyphMap[GLYPH_MAP_SIZE];
    00128         private:
    00129                 u8 _width;
    00130                 u16 _bitmapWidth;
    00131                 u16 _bitmapHeight;
    00132         };
    00133 }
    00134
    00135 #endif

All Classes Functions Variables Enumerations Enumerator