00001
00002 #ifndef __XFont_h
00003 #define __XFont_h
00004
00005 #define Status int
00006 #include "Xft.h"
00007 #undef Status
00008 #include "LgiOsDefs.h"
00009
00010 class XFont
00011 {
00012 class XFontPrivate *Data;
00013 friend class XFontMetrics;
00014
00015 void GetScale(double &x, double &y);
00016
00017 public:
00018 XFont();
00019 ~XFont();
00020
00021 XftFont *GetTtf();
00022 XFont &operator =(XFont &f);
00023
00024 void SetPainter(OsPainter p);
00025 void SetFamily(char *face);
00026 void SetPointSize(int height);
00027 void SetBold(bool bold);
00028 void SetItalic(bool italic);
00029 void SetUnderline(bool underline);
00030
00031 int GetAscent();
00032 int GetDescent();
00033 char *GetFamily();
00034 int GetPointSize();
00035 bool GetBold();
00036 bool GetItalic();
00037 bool GetUnderline();
00038 };
00039
00040 class XFontMetrics
00041 {
00042 class XFontMetricsPrivate *Data;
00043
00044 public:
00045 XFontMetrics(XFont *f);
00046 ~XFontMetrics();
00047
00048 int width(uchar i);
00049 int width(char *str, int len = -1);
00050 int width(char16 *str, int len = -1);
00051 int height();
00052 int ascent();
00053 int descent();
00054
00055 uchar *GetCoverage(uchar *Map, int Max);
00056 };
00057
00058 extern bool _GetSystemFont(char *FontType, char *Font, int FontBufSize, int &PointSize);
00059
00060 #endif