FLTK 1.3.x
|
00001 // 00002 // "$Id: Fl_Font.H 7913 2010-11-29 18:18:27Z greg.ercolano $" 00003 // 00004 // Font definitions for the Fast Light Tool Kit (FLTK). 00005 // 00006 // Copyright 1998-2010 by Bill Spitzak and others. 00007 // 00008 // This library is free software; you can redistribute it and/or 00009 // modify it under the terms of the GNU Library General Public 00010 // License as published by the Free Software Foundation; either 00011 // version 2 of the License, or (at your option) any later version. 00012 // 00013 // This library is distributed in the hope that it will be useful, 00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 // Library General Public License for more details. 00017 // 00018 // You should have received a copy of the GNU Library General Public 00019 // License along with this library; if not, write to the Free Software 00020 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 00021 // USA. 00022 // 00023 // Please report all bugs and problems on the following page: 00024 // 00025 // http://www.fltk.org/str.php 00026 // 00027 00028 // Two internal fltk data structures: 00029 // 00030 // Fl_Fontdesc: an entry into the fl_font() table. There is one of these 00031 // for each fltk font number. 00032 // 00033 #ifndef FL_FONT_ 00034 #define FL_FONT_ 00035 00036 #include <config.h> 00037 00038 # if USE_XFT 00039 typedef struct _XftFont XftFont; 00040 # elif !defined(WIN32) && !defined(__APPLE__) 00041 # include <FL/Xutf8.h> 00042 # endif // USE_XFT 00043 00050 class Fl_Font_Descriptor { 00051 public: 00053 Fl_Font_Descriptor *next; 00054 #ifndef FL_DOXYGEN // don't bother with platorm dependant details in the doc. 00055 # ifdef WIN32 00056 HFONT fid; 00057 int *width[64]; 00058 TEXTMETRIC metr; 00059 int angle; 00060 FL_EXPORT Fl_Font_Descriptor(const char* fontname, Fl_Fontsize size); 00061 # elif defined(__APPLE_QUARTZ__) 00062 FL_EXPORT Fl_Font_Descriptor(const char* fontname, Fl_Fontsize size); 00063 ATSUTextLayout layout; 00064 # if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5 00065 CTFontRef fontref; 00066 # endif 00067 ATSUStyle style; 00068 short ascent, descent, q_width; 00069 // short width[256]; 00070 // bool knowWidths; 00071 char *q_name; 00072 int size; 00073 # elif USE_XFT 00074 XftFont* font; 00075 const char* encoding; 00076 Fl_Fontsize size; 00077 int angle; 00078 FL_EXPORT Fl_Font_Descriptor(const char* xfontname); 00079 # else 00080 XUtf8FontStruct* font; // X UTF-8 font information 00081 FL_EXPORT Fl_Font_Descriptor(const char* xfontname); 00082 # endif 00083 Fl_Fontsize minsize; // smallest point size that should use this 00084 Fl_Fontsize maxsize; // largest point size that should use this 00085 # if HAVE_GL 00086 unsigned int listbase;// base of display list, 0 = none 00087 char glok[64]; 00088 # endif 00089 00090 FL_EXPORT ~Fl_Font_Descriptor(); 00091 00092 #endif // FL_DOXYGEN 00093 }; 00094 00095 extern FL_EXPORT Fl_Font_Descriptor *fl_fontsize; // the currently selected one 00096 00097 struct Fl_Fontdesc { 00098 const char *name; 00099 char fontname[128]; // "Pretty" font name 00100 Fl_Font_Descriptor *first; // linked list of sizes of this style 00101 # ifndef WIN32 00102 char **xlist; // matched X font names 00103 int n; // size of xlist, negative = don't free xlist! 00104 # endif 00105 }; 00106 00107 extern FL_EXPORT Fl_Fontdesc *fl_fonts; // the table 00108 00109 # ifndef WIN32 00110 // functions for parsing X font names: 00111 FL_EXPORT const char* fl_font_word(const char *p, int n); 00112 FL_EXPORT char *fl_find_fontsize(char *name); 00113 # endif 00114 00115 #endif 00116 00117 // 00118 // End of "$Id: Fl_Font.H 7913 2010-11-29 18:18:27Z greg.ercolano $". 00119 //