FLTK 1.3.2

- Main Page
- Related Pages
- Modules
- Classes
- Files

- File List
- File Members

Fl_Font.H
1 //
2 // "$Id: Fl_Font.H 8864 2011-07-19 04:49:30Z greg.ercolano $"
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 <FL/Xutf8.h>
33 # endif // USE_XFT
34
41 class Fl_Font_Descriptor {
42 public:
44 Fl_Font_Descriptor *next;
45 Fl_Fontsize size;
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 char *q_name;
64 # elif USE_XFT
65 XftFont* font;
66 //const char* encoding;
67 int angle;
68 FL_EXPORT Fl_Font_Descriptor(const char* xfontname, Fl_Fontsize size, int angle);
69 # else
70 XUtf8FontStruct* font; // X UTF-8 font information
71 FL_EXPORT Fl_Font_Descriptor(const char* xfontname);
72 # endif
73 # if HAVE_GL
74 unsigned int listbase;// base of display list, 0 = none
75 #ifndef __APPLE_QUARTZ__
76 char glok[64];
77 #endif // __APPLE_QUARTZ__
78 # endif // HAVE_GL
79
80 FL_EXPORT ~Fl_Font_Descriptor();
81
82 #endif // FL_DOXYGEN
83 };
84
85 //extern FL_EXPORT Fl_Font_Descriptor *fl_fontsize; // the currently selected one
86
87 struct Fl_Fontdesc {
88 const char *name;
89 char fontname[128]; // "Pretty" font name
90 Fl_Font_Descriptor *first; // linked list of sizes of this style
91 # ifndef WIN32
92 char **xlist; // matched X font names
93 int n; // size of xlist, negative = don't free xlist!
94 # endif
95 };
96
97 extern FL_EXPORT Fl_Fontdesc *fl_fonts; // the table
98
99 # ifndef WIN32
100 // functions for parsing X font names:
101 FL_EXPORT const char* fl_font_word(const char *p, int n);
102 FL_EXPORT char *fl_find_fontsize(char *name);
103 # endif
104
105 #endif
106
107 //
108 // End of "$Id: Fl_Font.H 8864 2011-07-19 04:49:30Z greg.ercolano $".
109 //
Fl_Font_Descriptor
This a structure for an actual system font, with junk to help choose it and info on character sizes...
Definition: Fl_Font.H:41
XUtf8FontStruct
Definition: Xutf8.h:29
Fl_Font_Descriptor::size
Fl_Fontsize size
font size
Definition: Fl_Font.H:45
Fl_Fontsize
int Fl_Fontsize
Size of a font in pixels.
Definition: Enumerations.H:746
Fl_Font_Descriptor::next
Fl_Font_Descriptor * next
linked list for this Fl_Fontdesc
Definition: Fl_Font.H:44
Fl_Fontdesc
Definition: Fl_Font.H:87
- © 1998-2012 by Bill Spitzak and others.