diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/fl_font_xft.cxx | 18 | ||||
| -rw-r--r-- | src/gl_draw.cxx | 11 |
2 files changed, 25 insertions, 4 deletions
diff --git a/src/fl_font_xft.cxx b/src/fl_font_xft.cxx index efcdd8bdf..07b65a84e 100644 --- a/src/fl_font_xft.cxx +++ b/src/fl_font_xft.cxx @@ -1,5 +1,5 @@ // -// "$Id: fl_font_xft.cxx,v 1.4.2.10 2003/01/30 21:43:54 easysw Exp $" +// "$Id: fl_font_xft.cxx,v 1.4.2.11 2003/05/04 21:58:59 easysw Exp $" // // Xft font code for the Fast Light Tool Kit (FLTK). // @@ -142,6 +142,9 @@ static XftFont* fontopen(const char* name, bool core) { Fl_FontSize::Fl_FontSize(const char* name) { encoding = fl_encoding_; size = fl_size_; +#if HAVE_GL + listbase = 0; +#endif // HAVE_GL font = fontopen(name, false); } @@ -163,6 +166,17 @@ double fl_width(uchar c) { return fl_width((const char *)(&c), 1); } +#if HAVE_GL +// This call is used by opengl to get a bitmapped font. +XFontStruct* fl_xxfont() { + if (current_font->core) return current_font->u.core.font; + static XftFont* xftfont; + if (xftfont) XftFontClose (fl_display, xftfont); + xftfont = fontopen(fl_fonts[fl_font_].name, true); + return xftfont->u.core.font; +} +#endif // HAVE_GL + #if USE_OVERLAY // Currently Xft does not work with colormapped visuals, so this probably // does not work unless you have a true-color overlay. @@ -226,5 +240,5 @@ void fl_draw(const char *str, int n, int x, int y) { } // -// End of "$Id: fl_font_xft.cxx,v 1.4.2.10 2003/01/30 21:43:54 easysw Exp $" +// End of "$Id: fl_font_xft.cxx,v 1.4.2.11 2003/05/04 21:58:59 easysw Exp $" // diff --git a/src/gl_draw.cxx b/src/gl_draw.cxx index 25ef3468f..c19d0139d 100644 --- a/src/gl_draw.cxx +++ b/src/gl_draw.cxx @@ -1,5 +1,5 @@ // -// "$Id: gl_draw.cxx,v 1.7.2.5.2.10 2003/01/30 21:44:33 easysw Exp $" +// "$Id: gl_draw.cxx,v 1.7.2.5.2.11 2003/05/04 21:58:59 easysw Exp $" // // OpenGL drawing support routines for the Fast Light Tool Kit (FLTK). // @@ -36,6 +36,10 @@ #include "Fl_Gl_Choice.H" #include "Fl_Font.H" +#if USE_XFT +extern XFontStruct* fl_xxfont(); +#endif // USE_XFT + int gl_height() {return fl_height();} int gl_descent() {return fl_descent();} double gl_width(const char* s) {return fl_width(s);} @@ -58,6 +62,9 @@ void gl_font(int fontid, int size) { aglUseFont(aglGetCurrentContext(), fl_fontsize->font, fl_fontsize->face, fl_fontsize->size, 0, 256, fl_fontsize->listbase); #else +# if USE_XFT + fl_xfont = fl_xxfont(); +# endif // USE_XFT int base = fl_xfont->min_char_or_byte2; int count = fl_xfont->max_char_or_byte2-base+1; fl_fontsize->listbase = glGenLists(256); @@ -159,5 +166,5 @@ void gl_draw_image(const uchar* b, int x, int y, int w, int h, int d, int ld) { #endif // -// End of "$Id: gl_draw.cxx,v 1.7.2.5.2.10 2003/01/30 21:44:33 easysw Exp $". +// End of "$Id: gl_draw.cxx,v 1.7.2.5.2.11 2003/05/04 21:58:59 easysw Exp $". // |
