00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef ROOT_TGX11TTF
00014 #define ROOT_TGX11TTF
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef ROOT_TGX11
00030 #include "TGX11.h"
00031 #endif
00032
00033 #ifndef ROOT_TTF
00034 #include "TTF.h"
00035 #endif
00036
00037 #ifndef ROOT_RConfigure
00038 #include "RConfigure.h"
00039 #endif
00040
00041 #ifdef R__HAS_XFT
00042 class TXftFontHash;
00043 #endif
00044
00045
00046 class TGX11TTF : public TGX11 {
00047
00048 private:
00049 enum EAlign { kNone, kTLeft, kTCenter, kTRight, kMLeft, kMCenter, kMRight,
00050 kBLeft, kBCenter, kBRight };
00051
00052 FT_Vector fAlign;
00053 #ifdef R__HAS_XFT
00054 TXftFontHash *fXftFontHash;
00055 #endif
00056
00057 void Align(void);
00058 void DrawImage(FT_Bitmap *source, ULong_t fore, ULong_t back, XImage *xim,
00059 Int_t bx, Int_t by);
00060 Bool_t IsVisible(Int_t x, Int_t y, UInt_t w, UInt_t h);
00061 XImage *GetBackground(Int_t x, Int_t y, UInt_t w, UInt_t h);
00062 void RenderString(Int_t x, Int_t y, ETextMode mode);
00063
00064 public:
00065 TGX11TTF(const TGX11 &org);
00066 virtual ~TGX11TTF() { }
00067
00068 Bool_t Init(void *display);
00069 void DrawText(Int_t x, Int_t y, Float_t angle, Float_t mgn,
00070 const char *text, ETextMode mode);
00071 void SetTextFont(Font_t fontnumber);
00072 Int_t SetTextFont(char *fontname, ETextSetMode mode);
00073 void SetTextSize(Float_t textsize);
00074
00075 #ifdef R__HAS_XFT
00076
00077
00078 FontStruct_t LoadQueryFont(const char *font_name);
00079 void DeleteFont(FontStruct_t fs);
00080 void DrawString(Drawable_t id, GContext_t gc, Int_t x, Int_t y, const char *s, Int_t len);
00081 Int_t TextWidth(FontStruct_t font, const char *s, Int_t len);
00082 void GetFontProperties(FontStruct_t font, Int_t &max_ascent, Int_t &max_descent);
00083 #endif
00084
00085 static void Activate();
00086
00087 ClassDef(TGX11TTF,0)
00088 };
00089
00090 #endif