#ifndef _FONT_H_
#define _FONT_H_
//----------------------------------------------------------------------------
///
/// \brief  FOnt for graphical displays
///
///         See implementation files for further information.
///
/// \date   20151226
/// \author Maximilian Seesslen <mes@seesslen.net>
///
//----------------------------------------------------------------------------


//---Includes-----------------------------------------------------------------

#include <stdint.h>

#define FONT_Y_SIZE_8 8
#define FONT_Y_SIZE_16 16

//---Declaration--------------------------------------------------------------


typedef const unsigned short int font_data16_t;
typedef const uint32_t font_data32_t;
typedef const unsigned char font_data8_t;


typedef struct __attribute ( (packed) )
{
   char letter;
   int xSize, ySize;
   void *data;
} TMatrix;


typedef struct __attribute ( (packed) )
{
   int baseXSize, baseYSize;
   int bytesPerLine;
   int letters;
   int spacing;
   const TMatrix *matrix;
} TFont;

class CFont
{
   private:
      const TFont *m_pFont;
   public:
      CFont();
      int textWidth(const char *text);
      void setFont(const TFont &font);
      const TMatrix *findCharacter(const char ch);
      int fontBytesPerLine()
      {
         return ( m_pFont->bytesPerLine );
      }
      int fontSpacing()
      {
         return ( m_pFont->spacing );
      }
      int fontBaseXSize()
      {
         return(m_pFont->baseXSize);
      }
      int fontBaseYSize()
      {
         return(m_pFont->baseYSize);
      }
};

const TFont &getFont5();
const TFont &getFont6();
const TFont &getFont8();
const TFont &getFont32();
const TFont &getFont24();
const TFont &getFont16();
const TFont &getFont11();

//---fin----------------------------------------------------------------------
#endif // ? ! _FONT_H_
