FLTK logo

[Library] r7475 - branches/branch-1.3/src

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.commit  ]
 
Previous Message ]Next Message ]

[Library] r7475 - branches/branch-1.3/src fltk-dev Apr 09, 2010  
 
Author: ianmacarthur
Date: 2010-04-09 10:01:58 -0700 (Fri, 09 Apr 2010)
New Revision: 7475
Log:
Second part of STR #2214 rework.

This is the simplification of GL font selection under X11 made possible
by the earlier patches from ucko.



Modified:
   branches/branch-1.3/src/gl_draw.cxx

Modified: branches/branch-1.3/src/gl_draw.cxx
===================================================================
--- branches/branch-1.3/src/gl_draw.cxx	2010-04-09 16:46:45 UTC (rev 7474)
+++ branches/branch-1.3/src/gl_draw.cxx	2010-04-09 17:01:58 UTC (rev 7475)
@@ -82,26 +82,17 @@
 #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;

Direct Link to Message ]
 
     
Previous Message ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.