00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef HK_FONT
00012 #define HK_FONT
00013 #include "hk_class.h"
00014
00015 class hk_font : public hk_class
00016 {
00017 public:
00018 hk_font();
00019 hk_font(const hk_string& fontname,int fontsize);
00020 hk_font(const hk_font&);
00021 void set_font(const hk_string& fontname,int fontsize);
00022 void set_font(const hk_font&);
00023 hk_string fontname(void) const;
00024 int fontsize(void) const;
00025 void set_bold(bool);
00026 bool bold(void) const;
00027 void set_italic(bool);
00028 bool italic(void) const;
00029 bool operator=(const hk_font&);
00030 bool operator==(const hk_font&);
00031 bool operator!=(const hk_font&);
00032 hk_string psfontname(void)const;
00033 static void set_defaultfont(const hk_string& d,int s);
00034 static hk_string defaultfontname(void);
00035 static int defaultfontsize(void);
00036
00037 virtual void savedata(ostream& s );
00038 virtual void loaddata(const hk_string& definition);
00039
00040
00041 protected:
00042
00043
00044 private:
00045 bool is_equal(const hk_font&);
00046 hk_string p_fontname;
00047 int p_fontsize;
00048 bool p_italic;
00049 bool p_bold;
00050 static hk_string p_defaultfont;
00051 static int p_defaultfontsize;
00052
00053
00054
00055 };
00056
00057 ostream& operator<<(ostream&,hk_font&);
00058 ostream& operator<<(ostream&,const hk_font&);
00059
00060 #endif