Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

Fl_Font.h

Go to the documentation of this file.
00001 /*
00002  * $Id: Fl_Font.h,v 1.11 2003/07/04 19:16:34 laza2000 Exp $
00003  *
00004  * Extended Fast Light Toolkit (EFLTK)
00005  * Copyright (C) 2002-2003 by EDE-Team
00006  * WWW: http://www.sourceforge.net/projects/ede
00007  *
00008  * Fast Light Toolkit (FLTK)
00009  * Copyright (C) 1998-2003 by Bill Spitzak and others.
00010  * WWW: http://www.fltk.org
00011  *
00012  * This library is distributed under the GNU LIBRARY GENERAL PUBLIC LICENSE
00013  * version 2. See COPYING for details.
00014  *
00015  * Author : Mikko Lahteenmaki
00016  * Email  : mikko@fltk.net
00017  *
00018  * Please report all bugs and problems to "efltk-bugs@fltk.net"
00019  *
00020  */
00021 
00022 #ifndef _FL_FONT_H_
00023 #define _FL_FONT_H_
00024 
00029 #include "Fl_Export.h" // for FL_API
00030 #include "Fl_String_List.h"
00031 #include "Fl_Int_List.h"
00032 
00033 class FL_API Fl_FontSize;
00034 
00035 struct FL_API Fl_Font_;
00036 typedef const Fl_Font_* Fl_Font;
00037 
00038 // This is a struct so I can init a table with constants:
00039 
00043 struct FL_API Fl_Font_ {
00044 // PRIVATE:
00045     const char* name_;
00046     Fl_Font_* bold_;
00047     Fl_Font_* italic_;
00048 
00049     // list of sizes (used by X and Win32 GDI):
00050     Fl_FontSize *first;
00051 
00052 #ifdef _WIN32
00053     // WIN32 cache stuff:
00054     Fl_CString_List *charsets_;
00055     Fl_Int_List *sizes_;
00056 #else
00057     // XWindows cache stuff:
00058     char **xlist_;
00059     int xlist_n_;
00060     uint cache_xlist();
00061     Fl_FontSize *load_font(float size);
00062 #endif
00063 // PUBLIC:
00064 
00069     const char *system_name() const { return name_; }
00070 
00075     const char *name(int *attr = 0) const;
00076 
00082     int sizes(int *&parray) const;
00083 
00092     int encodings(const char **&parray) const;
00093 
00098     Fl_Font bold() const { return bold_; }
00103     Fl_Font italic() const { return italic_; }
00104 };
00105 
00109 enum {
00110     FL_BOLD         = 1, 
00111     FL_ITALIC       = 2, 
00112     FL_BOLD_ITALIC  = 3  
00113 };
00114 
00115 // Buildin font defines:
00116 #define FL_HELVETICA             (fl_fonts+0)
00117 #define FL_HELVETICA_BOLD        (fl_fonts+1)
00118 #define FL_HELVETICA_ITALIC      (fl_fonts+2)
00119 #define FL_HELVETICA_BOLD_ITALIC (fl_fonts+3)
00120 #define FL_COURIER               (fl_fonts+4)
00121 #define FL_COURIER_BOLD          (fl_fonts+5)
00122 #define FL_COURIER_ITALIC        (fl_fonts+6)
00123 #define FL_COURIER_BOLD_ITALIC   (fl_fonts+7)
00124 #define FL_TIMES                 (fl_fonts+8)
00125 #define FL_TIMES_BOLD            (fl_fonts+9)
00126 #define FL_TIMES_ITALIC          (fl_fonts+10)
00127 #define FL_TIMES_BOLD_ITALIC     (fl_fonts+11)
00128 #define FL_SYMBOL                (fl_fonts+12)
00129 #define FL_SCREEN                (fl_fonts+13)
00130 #define FL_SCREEN_BOLD           (fl_fonts+14)
00131 #define FL_ZAPF_DINGBATS         (fl_fonts+15)
00132 
00136 extern FL_API Fl_Font_ fl_fonts[16];
00137 
00142 extern FL_API Fl_Font fl_create_font(const char *system_name);
00143 
00147 extern FL_API Fl_Font fl_find_font(const char* name, int attrib = 0);
00148 
00154 extern FL_API int fl_list_fonts(Fl_Font*& arrayp);
00155 
00156 #endif

Generated on Thu Jul 31 15:33:43 2003 for eFLTK by doxygen1.2.15