2 // "$Id: Fl_Font.H 8428 2011-02-15 15:47:22Z manolo $"
4 // Font definitions for the Fast Light Tool Kit (FLTK).
6 // Copyright 1998-2011 by Bill Spitzak and others.
8 // This library is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU Library General Public
10 // License as published by the Free Software Foundation; either
11 // version 2 of the License, or (at your option) any later version.
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Library General Public License for more details.
18 // You should have received a copy of the GNU Library General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
23 // Please report all bugs and problems on the following page:
25 // http://www.fltk.org/str.php
28 // Two internal fltk data structures:
30 // Fl_Fontdesc: an entry into the fl_font() table. There is one of these
31 // for each fltk font number.
39 typedef struct _XftFont XftFont;
40 # elif !defined(WIN32) && !defined(__APPLE__)
41 # include <FL/Xutf8.h>
45 This a structure for an actual system font, with junk to
46 help choose it and info on character sizes. Each Fl_Fontdesc has a
47 linked list of these. These are created the first time each system
48 font/size combination is used.
50 class Fl_Font_Descriptor {
52 /** linked list for this Fl_Fontdesc */
53 Fl_Font_Descriptor *next;
54 Fl_Fontsize size; /**< font size */
55 #ifndef FL_DOXYGEN // don't bother with platorm dependant details in the doc.
61 FL_EXPORT Fl_Font_Descriptor(const char* fontname, Fl_Fontsize size);
62 # elif defined(__APPLE_QUARTZ__)
63 FL_EXPORT Fl_Font_Descriptor(const char* fontname, Fl_Fontsize size);
64 ATSUTextLayout layout;
65 # if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_5
67 // the unicode span is divided in 512 blocks of 128 characters
68 float *width[512]; // array of arrays of character widths
71 short ascent, descent, q_width;
75 //const char* encoding;
77 FL_EXPORT Fl_Font_Descriptor(const char* xfontname, Fl_Fontsize size, int angle);
79 XUtf8FontStruct* font; // X UTF-8 font information
80 FL_EXPORT Fl_Font_Descriptor(const char* xfontname);
83 unsigned int listbase;// base of display list, 0 = none
84 #ifndef __APPLE_QUARTZ__
86 #endif // __APPLE_QUARTZ__
89 FL_EXPORT ~Fl_Font_Descriptor();
94 //extern FL_EXPORT Fl_Font_Descriptor *fl_fontsize; // the currently selected one
98 char fontname[128]; // "Pretty" font name
99 Fl_Font_Descriptor *first; // linked list of sizes of this style
101 char **xlist; // matched X font names
102 int n; // size of xlist, negative = don't free xlist!
106 extern FL_EXPORT Fl_Fontdesc *fl_fonts; // the table
109 // functions for parsing X font names:
110 FL_EXPORT const char* fl_font_word(const char *p, int n);
111 FL_EXPORT char *fl_find_fontsize(char *name);
117 // End of "$Id: Fl_Font.H 8428 2011-02-15 15:47:22Z manolo $".