Newer
Older
ubixos / src / sys / graphics / objfont.h
@flameshadow flameshadow on 23 Jun 2002 1 KB Objfont stuff
#ifndef OBJFONT_H
#define OBJFONT_H

#include "objgfx30.h"

#define LeftText   0
#define CenterText 1
#define RightText  2
#define BottomText 0
#define TopText    2

enum TFontType {BLF, BMF, DPF};

typedef struct {
          char  ID[4];
          UInt8 BPP;
          UInt8 paddington[10];
        } TFontHeader;

typedef struct {
          char  ID[3];
          UInt8 Version;
          UInt8 Width, Height;
          UInt8 NumOfChars;
          UInt8 StartingChar;
          UInt8 ColourType;
          UInt8 paddington[7];
        } TDPFHeader;

class TFont {
       protected:
        UInt32 FontDataIdx[256];
        UInt16 CharWidthTable[256];
        UInt16 CharHeightTable[256];
        TGfx0* Buf;
        UInt32 FontDataSize;
        void * FontData;
       public:
        TFont(TGfx0 *);
        virtual void PutText(Int32, Int32,const char *)=0;
        void CenterTextX(Int32 Y, const char *);
        void JustifyText(UInt8, UInt8, const char *);
        UInt32 TextHeight(const char *);
        UInt32 TextWidth(const char *);
        virtual ~TFont(void); 
};


#endif