summaryrefslogtreecommitdiff
path: root/src/Fl_Font.H
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2002-03-06 18:11:01 +0000
committerMichael R Sweet <michael.r.sweet@gmail.com>2002-03-06 18:11:01 +0000
commite52b682a995fe2d7662b3f10730420996ccbb146 (patch)
treed7bbbd4de9e9728191bb2407e763437366806b00 /src/Fl_Font.H
parent394286265a96aa27fbedc0cd58c5bb33366123b3 (diff)
Add Xft support to 1.1.x.
TODO: Fl::set_fonts() should add all of the fonts returned by Xft; right now it is a no-op. BUG: Getting X messages like "XRequest.155: 202 0x260002b" for some reason on my system. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@1987 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Font.H')
-rw-r--r--src/Fl_Font.H35
1 files changed, 22 insertions, 13 deletions
diff --git a/src/Fl_Font.H b/src/Fl_Font.H
index 3652c4a1e..80cab8254 100644
--- a/src/Fl_Font.H
+++ b/src/Fl_Font.H
@@ -1,9 +1,9 @@
//
-// "$Id: Fl_Font.H,v 1.6.2.3.2.1 2001/11/27 17:44:06 easysw Exp $"
+// "$Id: Fl_Font.H,v 1.6.2.3.2.2 2002/03/06 18:11:01 easysw Exp $"
//
// Font definitions for the Fast Light Tool Kit (FLTK).
//
-// Copyright 1998-2001 by Bill Spitzak and others.
+// Copyright 1998-2002 by Bill Spitzak and others.
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public
@@ -36,29 +36,38 @@
#ifndef FL_FONT_
#define FL_FONT_
+# if USE_XFT
+typedef struct _XftFont XftFont;
+# endif // USE_XFT
+
class Fl_FontSize {
public:
Fl_FontSize *next; // linked list for this Fl_Fontdesc
-#ifdef WIN32
+# ifdef WIN32
HFONT fid;
int width[256];
TEXTMETRIC metr;
FL_EXPORT Fl_FontSize(const char* fontname, int size);
-#elif defined(__APPLE__)
+# elif defined(__APPLE__)
FL_EXPORT Fl_FontSize(const char* fontname, int size);
short font, face, size;
short ascent, descent;
short width[256];
bool knowMetrics;
-#else
+# elif USE_XFT
+ XftFont* font;
+ const char* encoding;
+ int size;
+ FL_EXPORT Fl_FontSize(const char* xfontname);
+# else
XFontStruct* font; // X font information
FL_EXPORT Fl_FontSize(const char* xfontname);
-#endif
+# endif
int minsize; // smallest point size that should use this
int maxsize; // largest point size that should use this
-#if HAVE_GL
+# if HAVE_GL
unsigned int listbase;// base of display list, 0 = none
-#endif
+# endif
FL_EXPORT ~Fl_FontSize();
};
@@ -67,22 +76,22 @@ extern FL_EXPORT Fl_FontSize *fl_fontsize; // the currently selected one
struct Fl_Fontdesc {
const char *name;
Fl_FontSize *first; // linked list of sizes of this style
-#ifndef WIN32
+# ifndef WIN32
char **xlist; // matched X font names
int n; // size of xlist, negative = don't free xlist!
-#endif
+# endif
};
extern FL_EXPORT Fl_Fontdesc *fl_fonts; // the table
-#ifndef WIN32
+# ifndef WIN32
// functions for parsing X font names:
FL_EXPORT const char* fl_font_word(const char *p, int n);
FL_EXPORT char *fl_find_fontsize(char *name);
-#endif
+# endif
#endif
//
-// End of "$Id: Fl_Font.H,v 1.6.2.3.2.1 2001/11/27 17:44:06 easysw Exp $".
+// End of "$Id: Fl_Font.H,v 1.6.2.3.2.2 2002/03/06 18:11:01 easysw Exp $".
//