After testing, I have applied ucko's latest patch for providing access
to "core" fonts when XFT is selected. This allows contexts that need
bitmapped fonts (e.g. GL) to access a bitmap core font, even though
XFT2 does not generally provide bitmap font access.
STR #2214 refers.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7474 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
@ -312,12 +320,12 @@ void fl_text_extents(const char *c, int n, int &dx, int &dy, int &W, int &H) {
@@ -312,12 +320,12 @@ void fl_text_extents(const char *c, int n, int &dx, int &dy, int &W, int &H) {
voidFl_Device::draw(constchar*c,intn,intx,inty){
if(font_gc!=fl_gc){
if(!fl_xfont)fl_font(FL_HELVETICA,14);
if(!current_font)fl_font(FL_HELVETICA,14);
font_gc=fl_gc;
XSetFont(fl_display,fl_gc,fl_xfont->fid);
XSetFont(fl_display,fl_gc,current_font->fid);
}
// XDrawString(fl_display, fl_window, fl_gc, x, y, c, n);
fprintf(stderr,"ROTATING TEXT NOT IMPLIMENTED\n");
@ -329,10 +337,10 @@ void Fl_Device::draw(int angle, const char *str, int n, int x, int y) {
@@ -329,10 +337,10 @@ void Fl_Device::draw(int angle, const char *str, int n, int x, int y) {
@ -372,17 +373,16 @@ void fl_text_extents(const char *c, int n, int &dx, int &dy, int &w, int &h) {
@@ -372,17 +373,16 @@ void fl_text_extents(const char *c, int n, int &dx, int &dy, int &w, int &h) {
}// fl_text_extents
#if HAVE_GL
/* This code is used by opengl to get a bitmapped font. The original XFT-1 code
// This function attempts, on XFT2 systems, to find a suitable "core" Xfont
// for GL to use, since we dont have an XglUseXftFont(...) function.
// for GL or other bitmap font needs (we dont have an XglUseXftFont(...) function.)
// There's probably a better way to do this. I can't believe it is this hard...
// Anyway... This code attempts to make an XLFD out of the fltk-style font
// name it is passed, then tries to load that font. Surprisingly, this quite
@ -392,8 +392,8 @@ void fl_text_extents(const char *c, int n, int &dx, int &dy, int &w, int &h) {
@@ -392,8 +392,8 @@ void fl_text_extents(const char *c, int n, int &dx, int &dy, int &w, int &h) {
// If this code fails to load the requested font, it falls back through a
// series of tried 'n tested alternatives, ultimately resorting to what the
// original fltk code did.
// NOTE: On my test boxes (FC6, FC7, FC8, ubuntu8.04) this works well for the
// fltk "built-in" font names.
// NOTE: On my test boxes (FC6, FC7, FC8, ubuntu8.04, 9.04, 9.10) this works