mmsfbfont.h File Reference

#include "mmsgui/fb/mmsfbbase.h"
#include "mmsgui/fb/mmsfbbuffer.h"

Include dependency graph for mmsfbfont.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


Classes

struct  MMSFBFont_Glyph
 descibes a loaded glyph More...
class  MMSFBFont
 Font rendering class. More...

Defines

#define MMSFBFONT_GET_UNICODE_CHAR(text, len)

Define Documentation

#define MMSFBFONT_GET_UNICODE_CHAR ( text,
len   ) 

Value:

for (int cnt = 0; cnt < len; cnt++) { \
        unsigned char c = text[cnt]; \
        unsigned int character; \
        if(c >= 0xf0) /* 11110000 -> 4 bytes */ { \
            if(len < (cnt + 3)) { DEBUGMSG("MMSFBFONT", "invalid unicode string"); break; } \
            character = (unsigned int)((c & 0x07 /* 00000111 */) << 18); \
            character |= ((text[++cnt] & 0x3f /* 00111111 */) << 12); \
            character |= ((text[++cnt] & 0x3f) << 6); \
            character |= (text[++cnt] & 0x3f); \
        } else if(c >= 0xe0)  /* 11100000 -> 3 bytes */ { \
            if(len < (cnt + 2)) { DEBUGMSG("MMSFBFONT", "invalid unicode string"); break; } \
            character = (unsigned int)((c & 0x0f /* 00001111 */) << 12); \
            character |= ((text[++cnt] & 0x3f) << 6); \
            character |= (text[++cnt] & 0x3f); \
        } else if(c >= 0xc0)  /* 11000000 -> 2 bytes */ { \
            if(len < (cnt + 1)) { DEBUGMSG("MMSFBFONT", "invalid unicode string"); break; } \
            character = (unsigned int)(((c & 0x1f /* 00011111 */) << 6) | (text[++cnt] & 0x3f)); \
        } else  /* 1 byte */ { \
            character = (unsigned int)c; \
        }

Definition at line 159 of file mmsfbfont.h.