• Main Page
  • Related Pages
  • Modules
  • Classes
  • Files
  • File List
  • File Members

Fl_Font.H

00001 //
00002 // "$Id$"
00003 //
00004 // Font definitions for the Fast Light Tool Kit (FLTK).
00005 //
00006 // Copyright 1998-2011 by Bill Spitzak and others.
00007 //
00008 // This library is free software. Distribution and use rights are outlined in
00009 // the file "COPYING" which should have been included with this file.  If this
00010 // file is missing or damaged, see the license at:
00011 //
00012 //     http://www.fltk.org/COPYING.php
00013 //
00014 // Please report all bugs and problems on the following page:
00015 //
00016 //     http://www.fltk.org/str.php
00017 //
00018 
00019 // Two internal fltk data structures:
00020 //
00021 // Fl_Fontdesc: an entry into the fl_font() table.  There is one of these
00022 // for each fltk font number.
00023 //
00024 #ifndef FL_FONT_
00025 #define FL_FONT_
00026 
00027 #include <config.h>
00028 
00029 #  if USE_XFT
00030 typedef struct _XftFont XftFont;
00031 #  elif !defined(WIN32) && !defined(__APPLE__)
00032 #    include "Xutf8.h"
00033 #  endif // USE_XFT
00034 
00041 class Fl_Font_Descriptor {
00042 public:
00044   Fl_Font_Descriptor *next;     
00045   Fl_Fontsize size; 
00046 #ifndef FL_DOXYGEN // don't bother with platorm dependant details in the doc. 
00047 #  ifdef WIN32
00048   HFONT fid;
00049   int *width[64];
00050   TEXTMETRIC metr;
00051   int angle;
00052   FL_EXPORT Fl_Font_Descriptor(const char* fontname, Fl_Fontsize size);
00053 #  elif defined(__APPLE_QUARTZ__)
00054   FL_EXPORT Fl_Font_Descriptor(const char* fontname, Fl_Fontsize size);
00055   ATSUTextLayout layout;
00056 #     if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
00057   CTFontRef fontref;
00058   // the unicode span is divided in 512 blocks of 128 characters
00059   float *width[512]; // array of arrays of character widths
00060 #     endif
00061   ATSUStyle style;
00062   short ascent, descent, q_width;
00063 #  elif USE_XFT
00064   XftFont* font;
00065   //const char* encoding;
00066   int angle;
00067   FL_EXPORT Fl_Font_Descriptor(const char* xfontname, Fl_Fontsize size, int angle);
00068 #  else
00069   XUtf8FontStruct* font;        // X UTF-8 font information
00070   FL_EXPORT Fl_Font_Descriptor(const char* xfontname);
00071 #  endif
00072 #  if HAVE_GL
00073   unsigned int listbase;// base of display list, 0 = none
00074 #ifndef __APPLE_QUARTZ__
00075   char glok[64];
00076 #endif // __APPLE_QUARTZ__
00077 #  endif // HAVE_GL
00078 
00079   FL_EXPORT ~Fl_Font_Descriptor();
00080 
00081 #endif // FL_DOXYGEN
00082 };
00083 
00084 //extern FL_EXPORT Fl_Font_Descriptor *fl_fontsize; // the currently selected one
00085 
00086 struct Fl_Fontdesc {
00087   const char *name;
00088   char fontname[128];   // "Pretty" font name
00089   Fl_Font_Descriptor *first;    // linked list of sizes of this style
00090 #  ifndef WIN32
00091   char **xlist;         // matched X font names
00092   int n;                // size of xlist, negative = don't free xlist!
00093 #  endif
00094 };
00095 
00096 extern FL_EXPORT Fl_Fontdesc *fl_fonts; // the table
00097 
00098 #  ifndef WIN32
00099 // functions for parsing X font names:
00100 FL_EXPORT const char* fl_font_word(const char *p, int n);
00101 FL_EXPORT char *fl_find_fontsize(char *name);
00102 #  endif
00103 
00104 #endif
00105 
00106 //
00107 // End of "$Id$".
00108 //
  • © 1998-2016 by Bill Spitzak and others.     FLTK

  • © 1998-2016 by Bill Spitzak and others.     FLTK

    Permission is granted to reproduce this manual or any portion for any purpose, provided this copyright and permission notice are preserved.