fltk  1.3.5-source
About: FLTK (Fast Light Tool Kit) is a cross-platform C++ GUI toolkit for UNIX/Linux (X11), Microsoft Windows, and MacOS X.
  Fossies Dox: fltk-1.3.5-source.tar.bz2  ("inofficial" and yet experimental doxygen-generated source code documentation)  

Fl_Font.H
Go to the documentation of this file.
1 //
2 // "$Id$"
3 //
4 // Font definitions for the Fast Light Tool Kit (FLTK).
5 //
6 // Copyright 1998-2011 by Bill Spitzak and others.
7 //
8 // This library is free software. Distribution and use rights are outlined in
9 // the file "COPYING" which should have been included with this file. If this
10 // file is missing or damaged, see the license at:
11 //
12 // http://www.fltk.org/COPYING.php
13 //
14 // Please report all bugs and problems on the following page:
15 //
16 // http://www.fltk.org/str.php
17 //
18 
19 // Two internal fltk data structures:
20 //
21 // Fl_Fontdesc: an entry into the fl_font() table. There is one of these
22 // for each fltk font number.
23 //
24 #ifndef FL_FONT_
25 #define FL_FONT_
26 
27 #include <config.h>
28 
29 # if USE_XFT
30 typedef struct _XftFont XftFont;
31 # elif !defined(WIN32) && !defined(__APPLE__)
32 # include "Xutf8.h"
33 # endif // USE_XFT
34 
42 public:
46 #ifndef FL_DOXYGEN // don't bother with platorm dependant details in the doc.
47 # ifdef WIN32
48  HFONT fid;
49  int *width[64];
50  TEXTMETRIC metr;
51  int angle;
52  FL_EXPORT Fl_Font_Descriptor(const char* fontname, Fl_Fontsize size);
53 # elif defined(__APPLE_QUARTZ__)
54  FL_EXPORT Fl_Font_Descriptor(const char* fontname, Fl_Fontsize size);
55  ATSUTextLayout layout;
56 # if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
57  CTFontRef fontref;
58  // the unicode span is divided in 512 blocks of 128 characters
59  float *width[512]; // array of arrays of character widths
60 # endif
61  ATSUStyle style;
62  short ascent, descent, q_width;
63 # elif USE_XFT
64  XftFont* font;
65  //const char* encoding;
66  int angle;
67  FL_EXPORT Fl_Font_Descriptor(const char* xfontname, Fl_Fontsize size, int angle);
68 # else
69  XUtf8FontStruct* font; // X UTF-8 font information
70  FL_EXPORT Fl_Font_Descriptor(const char* xfontname);
71 # endif
72 # if HAVE_GL
73  unsigned int listbase;// base of display list, 0 = none
74 #ifndef __APPLE_QUARTZ__
75  char glok[64];
76 #endif // __APPLE_QUARTZ__
77 # endif // HAVE_GL
78 
80 
81 #endif // FL_DOXYGEN
82 };
83 
84 //extern FL_EXPORT Fl_Font_Descriptor *fl_fontsize; // the currently selected one
85 
86 struct Fl_Fontdesc {
87  const char *name;
88  char fontname[128]; // "Pretty" font name
89  Fl_Font_Descriptor *first; // linked list of sizes of this style
90 # ifndef WIN32
91  char **xlist; // matched X font names
92  int n; // size of xlist, negative = don't free xlist!
93 # endif
94 };
95 
96 extern FL_EXPORT Fl_Fontdesc *fl_fonts; // the table
97 
98 # ifndef WIN32
99 // functions for parsing X font names:
100 FL_EXPORT const char* fl_font_word(const char *p, int n);
101 FL_EXPORT char *fl_find_fontsize(char *name);
102 # endif
103 
104 #endif
105 
106 //
107 // End of "$Id$".
108 //
Fl_Fontdesc
Definition: Fl_Font.H:86
Fl_Fontdesc::n
int n
Definition: Fl_Font.H:92
Fl_Fontdesc::xlist
char ** xlist
Definition: Fl_Font.H:91
FL_EXPORT
#define FL_EXPORT
Definition: Fl_Export.H:35
Fl_Fontdesc::name
const char * name
Definition: Fl_Font.H:87
Fl_Font_Descriptor::font
XUtf8FontStruct * font
Definition: Fl_Font.H:69
fl_find_fontsize
FL_EXPORT char * fl_find_fontsize(char *name)
Definition: fl_font_x.cxx:87
p
static menustate * p
Definition: Fl_Menu.cxx:606
fl_font_word
const FL_EXPORT char * fl_font_word(const char *p, int n)
Definition: fl_font_x.cxx:81
Fl_Font_Descriptor::next
Fl_Font_Descriptor * next
Definition: Fl_Font.H:44
Fl_Fontsize
int Fl_Fontsize
Definition: Enumerations.H:906
Fl_Fontdesc::fontname
char fontname[128]
Definition: Fl_Font.H:88
Fl_Fontdesc::first
Fl_Font_Descriptor * first
Definition: Fl_Font.H:89
XUtf8FontStruct
Definition: Xutf8.h:30
Fl_Font_Descriptor::Fl_Font_Descriptor
FL_EXPORT Fl_Font_Descriptor(const char *xfontname)
Definition: fl_font_mac.cxx:36
Fl_Font_Descriptor::size
Fl_Fontsize size
Definition: Fl_Font.H:45
fl_fonts
FL_EXPORT Fl_Fontdesc * fl_fonts
Definition: fl_font_mac.cxx:22
name
static const char * name
Definition: Fl_arg.cxx:53
Fl_Font_Descriptor::~Fl_Font_Descriptor
FL_EXPORT ~Fl_Font_Descriptor()
Definition: fl_font_mac.cxx:155
Fl_Font_Descriptor
Definition: Fl_Font.H:41
Xutf8.h