From 08e71113e9b071be540c0ecb03287e647c0bc0c5 Mon Sep 17 00:00:00 2001 From: Ian MacArthur Date: Fri, 9 Apr 2010 17:01:58 +0000 Subject: Second part of STR #2214 rework. This is the simplification of GL font selection under X11 made possible by the earlier patches from ucko. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7475 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/gl_draw.cxx | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/gl_draw.cxx b/src/gl_draw.cxx index 8bae9b51d..f0323d4ed 100644 --- a/src/gl_draw.cxx +++ b/src/gl_draw.cxx @@ -82,26 +82,17 @@ void gl_font(int fontid, int size) { #else // Fltk-1.1.8 style GL font selection #if defined (USE_X11) // X-windows options follow, either XFT or "plain" X -# if USE_XFT // XFT case -# warning We really need a glXUseXftFont implementation here... -// fl_xfont = fl_xxfont(); - XFontStruct *font = fl_xxfont(); - int base = font->min_char_or_byte2; - int count = font->max_char_or_byte2-base+1; - fl_fontsize->listbase = glGenLists(256); - glXUseXFont(font->fid, base, count, fl_fontsize->listbase+base); -# else // plain X -# warning GL font selection is basically wrong here -/* OksiD has a fairly sophisticated scheme for storing multiple X fonts in a XUtf8FontStruct, +# warning Ideally, for XFT, we really need a glXUseXftFont implementation here... +# warning GL font selection is basically wrong here +/* OksiD had a fairly sophisticated scheme for storing multiple X fonts in a XUtf8FontStruct, * then sorting through them at draw time (for normal X rendering) to find which one can * render the current glyph... But for now, just use the first font in the list for GL... */ - XFontStruct *tmp_font = fl_fontsize->font->fonts[0]; // this is certainly wrong! - int base = tmp_font->min_char_or_byte2; - int count = tmp_font->max_char_or_byte2-base+1; + XFontStruct *font = fl_xfont; + int base = font->min_char_or_byte2; + int count = font->max_char_or_byte2-base+1; fl_fontsize->listbase = glGenLists(256); - glXUseXFont(tmp_font->fid, base, count, fl_fontsize->listbase+base); -# endif // USE_XFT + glXUseXFont(font->fid, base, count, fl_fontsize->listbase+base); # elif defined(WIN32) int base = fl_fontsize->metr.tmFirstChar; int count = fl_fontsize->metr.tmLastChar-base+1; -- cgit v1.2.3